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

refactor: Move nullifier tree batch insertion logic into bberg #564

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Maddiaa0
Copy link
Member

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_harness it 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:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • The branch has been merged with/rebased against the head of its merge target.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • There are no circuit changes, OR a cryptographer has been assigned for review.
  • New functions, classes, etc. have been documented according to the doxygen comment format. Classes and structs must have @brief describing the intended functionality.
  • If existing code has been modified, such documentation has been added or updated.
  • No superfluous include directives have been added.
  • I have linked to any issue(s) it resolves.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@kevaundray kevaundray changed the title chore: move nullifier tree batch insertion logic into bberg chore: Move nullifier tree batch insertion logic into bberg Jun 28, 2023
@Maddiaa0 Maddiaa0 changed the title chore: Move nullifier tree batch insertion logic into bberg refacto: Move nullifier tree batch insertion logic into bberg Jul 8, 2023
@Maddiaa0 Maddiaa0 changed the title refacto: Move nullifier tree batch insertion logic into bberg refactor: Move nullifier tree batch insertion logic into bberg Jul 8, 2023
@Maddiaa0 Maddiaa0 marked this pull request as ready for review July 8, 2023 14:08
@Maddiaa0 Maddiaa0 requested a review from suyash67 July 8, 2023 14:09
* 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

"the node that will insert to the inserted value" could perhaps be reworded

@ludamad
Copy link
Collaborator

ludamad commented Jul 19, 2023

Are low nullifiers basically tree leaves?

}
// 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) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

could do for (nullifier_leaf& pending : pending_insertion_tree), no?

Copy link
Collaborator

@ludamad ludamad left a comment

Choose a reason for hiding this comment

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

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).

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.

None yet

2 participants