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

height (header version) specific output PMMR root rules #3147

Merged
merged 4 commits into from
Dec 5, 2019

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Nov 29, 2019

This PR introduces the necessary consensus rule change to support "enable faster sync" mimblewimble/grin-rfcs#29.

HF2 will change the meaning of the output_root field on block headers.

  • Prior to HF2 the output_root is simply to root of the output PMMR.
  • Post HF2 the output_root is a combined root of both the output PMMR and the associated "bitmap accumulator" representation of the PMMR leafset.

This PR introduces the following changes -

  • add block height aware output_root rules (base logic on validated header version)
  • pipe::validate_header() now explicitly validates the header version for the given block height
    • this was implicit before (and not exercised at all in the tests or locally in user_testing)
  • add testing specific fork heights for use in user_testing and automated_testing to exercise HF rules in tests
    • we now exercise HF1 at height 3 and HF2 at height 6 in tests and locally in user_testing

@antiochp antiochp added this to the 3.0.0 milestone Dec 3, 2019
@quentinlesceller quentinlesceller added the consensus breaking Use for issues or PRs that will break consensus and force a hard fork label Dec 3, 2019
chain/src/chain.rs Outdated Show resolved Hide resolved
Copy link
Member

@yeastplume yeastplume left a comment

Choose a reason for hiding this comment

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

All looks good to me

chain/src/types.rs Outdated Show resolved Hide resolved
Copy link
Member

@quentinlesceller quentinlesceller left a comment

Choose a reason for hiding this comment

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

Looking good 👍

chain/src/types.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@tromp tromp left a comment

Choose a reason for hiding this comment

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

approved modulo suggested comment improvement

@antiochp
Copy link
Member Author

antiochp commented Dec 5, 2019

Will merge once CI passes.

@antiochp antiochp merged commit 0b21ee6 into mimblewimble:master Dec 5, 2019
@antiochp antiochp deleted the output_pmmr_root_rules branch December 5, 2019 11:55
@antiochp antiochp mentioned this pull request Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus breaking Use for issues or PRs that will break consensus and force a hard fork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants