Conversation
Reimplementation of #21471. I did the filtering in-memory as explained there due to lack of indices. Additionally I fixed a bug in which certain index tuples were ignored - e.g. if `afterLog` and `txHash` were both specified, `txHash` was ignored. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
… nullifier exists Previously, getLowNullifierMembershipWitness would log a warning and return the nullifier's own witness when it already existed in the tree. This is wrong for a non-inclusion proof and led to cryptic circuit assertion failures downstream. Now it throws a descriptive error early. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
We're confident enough in them after ensuring expiration_timestamp is set --------- Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
…shipWitness (#21472) As I was going through TODOs I found this ancient TODO of mine (from November 2023): ``` * Note: This function returns the membership witness of the nullifier itself and not the low nullifier when * the nullifier already exists in the tree. This is because the `getPreviousValueIndex` function returns the * index of the nullifier itself when it already exists in the tree. * TODO: This is a confusing behavior and we should eventually address that. ``` In this PR i handle it by instead throwing an error in this scenario. This doesn't modify the interface so it was not urgent to do but felt like it makes sense to do now anyway so I went with it. (Pinged this PR to alpha team) ## Summary - `getLowNullifierMembershipWitness` now throws a descriptive error when the queried nullifier already exists in the tree, instead of silently returning the nullifier's own witness (which is wrong for a non-inclusion proof) - Removes the long-standing TODO about confusing behavior (open since Nov 2023) - Adds `@throws` JSDoc to both the interface and implementation - Adds unit tests for the throw and undefined-return paths ## Context Previously, `getPreviousValueIndex` returns the nullifier's own index when `alreadyPresent: true`. The method just logged a warning and returned that witness anyway. The Noir circuit would catch this implicitly (the `low < target` assertion fails), but the error surfaced as a cryptic circuit assertion rather than a clear "nullifier already exists" message. ## Test plan - Unit tests added in `server.test.ts` covering both the throw-on-exists and return-undefined paths - All 34 existing tests in `server.test.ts` continue to pass - Build, format, and lint pass 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
BEGIN_COMMIT_OVERRIDE
feat: add public log filtering by tag (#21561)
feat: default to kernelless simulations (#21575)
fix(aztec-node): throw on existing nullifier in getLowNullifierMembershipWitness (#21472)
fix: update nullifier non-inclusion test expectations after early oracle throw (#21600)
refactor(pxe): type and audit legacy oracle mappings (#21569)
END_COMMIT_OVERRIDE