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

rewrite & sign off on snippet verify_mmr_successor #152

Merged
merged 5 commits into from
Jan 13, 2025

Conversation

jan-ferdinand
Copy link
Member

Re-write snippet verify_mmr_successor to mimic the new algorithm introduced in twenty-first v0.44.1. Add additional snippets u64::trailing_zeros and hashing::merkle_step_mem_u64, which are needed for the new verification algorithm.

BREAKING CHANGE: Remove snippet `u64::index_of_last_nonzero_bit`, which
more or less computes the same thing as `trailing_zeros`, but is less
efficient, less general since it fails on input “0”, and uses an
uncommon name.
BREAKING CHANGE: Remove the implementation of `DeprecatedSnippet` for
`u64::shift_left::ShiftLeft`, implement `BasicSnippet` directly.
Rewrite the snippet to use the new algorithm introduced in
`twenty-first` v0.44.1.

Also:
- document & sign-off on the snippet
- add additional negative test cases
Copy link
Contributor

@Sword-Smith Sword-Smith left a comment

Choose a reason for hiding this comment

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

Very cool performance increase!

@jan-ferdinand jan-ferdinand merged commit 94fb493 into master Jan 13, 2025
3 checks passed
@jan-ferdinand jan-ferdinand deleted the snippet_sign_off_verify_mmr_successor branch January 13, 2025 12:58
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.

2 participants