Skip to content

test: add noir tests for get_note_hash_membership_witness#23190

Merged
benesjan merged 1 commit into
merge-train/fairiesfrom
jan/f-652-implement-noir-tests-of
May 12, 2026
Merged

test: add noir tests for get_note_hash_membership_witness#23190
benesjan merged 1 commit into
merge-train/fairiesfrom
jan/f-652-implement-noir-tests-of

Conversation

@benesjan
Copy link
Copy Markdown
Contributor

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

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_aztec clean.

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.
@benesjan benesjan requested a review from nventuro as a code owner May 12, 2026 13:17
@benesjan benesjan requested review from nchamo and removed request for nventuro May 12, 2026 14:04
Copy link
Copy Markdown
Contributor

@nchamo nchamo left a comment

Choose a reason for hiding this comment

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

LGTM!


mod test {
use crate::history::test::{create_note, NOTE_CREATED_AT};
use crate::note::note_interface::NoteHash;
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.

Is this used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a trait used below via hinted_note.note.compute_note_hash

BTW nargo would throw a compilation error on unused imports

@benesjan benesjan merged commit 60abaf7 into merge-train/fairies May 12, 2026
29 checks passed
@benesjan benesjan deleted the jan/f-652-implement-noir-tests-of branch May 12, 2026 14:50
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.
@AztecBot
Copy link
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants