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
Fixing hyperblock partial mb handling - part1 #5638
Fixing hyperblock partial mb handling - part1 #5638
Conversation
…lock-partial-mb-handling-part1
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## feat/dblookupext-partial-miniblocks #5638 +/- ##
=======================================================================
- Coverage 80.16% 80.12% -0.04%
=======================================================================
Files 708 709 +1
Lines 93875 93982 +107
=======================================================================
+ Hits 75254 75305 +51
- Misses 13283 13328 +45
- Partials 5338 5349 +11
☔ View full report in Codecov by Sentry. |
…dling-part1' into fixing-hyperblock-partial-mb-handling-part1
TxHashesWhenPartial: nil, | ||
IndexOfFirstTxProcessed: 0, |
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.
Re-indexing (db lookup extensions) from the epoch that enabled partial miniblocks needed, though.
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, to fix old, broken, miniblocks
mbHandler := createMockMiniblocksHandler() | ||
|
||
header1 := &block.Header{ | ||
Epoch: 37, |
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.
🙈
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.
lucky 37 🍀
} | ||
|
||
for index, mb := range blockBody.MiniBlocks { | ||
miniblockHash, err := core.CalculateHash(mh.marshaller, mh.hasher, mb) |
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.
L31-34 can be moved inside handleMiniblock
func
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 will overcomplicate the returning errors on handleMiniblock as I want to know the miniblock hash when wrapping the error on L38
dblookupext/miniblocksHandler.go
Outdated
return nil | ||
} | ||
|
||
func (mh *miniblocksHandler) getExecutedTxHashes(miniblockHeader data.MiniBlockHeaderHandler, mb *block.MiniBlock) [][]byte { |
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.
getOrderedExecutedTxHashes
?
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.
renamed
dblookupext/miniblocksHandler.go
Outdated
NumTxHashesInMiniblock: int32(len(mb.TxHashes)), | ||
} | ||
|
||
var txHasheshenPartial [][]byte |
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.
typo
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.
fixed
dblookupext/miniblocksHandler.go
Outdated
func (mh *miniblocksHandler) loadExistingMiniblocksMetadata(miniblockHash []byte, epoch uint32) (*MiniblockMetadataV2, error) { | ||
multipleMiniblockMetadata := &MiniblockMetadataV2{} | ||
buff, err := mh.miniblocksMetadataStorer.GetFromEpoch(miniblockHash, epoch) | ||
if err == storage.ErrKeyNotFound { |
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.
Use errors.Is
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.
fixed
bf8217d
into
feat/dblookupext-partial-miniblocks
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?