feat(public_executor): allow access to the commitment trees in public execution#794
Merged
Conversation
6 tasks
ludamad
reviewed
Jun 9, 2023
LHerskind
reviewed
Jun 12, 2023
| * @param leafValue - The value to search for. | ||
| * @returns The index of the given leaf of undefined if not found. | ||
| */ | ||
| findCommitmentIndex(leafValue: Buffer): Promise<bigint | undefined>; |
Contributor
There was a problem hiding this comment.
How should we handle duplicate leafs? The first one you know have not been spent? Just thinking with the idea proposed around also putting L1 to L2 in the commitments tree, would be a pity if you keep fetching the wrong index and cannot spend the note because there was two insertions with "deposit 10 eth to A".
Member
Author
There was a problem hiding this comment.
My current idea is that if you have a transparent commitment then the nullifier's will need to be created with a different process. (Including the index) In the end to end test I was hoping to make a library that does this, but you are correct it does feel like a footgun.
6 tasks
LHerskind
approved these changes
Jun 12, 2023
This was referenced Jul 25, 2023
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
CommitmentsDB interface has been added to both executors, I have chosen not to completely unify their implementations as private goes through an aztec node while the public just accesses the merkle tree db directly.
How the executors were:

How they are after this pr:

I have altered the contexts for noir, both now have access to the roots
Checklist: