-
Notifications
You must be signed in to change notification settings - Fork 204
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
proper fix for meta sync #6759
proper fix for meta sync #6759
Conversation
process/block/metablock.go
Outdated
if !mp.proofsPool.HasProof(shardData.ShardID, shardData.HeaderHash) { | ||
log.Trace("could not find proof for shard data, requesting the next shard header", "current hash", hex.EncodeToString(shardData.HeaderHash)) | ||
err := mp.requestNextHeaderBlocking(shardHeader.hdr.GetNonce()+1, shardData.ShardID) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if !mp.proofsPool.HasProof(shardData.ShardID, shardData.HeaderHash) { | ||
return fmt.Errorf("%w for header hash %s", process.ErrMissingHeaderProof, hex.EncodeToString(shardData.HeaderHash)) | ||
} | ||
} |
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.
we can extract this check into a common function
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.
extracted
process/block/metablock.go
Outdated
@@ -267,6 +268,7 @@ func (mp *metaProcessor) ProcessBlock( | |||
|
|||
defer func() { | |||
if err != nil { | |||
log.Error("failed", "error", err, "stack", string(debug.Stack())) |
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.
update log message here?
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.
used for debugging, removed it
process/block/shardblock.go
Outdated
@@ -301,12 +301,24 @@ func (sp *shardProcessor) ProcessBlock( | |||
return fmt.Errorf("%w for header hash %s", process.ErrMissingHeader, hex.EncodeToString(metaBlockHash)) | |||
} | |||
|
|||
if !common.ShouldBlockHavePrevProof(hInfo.hdr, sp.enableEpochsHandler, common.EquivalentMessagesFlag) { |
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.
I do not think this is correct to continue if the header does not have previous proof
this does not say anything about the proof for the header itself, and if that is missing, the block should not be processed.
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.
indeed, pushed
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
?