Include block header in leaf commitment #3647
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR:
commit
method to the inherent impl forLeaf
. Note that this method is named intentionally to conflict withcommit()
, from theCommittable
implementation forLeaf
defined in the same module. This means that the compiler will reject an attempt to writeleaf.commit()
, forcing you to write<Leaf<TYPES> as Committable>::commit()
to refer to the old commitment. Additionally, the newercommit
is an async function requiring an extra argument, which should make it virtually impossible to mix up.upgrade_lock
to every place the leaf commitment was used.QuorumCertificate::genesis
now requires a version parameter, since the leaf commitment it uses now depends on the version.This PR does not:
test_success_marketplace
to fail if we missed something in the leaf commitment calculation.Key places to review:
types/src/data.rs
-- please triple-check the new commitment carefully. All other changes are a consequence of that change.