-
Notifications
You must be signed in to change notification settings - Fork 2
Thv/root from auth struct #121
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add stub for calculating a Merkle root from an authentication struct. Also adds code to generate the witness. Cf. Neptune-Crypto/twenty-first#228
…of leafs When calculating the root, don't allow the list of leafs to be empty. We think we never need the snippet with those inputs, so that should be fine. It makes the initialization of the `t` value (that should end up containing the root) simpler, as we can do: ```rust let mut t = indexed_leafs.first().unwrap().1; ``` instead of ```rust let mut t = auth_struct .first() .copied() .unwrap_or_else(|| indexed_leafs.first().unwrap().1); ``` Code works with sane test.
Make Rust-shadowing and state initialization nicer.
Instead of storing this value to memory in each loop iteration, we just calculate it from `t: Digest` when we need it.
…x, not parent_index It's a bit more performant to store `left_index` on the stack and then calculate from it `parent_index` and `right_index` then to store `parent_index` as we did before and calculate the left and right index from that.
In a mutator-set context for which this is developed, the leaf-indices will be grouped together. The benchmark now reflects that.
Let's fix the build on |
Is this PR still relevant? |
I think so, yes. Currently the transaction sizes are bigger than they have to be. With this scheme, we can shrink the size of the removal records by up to 90 %. We probably won't do that prior to launch, though. |
Probably (?) superseded by #155. (Please unclose if not accurate.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.