refactor: Move nullifier tree batch insertion logic into bberg#564
Open
refactor: Move nullifier tree batch insertion logic into bberg#564
Conversation
ludamad
reviewed
Jul 19, 2023
| * Special Considerations | ||
| * | ||
| * Short algorithm description: | ||
| * When batch inserting values into the tree, we first update their "low_nullifiers" (the node that will insert to the |
Collaborator
There was a problem hiding this comment.
"the node that will insert to the inserted value" could perhaps be reworded
Collaborator
|
Are low nullifiers basically tree leaves? |
ludamad
reviewed
Jul 19, 2023
| } | ||
| // If there is a lower value in the tree, we need to check the current low nullifiers for one that can be used | ||
| if (has_less_than) { | ||
| for (size_t j = 0; j < pending_insertion_tree.size(); ++j) { |
Collaborator
There was a problem hiding this comment.
could do for (nullifier_leaf& pending : pending_insertion_tree), no?
ludamad
approved these changes
Jul 19, 2023
Collaborator
There was a problem hiding this comment.
I gave it a read and a ponder. I think given it has tests, it's been used + has sat for a while I might say take this approve and just introduce a few method extract refactors to make the core algorithm read a bit more like pseudocode and use C++ foreach loops before merging (maybe).
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
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.
Description
linked to: AztecProtocol/aztec-packages#335
Right now batch insertion info that is used by the circuits is currently implemented within a file called
nullifier_tree_testing_harnessit was placed here during the hackathon to get circuits up and running quickly. This pr moves the logic (just the batch insertion algorithm) into core bb.Checklist:
@briefdescribing the intended functionality.includedirectives have been added.