feat(aztec-nr)!: add msg_sender to the utility context - #24062
Merged
nventuro merged 7 commits intoJun 19, 2026
Merged
Conversation
nventuro
reviewed
Jun 12, 2026
nchamo
commented
Jun 12, 2026
| throw new Error(`Cannot run ${entryPointArtifact.functionType} function as private`); | ||
| } | ||
|
|
||
| if (request.origin !== contractAddress) { |
Contributor
Author
There was a problem hiding this comment.
We are now simply avoiding the extra param and doing:
const contractAddress = request.origin;
nchamo
commented
Jun 12, 2026
| } | ||
|
|
||
| /** The address of the contract whose function is being executed, from the call context. */ | ||
| protected get contractAddress(): AztecAddress { |
Contributor
Author
There was a problem hiding this comment.
Added this to avoid changing over 50 this.contractAddress to this.callContext.contractAddress
nchamo
commented
Jun 12, 2026
| export type PrivateExecutionOracleArgs = UtilityExecutionOracleArgs & { | ||
| argsHash: Fr; | ||
| txContext: TxContext; | ||
| callContext: CallContext; |
Contributor
Author
There was a problem hiding this comment.
Moved into UtilityOracle
nchamo
commented
Jun 12, 2026
| * The caller address: it becomes the utility's `msg_sender` and determines which notes and keys are visible | ||
| * during execution. Pass `NO_FROM` when there is no acting account. | ||
| */ | ||
| from: AztecAddress | NoFrom; |
Contributor
Author
There was a problem hiding this comment.
Made this change to keep it consistent with proveTx and simulateTx
nventuro
reviewed
Jun 18, 2026
…r-to-utility-context
nventuro
enabled auto-merge (squash)
June 19, 2026 20:51
PhilWindle
pushed a commit
that referenced
this pull request
Jun 22, 2026
## Conflict resolution (PR 2 of 2) Stacked on top of the raw merge #24221. This is the **reviewable diff** — it resolves the single conflict from merging `v5-next` into `merge-train/spartan-v5`. Once both are green, merge this into #24221, then #24221 into `merge-train/spartan-v5`, which catches the train up to its base and makes the long-lived `merge-train/spartan-v5` → `v5-next` PR conflict-free. ### Conflicts resolved (1) **`yarn-project/end-to-end/src/e2e_nested_utility_calls.test.ts`** — both sides added content at the same point in the `authorizeUtilityCall hook` describe block: - **train (`ours`)** added a doc comment above the existing `denies cross-contract utility call from private function when hook returns false` test (from the e2e annotation pass on the train). - **base `v5-next` (`theirs`)** added a new `nested utility call sees the calling contract as its msg_sender` test (from `feat(aztec-nr)!: add msg_sender to the utility context` #24062). **Resolution:** keep both — the new `msg_sender` test followed by the doc-commented `denies…private function` test. No code was dropped from either side. The `delegate_get_msg_sender` contract method the new test exercises is brought in by the merge (it lives in `noir-projects/noir-contracts/contracts/test/nested_utility_contract`, non-conflicting). No fixtures or generated files were involved. PR 1's CI is red by design (conflict markers committed there); this PR's CI is the one to watch. --- *Created by [claudebox](https://claudebox.work/v2/sessions/51d528a3438f2849) · group: `slackbot`*
vezenovm
pushed a commit
that referenced
this pull request
Jun 22, 2026
) ## Summary Addresses the review comments on #23866 (constrained message delivery). Branched off and based on that PR so these follow-up changes can be reviewed in isolation. - **aztec-nr helpers**: tightened the constrained-delivery docs, fixed the misleading `index > 0` nullifier comment, switched secret resolution to `map`/`unwrap_or_else`, and renamed "chain" -> "sequence" across code/tests to avoid colliding with the existing "chain" (blockchain) meaning. - **Noir tests/contracts**: pinned the `get_handshakes` selector in the registry selector-match test, renamed the test helper to `authorizing`, and dropped redundant TXE tests now covered by the e2e and unit suites (plus the `delivery_unconstrained_handshake` compile-failure pin). - **PXE**: removed the temporary `get_app_siloed_secret` caller-arg authorization check (avoids conflicting with #24062), moved the registry-read helpers below the class, and reworked the cross-contract authorization test into `it.each` with shared `beforeEach`/`afterEach`. - Removed a stray `pied!` file that had been accidentally committed. The docs changes from the review are deferred to #24040, which owns the tagging-secret-source framing.
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.
Why we are doing this
Utility functions had no notion of
msg_sender, so a utility that wanted to know its caller had to accept it as a parameter.HandshakeRegistry::get_app_siloed_secrettook an explicitcallerargument and siloed the returned secret by it, so a hostile contract could pass another address and read an app's siloed secret it shouldn't see.Our fix
UtilityContextgains amsg_sender, exposed asself.msg_sender()andself.context.maybe_msg_sender(), mirroring the private and public contexts.maybe_msg_sender()isnoneandmsg_sender()panics. Thefromsupplied when simulating still only controls note/key visibility; it is never exposed as a sender.HandshakeRegistry::get_app_siloed_secretdrops the forgeablecallerparameter and silos byself.msg_sender(), so a contract can only retrieve secrets siloed to its own address.TestEnvironmentgainsExecuteUtilityOptions::with_fromto simulate a cross-contract caller in tests without routing through an actual nested call.Fixes F-671