Skip to content

feat!: split compute note hash and nullifier to reduce hashing (backport #21639)#21717

Draft
AztecBot wants to merge 7 commits intobackport-to-v4-next-stagingfrom
claudebox/backport-21639-split-note-hash-nullifier
Draft

feat!: split compute note hash and nullifier to reduce hashing (backport #21639)#21717
AztecBot wants to merge 7 commits intobackport-to-v4-next-stagingfrom
claudebox/backport-21639-split-note-hash-nullifier

Conversation

@AztecBot
Copy link
Collaborator

Summary

Backport of #21639 to v4-next.

Splits compute_note_hash_and_nullifier into separate compute_note_hash and compute_note_nullifier functions to reduce hashing overhead. The old combined function is kept as a deprecated wrapper.

Conflict Resolution

Cherry-pick had conflicts in 8 files due to v4-next not having CustomMessageHandler/process_custom_message (which exists on next). All CustomMessageHandler parameters were correctly omitted. Visibility differences (pub(crate) on next vs pub on v4-next) were preserved for v4-next.

Changes

  • New file: aztec/src/macros/aztec/compute_note_hash_and_nullifier.nr — extracted macro generation logic
  • Split _compute_note_hash_and_nullifier into _compute_note_hash + _compute_note_nullifier
  • Updated all discovery/processing code to use the split functions
  • Updated test helpers to use split function signatures
  • Added migration notes

ClaudeBox log: https://claudebox.work/s/959a16e59ab3f9d3?run=2

benesjan and others added 5 commits March 17, 2026 12:26
## Summary

Merges v4 into v4-next, resolving the conflict in
`getBlockHashMembershipWitness` in `server.ts`.

The conflict was between v4-next's simple passthrough to
`getWorldState(referenceBlock)` and v4's off-by-one bugfix that uses
`getWorldState(BlockNumber(referenceBlockNumber - 1))`. The v4 fix is
correct: the Noir circuit checks the archive membership proof against
`anchor_block_header.last_archive.root`, which is the archive tree root
BEFORE the anchor block was added, so we need the world state at block
N-1.

Resolution: took the v4 bugfix, adapted to use v4-next's `getWorldState`
(protected) instead of v4's `#getWorldState` (private).

Replaces #21493
which had stale conflict markers.

ClaudeBox log: https://claudebox.work/s/d4b96d5b355d7fba?run=1

Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Co-authored-by: Phil Windle <philip.windle@gmail.com>
Co-authored-by: Santiago Palladino <santiago@aztecprotocol.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
## Summary

Merges latest `v4` (`bb3ea6f1`) into `v4-next` with a proper **merge
commit** to preserve the merge topology. This fixes the issue where PR
#21702 was squash-merged, causing git to lose track of which v4 commits
were already in v4-next.

## Commits

1. **Merge commit with conflict markers** — raw `git merge origin/v4`
showing the conflicts
2. **Fix server.ts** — resolve `getWorldState` vs `#getWorldState`
conflict (use protected version), remove duplicate `resolveBlockNumber`
method
3. **Fix deploy_network.sh** — resolve pre-existing conflict from old
merge (keep default multiplier of 2)

## Important

**This PR must be merged with a merge commit (not squashed)** to
preserve the v4→v4-next merge topology. Add the `ci-no-squash` label.
Without the merge commit, future auto-merges will re-encounter the same
conflicts.

ClaudeBox log: https://claudebox.work/s/3402fef75fe1ebde?run=4

---------

Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Co-authored-by: Phil Windle <philip.windle@gmail.com>
Co-authored-by: Santiago Palladino <santiago@aztecprotocol.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
Co-authored-by: spypsy <spypsy@users.noreply.github.com>
…ashing (#21639)

Cherry-pick of 59565ba with conflicts for backport to v4-next.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Mar 18, 2026
Only keep the new migration note for split compute_note_hash/nullifier.
Remove formatting changes from next that leaked during conflict resolution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants