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

Fixed self-blacklisted event in consensus due to edge case when setting the epoch as proposer #5006

Merged
merged 2 commits into from Feb 24, 2023

Conversation

iulianpascalau
Copy link
Contributor

Reasoning behind the pull request

  • when the epoch is set on the shard block processor in CreateNewHeader the leader might get the new epoch start metablock in an async matter, thus incorrectly setting the EpochStartMetaHash value in CreateBlock function but on the previous epoch

Proposed changes

  • if the metablock to be referenced is of type start of epoch block, rewrite the epoch on the shard block, if required, preventing the block to be discarded

Testing procedure

  • normal system testnet, grepping the logs for shardProcessor.CreateBlock: epoch from the header is not the same as epoch from epoch start trigger, overwriting

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?

if initialHdr.GetEpoch() != epoch {
log.Debug("shardProcessor.CreateBlock: epoch from header is not the same as epoch from epoch start trigger, overwriting",
"epoch from header", initialHdr.GetEpoch(), "epoch from epoch start trigger", epoch)
err = shardHdr.SetEpoch(epoch)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

System test passed .

@@ Log scanner @@

fix-shard-header-construction-epoch

================================================================================

  • Known Warnings 12
  • New Warnings 5
  • Known Errors 0
  • New Errors 0
  • Panics 0
    ================================================================================
  • block hash does not match 23649
  • miniblocks does not match 0
  • miniblock hash does not match 0
  • receipts hash missmatch 0
  • wrong nonce in block 7315
    ================================================================================
  • No jailed nodes on the thestnet
    ================================================================================

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (rc/v1.6.0@5fcba4f). Click here to learn what that means.
Patch has no changes to coverable lines.

❗ Current head 79aa15f differs from pull request most recent head ececb73. Consider uploading reports for the commit ececb73 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@             Coverage Diff              @@
##             rc/v1.6.0    #5006   +/-   ##
============================================
  Coverage             ?   70.66%           
============================================
  Files                ?      666           
  Lines                ?    86523           
  Branches             ?        0           
============================================
  Hits                 ?    61140           
  Misses               ?    20791           
  Partials             ?     4592           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@iulianpascalau iulianpascalau merged commit 1c7e901 into rc/v1.6.0 Feb 24, 2023
@iulianpascalau iulianpascalau deleted the fix-shard-header-construction-epoch branch February 24, 2023 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants