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

fix: when validating a block, clone the blocks version #5539

Merged
merged 3 commits into from
Dec 8, 2024

Conversation

hstove
Copy link
Contributor

@hstove hstove commented Dec 6, 2024

When nodes change their NAKAMOTO_BLOCK_VERSION, unupgraded signers reject the block, because the unupgraded signers use the old version when trying to clone (and compare the block hash) of the proposed block.

This change has the block validation endpoint clone the version of the proposed block to the local block, so that the block hash will match.

We may need more validation here about what a valid block version is - for example, I believe it needs to be <128, or it is treated as a shadow block. Thus, opening as a draft.

@hstove hstove requested a review from jcnelson December 6, 2024 23:20
jcnelson
jcnelson previously approved these changes Dec 7, 2024
Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

Great catch! LGTM

obycode
obycode previously approved these changes Dec 7, 2024
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

👍

jferrant
jferrant previously approved these changes Dec 7, 2024
Copy link
Collaborator

@jferrant jferrant left a comment

Choose a reason for hiding this comment

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

Wow! Great find @hstove

@hstove hstove marked this pull request as ready for review December 8, 2024 00:42
@hstove hstove requested a review from a team as a code owner December 8, 2024 00:42
@hstove hstove enabled auto-merge December 8, 2024 00:50
@hstove hstove added this pull request to the merge queue Dec 8, 2024
@hstove hstove removed this pull request from the merge queue due to a manual request Dec 8, 2024
@hstove hstove dismissed stale reviews from jferrant, obycode, and jcnelson via 4f5f6f6 December 8, 2024 01:04
@hstove hstove requested a review from a team as a code owner December 8, 2024 01:04
@obycode obycode added this pull request to the merge queue Dec 8, 2024
Merged via the queue into develop with commit b93f2f5 Dec 8, 2024
147 of 157 checks passed
@hstove hstove deleted the fix/block-validation-version branch December 8, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants