Skip to content

fix: redo nullifier tree insertion algorithm#240

Merged
Maddiaa0 merged 42 commits into
masterfrom
md/new-nt-insertion-algo
Apr 14, 2023
Merged

fix: redo nullifier tree insertion algorithm#240
Maddiaa0 merged 42 commits into
masterfrom
md/new-nt-insertion-algo

Conversation

@Maddiaa0

@Maddiaa0 Maddiaa0 commented Apr 11, 2023

Copy link
Copy Markdown
Member

Description

Fixes batch insertion algorithm that did not handle random test cases well enough. This pr covers most cases but further investigation is being done and more test cases written to harden the implementation

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • The branch has been merged or rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@Maddiaa0 Maddiaa0 marked this pull request as draft April 11, 2023 19:10
@Maddiaa0

Copy link
Copy Markdown
Member Author

depends on this pr AztecProtocol/aztec3-circuits#231

@Maddiaa0 Maddiaa0 marked this pull request as ready for review April 12, 2023 21:41
@Maddiaa0 Maddiaa0 marked this pull request as draft April 12, 2023 21:41
@ludamad

ludamad commented Apr 13, 2023

Copy link
Copy Markdown
Collaborator

Looks like you're getting some of the issues I was trying to tackle here #216

@Maddiaa0 Maddiaa0 changed the base branch from master to pw/fix-nullifier-tree April 14, 2023 10:44
@Maddiaa0 Maddiaa0 changed the base branch from pw/fix-nullifier-tree to master April 14, 2023 10:44
@Maddiaa0 Maddiaa0 marked this pull request as ready for review April 14, 2023 10:49
Comment thread yarn-project/sequencer-client/src/block_builder/circuit_block_builder.ts Outdated
Comment thread yarn-project/sequencer-client/src/block_builder/circuit_block_builder.ts Outdated
* @param leaves Values to insert into the tree
* @returns
*/
public async performBaseRollupBatchInsertionProofs(leaves: Buffer[]): Promise<LowNullifierWitnessData[] | undefined> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I feel like we should break this function out into a seperate file, inject the db instance and create some test cases for it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1, but I think it's part of a bigger refactor on the block builder. I can take it once this is merged.

Comment thread yarn-project/end-to-end/src/e2e_zk_token_contract.test.ts Outdated
@Maddiaa0 Maddiaa0 marked this pull request as draft April 14, 2023 14:00
@Maddiaa0 Maddiaa0 mentioned this pull request Apr 14, 2023
6 tasks

@spalladino spalladino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, though I didn't go in depth on the workings of the algorithm itself, so take this approval with a grain of salt.

@Maddiaa0 Maddiaa0 marked this pull request as ready for review April 14, 2023 19:07
spypsy and others added 6 commits April 14, 2023 19:45
* add config from env vars in projects + update e2e config

* remove comment

* Fix automatic import

* remove comments

* remove hardcoded addresses + reduce .isMined poll freq

* more chagnes to isMined freq

* fix zero EthAddress
@Maddiaa0 Maddiaa0 force-pushed the md/new-nt-insertion-algo branch from aa14bd5 to b95e098 Compare April 14, 2023 19:48
@Maddiaa0 Maddiaa0 dismissed PhilWindle’s stale review April 14, 2023 20:01

Changes will be addressed as part of a wider refactor

* val 0 5 10 15 2 3 20 19
* nextIdx 5 2 3 8 6 2 0 7
* nextVal 2 10 15 19 3 5 0 20
*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Beautiful megacomment

@dbanks12 dbanks12 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Maddiaa0 Maddiaa0 merged commit c6d6913 into master Apr 14, 2023
@Maddiaa0 Maddiaa0 deleted the md/new-nt-insertion-algo branch April 14, 2023 20:42
ludamad pushed a commit that referenced this pull request Apr 14, 2023
ludamad pushed a commit that referenced this pull request Apr 17, 2023
ludamad pushed a commit that referenced this pull request Apr 17, 2023
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.

9 participants