feat(aztec-nr): extend OnchainDelivery builder for secret origin#23865
Merged
vezenovm merged 49 commits intoJun 10, 2026
Conversation
This was referenced Jun 4, 2026
This PR's merge-train/fairies-v5 base already bumped the noir packages to 1.0.0-beta.22, but the branch still carries the beta.21 lockfile. CI's yarn install --immutable rejects the mismatched @aztec/noir-noir_js file: hash (294c27 -> 893a3e) and the npm:1.0.0-beta.21 references for the noir-* packages. Regenerated against the v5 noir commit c57152f (1.0.0-beta.22) via yarn install --mode=update-lockfile so the lockfile now resolves to hash=893a3e and version 1.0.0-beta.22 for the noir-* packages.
Add the secret-origin selection API to the on-chain delivery builder: SecretOrigin (address-pair ECDH or handshake registry), selected via .via_address_pair() / .via_handshake(registry), alongside .with_sender(). Introduce the typed OnchainDeliveryMode newtype (replacing the mode_u8 accessor) and migrate the HandshakeRegistry standard contract to take it. Constrained tagging is mocked behind TODO(#14565): the handshake origin and sender are validated, but the discovery tag reuses the unconstrained derivation. The real handshake-derived tag and chain nullifier land with the calculate_secret_and_index (F-669) and emit (F-670) helpers. NOTE: migrating the registry changes its bytecode, so the HandshakeRegistry standard-contract pins must be regenerated before merge: ./bootstrap.sh build noir-contracts && ./bootstrap.sh build yarn-project (regenerates standard_contract_data.ts and standard_addresses.nr x2).
…delivery API Make the OnchainDeliveryMode constructors private so consumers derive modes through the delivery builder (MessageDelivery::onchain_X().mode()) and branch via predicates instead of raw discriminants: - Drop pub(crate) from the ONCHAIN_* discriminant globals; only messages/delivery/mod.nr references them now. - Add OnchainDeliveryMode::is_constrained() and a pub(crate) to_u8() oracle-boundary accessor; add a module-private MessageDelivery::mode(). - get_next_tagging_index takes OnchainDeliveryMode and converts at the oracle boundary (the #[oracle] ABI keeps its u8 parameter). - Registry tests derive their mode globals via the delivery API; reword comments that named the now-private discriminants. Also regenerate the HandshakeRegistry standard-contract pins (standard_contract_data.ts + both standard_addresses.nr twins), the re-pin deferred by the previous commit's NOTE. Verified the mode refactor itself is bytecode-neutral: a clean-HEAD build derives the same classId/address as this commit.
Rebuild the handshake registry artifact against the new base and update pinned-standard-contracts.tar.gz alongside the derived pins (the prior re-pin updated the data files but not the pinned artifact tarball). The other three standard contracts keep their existing pinned artifacts.
b9f12b8 to
befb4ea
Compare
vezenovm
commented
Jun 8, 2026
| /// emitted in the current transaction. This is typically only used for note messages: since the note will not actually | ||
| /// be created, there is no point in delivering the message. | ||
| /// | ||
| /// `delivery_mode` must be a value that implements [`MessageDeliveryBuilder`], such as [`OffchainDelivery`] or |
Contributor
Author
There was a problem hiding this comment.
This felt clear enough with the function signature constraints: where D: MessageDeliveryBuilder.
nchamo
reviewed
Jun 8, 2026
nchamo
left a comment
Contributor
There was a problem hiding this comment.
I feel like we are almost there, this is going to be great!
nchamo
reviewed
Jun 9, 2026
nchamo
left a comment
Contributor
There was a problem hiding this comment.
Almost there, a small thing related to TagSecretDerivation
Collaborator
Flakey Tests🤖 says: This CI run detected 3 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
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.
Fixes F-697
Fixes F-649
Summary
MessageDeliverywith separate typed builders for unconstrained and constrained on-chain delivery.OnchainDeliveryModeas the typed on-chain mode used by tagging-index helpers and the HandshakeRegistry ABI instead of rawu8values.Constrained tagging is still not fully wired up: the delivery config is validated, but tag emission remains mocked through the existing wallet-derived unconstrained path behind TODO(#14565).
Stack: #23875, then this PR, then #23866, then #23867.