-
Notifications
You must be signed in to change notification settings - Fork 106
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
Clean up block commitment enum and parsing #1958
Clean up block commitment enum and parsing #1958
Conversation
This change parses the hash, but does not perform validation.
- change Block::commitment to return a Result rather than an Option - enforce the all-zeroes reserved value consensus rules - change `PreSaplingReserved([u8; 32])` to `PreSaplingReserved` - change `ChainHistoryActivationReserved([u8; 32])` to `ChainHistoryActivationReserved` - update the function comments to describe when each variant is verified
I'm setting this to draft until #1957 merges. |
@oxarbitrage is busy, so pinging @dconnolly for this. |
/// since Zebra checkpoints on Canopy, we don't need to validate this | ||
/// field, but since it's included in the ChainHistoryRoot, we are | ||
/// already calculating it, so we might as well validate it | ||
FinalSaplingRoot(sapling::tree::Root), |
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.
👍
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.
👍
|
||
/// Errors that can occur when checking RootHash consensus rules. | ||
/// | ||
/// Each error variant corresponds to a consensus rule, so enumerating |
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.
💖
Motivation
The goal of this PR is to finish the outstanding cleanups on the block commitment field from #881.
After they're done, we can create a good design for its
FinalSaplingRoot
,ChainHistoryRoot
, andBlockCommitments
variants.Solution
Sapling
tree roots from other tree rootsNU5
BlockCommitmentsHash
variant toblock::Commitment
Block::commitment
This PR is based on #1957.
Review
@oxarbitrage is going to work on ZIP-244 and ZIP-221 with me, so he can review this.
Related Issues
Closes #881
Makes some progress on #1874
Follow Up Work
Do a design for #1874, #1567, and #958