-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyperblock processor #4
Conversation
return err | ||
} | ||
|
||
if outportBlock == nil || outportBlock.BlockData == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can outportBlock
ever be nil? thinking of removing the check since it might be redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, if marshalledData
is nil, the marshaller will return nil on Unmarshall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right. missed that, thanks for the clarification.
go.mod
Outdated
github.com/multiversx/mx-chain-communication-go v1.0.12 | ||
github.com/multiversx/mx-chain-core-go v1.2.18 | ||
github.com/multiversx/mx-chain-logger-go v1.0.13 | ||
github.com/multiversx/mx-chain-communication-go v1.0.13-0.20240126121117-627adccf10ad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the changes here needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest storage version does not work with core 1.2.18, we might need to have a new storage version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the meantime, we have storage v1.0.15 which works well with latest core version; updated storage version
) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
// TODO: move cache to config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will you move this to config in the next task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this is already done on next PR
process/dataProcessor.go
Outdated
blocksPool BlocksPool, | ||
dataAggregator DataAggregator, | ||
) (DataProcessor, error) { | ||
if publisher == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason not to include IsInterfaceNil in the interface and then check here with check.ifnil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to use check.IfNil
} | ||
|
||
// Close will close the internal writer | ||
func (dp *dataProcessor) Close() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close will need to persist also block pool data.
can be done on the next PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done on next PR 👍
process/dataProcessor_test.go
Outdated
func TestDataProcessor_ProcessPayload(t *testing.T) { | ||
t.Parallel() | ||
|
||
t.Run("nil outport block, should return error", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change description to nil outport block data...
instead of nil outport block...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// notarized shards data | ||
func (da *dataAggregator) ProcessHyperBlock(outportBlock *outport.OutportBlock) (*data.HyperOutportBlock, error) { | ||
hyperOutportBlock := &data.HyperOutportBlock{} | ||
hyperOutportBlock.MetaOutportBlock = outportBlock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe some check that the received outport block is indeed a metablock, e.g. check the ShardID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added shard id check
Added hyper outport block processor components: