Skip to content

fix: backport #21271 — handle bad note lengths on compute_note_hash_and_nullifier#21364

Merged
nchamo merged 2 commits intobackport-to-v4-stagingfrom
claudebox/backport-21271-v4-next
Mar 14, 2026
Merged

fix: backport #21271 — handle bad note lengths on compute_note_hash_and_nullifier#21364
nchamo merged 2 commits intobackport-to-v4-stagingfrom
claudebox/backport-21271-v4-next

Conversation

@AztecBot
Copy link
Collaborator

Summary

Backport of #21271 to v4.

Returns Option::none() instead of panicking when the packed note length doesn't match the expected value in _compute_note_hash_and_nullifier.

Cherry-pick details

  • Cherry-picked squash commit 20d6c29c81 from next
  • One conflict in noir-projects/aztec-nr/aztec/src/messages/discovery/mod.nr (doc comment divergence between v4-next and next) — resolved by keeping v4-next's shorter doc comment style with the updated code example.

Changes

  • aztec/src/macros/aztec.nr: Replace assert with if/else returning Option::none() + warning log on length mismatch
  • aztec/src/messages/discovery/mod.nr: Updated doc comment code example
  • New test contract note_hash_and_nullifier_contract with tests
  • Added test contract to Nargo.toml workspace

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

@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 11, 2026
@ludamad ludamad force-pushed the backport-to-v4-staging branch from 4ff264b to 2d467c9 Compare March 12, 2026 22:29
@AztecBot AztecBot force-pushed the claudebox/backport-21271-v4-next branch from 1ef7474 to 7bbcb9f Compare March 14, 2026 15:38
@nchamo nchamo marked this pull request as ready for review March 14, 2026 15:38
@nchamo nchamo requested a review from nventuro as a code owner March 14, 2026 15:38
@nchamo nchamo enabled auto-merge (squash) March 14, 2026 15:40
@AztecBot
Copy link
Collaborator Author

Flakey Tests

🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/c1cca19442b62ee7�c1cca19442b62ee78;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_l1_reorgs.parallel.test.ts "updates L1 to L2 messages changed due to an L1 reorg" (67s) (code: 0) group:e2e-p2p-epoch-flakes
\033FLAKED\033 (8;;http://ci.aztec-labs.com/af2a062f161c3a92�af2a062f161c3a928;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/duplicate_attestation_slash.test.ts (128s) (code: 0) group:e2e-p2p-epoch-flakes

@nchamo nchamo merged commit 48c65bb into backport-to-v4-staging Mar 14, 2026
13 checks passed
@nchamo nchamo deleted the claudebox/backport-21271-v4-next branch March 14, 2026 15:59
alexghr pushed a commit that referenced this pull request Mar 17, 2026
BEGIN_COMMIT_OVERRIDE
fix(aztec-nr): return Option from decode functions and fix event
commitment capacity (backport #21264) (#21360)
fix: backport #21271 — handle bad note lengths on
compute_note_hash_and_nullifier (#21364)
fix: not reusing tags of partially reverted txs (#20817)
chore: revert accidental backport of #20817 (#21583)
feat: Implement commit all and revert all for world state checkpoints
(#21532)
cherry-pick: fix: dependabot alerts (#21531)
fix: dependabot alerts (backport #21531 to v4) (#21592)
fix: backport #21443 — Don't update state if we failed to execute
sufficient transactions (v4) (#21610)
chore: Fix msgpack serialisation (#21612)
END_COMMIT_OVERRIDE

---------

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants