Skip to content
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

Merged
merged 7 commits into from
Jan 30, 2025
Merged

Conversation

sstanculeanu
Copy link
Collaborator

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:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@sstanculeanu sstanculeanu added the ignore-for-release-notes Do not include item in release notes label Jan 30, 2025
@sstanculeanu sstanculeanu self-assigned this Jan 30, 2025
Comment on lines 446 to 456
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))
}
}
Copy link
Contributor

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extracted

@@ -267,6 +268,7 @@ func (mp *metaProcessor) ProcessBlock(

defer func() {
if err != nil {
log.Error("failed", "error", err, "stack", string(debug.Stack()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update log message here?

Copy link
Collaborator Author

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

@@ -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) {
Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, pushed

@sstanculeanu sstanculeanu merged commit 19aa5a0 into feat/equivalent-messages Jan 30, 2025
4 checks passed
@sstanculeanu sstanculeanu deleted the further_sync_fixes branch January 30, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release-notes Do not include item in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants