test: add noir tests for get_note_hash_membership_witness#23190
Merged
Conversation
Cover both the happy path (valid witness against the note-hash-tree root) and the missing-hash error path, matching the existing block-hash tests in the same file. Resolves F-652.
nchamo
approved these changes
May 12, 2026
|
|
||
| mod test { | ||
| use crate::history::test::{create_note, NOTE_CREATED_AT}; | ||
| use crate::note::note_interface::NoteHash; |
Contributor
Author
There was a problem hiding this comment.
It's a trait used below via hinted_note.note.compute_note_hash
BTW nargo would throw a compilation error on unused imports
AztecBot
pushed a commit
that referenced
this pull request
May 12, 2026
## Summary - Adds the two missing in-tree Noir tests for `get_note_hash_membership_witness` in [noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr](noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr), matching the existing block-hash witness tests and clearing the `TODO(F-652)` placeholder. - The happy-path test reuses the existing `crate::history::test::create_note()` fixture, recomputes the unique note hash (siloed + nonce'd, same transformation as `assert_note_existed_by`), and verifies the witness by reconstructing the root via `root_from_sibling_path` and comparing it against `anchor.state.partial.note_hash_tree.root`. - The error-path test queries a bogus hash and expects the TXE handler's `not found in the note hash tree at block` error. - Bumps `history::test` from private to `pub(crate)` so the `create_note` fixture is reachable from `oracle::get_membership_witness::test` without exposing it outside the crate. Resolves [F-652](https://linear.app/aztec-labs/issue/F-652). ## Test plan - [x] `nargo test --package noir_aztec oracle::get_membership_witness::test::` — all 6 tests pass (4 existing + 2 new) against a local TXE on port 14730. - [x] `nargo check --deny-warnings --package noir_aztec` clean.
Collaborator
|
✅ Successfully backported to backport-to-v4-next-staging #23198. |
AztecBot
added a commit
that referenced
this pull request
May 13, 2026
BEGIN_COMMIT_OVERRIDE chore: kv store test fully on vitest (#23096) chore: backport kv-store vitest migration (#23096) to v4-next (#23185) test: add noir tests for get_note_hash_membership_witness (#23190) fix(aztec-up): explicit exit in CLI acceptance test harness (#23200) refactor(pxe): batch nullifier sync across scopes (#23129) refactor(pxe): backport batch nullifier sync across scopes (#23129) to v4-next (#23208) fix(ci): revert ci-compat-e2e to AWS access keys (#23211) test: drop event_logs from compat matrix and loosen avm_simulator assertion regex (#23193) fix(aztec-up): install manifest-pinned Node version instead of LTS (#23201) fix(ci): move CLI acceptance test timeout from job to step (#23205) END_COMMIT_OVERRIDE
rangozd
pushed a commit
to rangozd/aztec-packages
that referenced
this pull request
May 16, 2026
BEGIN_COMMIT_OVERRIDE fix: dropped tagging indices no longer cause a pxe crash on sync (AztecProtocol#23044) feat: forward-port upstream oxide aztec-nr changes (AztecProtocol#23183) test: add noir tests for get_note_hash_membership_witness (AztecProtocol#23190) fix(aztec-up): explicit exit in CLI acceptance test harness (AztecProtocol#23200) refactor(pxe): batch nullifier sync across scopes (AztecProtocol#23129) ci: revert ci-compat-e2e to AWS access keys (AztecProtocol#23212) END_COMMIT_OVERRIDE
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.
Summary
get_note_hash_membership_witnessin noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr, matching the existing block-hash witness tests and clearing theTODO(F-652)placeholder.crate::history::test::create_note()fixture, recomputes the unique note hash (siloed + nonce'd, same transformation asassert_note_existed_by), and verifies the witness by reconstructing the root viaroot_from_sibling_pathand comparing it againstanchor.state.partial.note_hash_tree.root.not found in the note hash tree at blockerror.history::testfrom private topub(crate)so thecreate_notefixture is reachable fromoracle::get_membership_witness::testwithout exposing it outside the crate.Resolves F-652.
Test plan
nargo test --package noir_aztec oracle::get_membership_witness::test::— all 6 tests pass (4 existing + 2 new) against a local TXE on port 14730.nargo check --deny-warnings --package noir_aztecclean.