Skip to content

feat: merge-train/fairies-v5#24206

Merged
AztecBot merged 3 commits into
v5-nextfrom
merge-train/fairies-v5
Jun 20, 2026
Merged

feat: merge-train/fairies-v5#24206
AztecBot merged 3 commits into
v5-nextfrom
merge-train/fairies-v5

Conversation

@AztecBot

@AztecBot AztecBot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

BEGIN_COMMIT_OVERRIDE
feat(aztec-nr)!: add msg_sender to the utility context (#24062)
fix(cli): transpile pre-existing artifacts on aztec compile (#24188)
END_COMMIT_OVERRIDE

## 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_secret` took an explicit `caller`
argument 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

- `UtilityContext` gains a `msg_sender`, exposed as `self.msg_sender()`
and `self.context.maybe_msg_sender()`, mirroring the private and public
contexts.
- It is set only for cross-contract calls (utility-to-utility or
private-to-utility), where it is the calling contract's address taken
from the call graph and so cannot be forged. A top-level call (invoked
directly by a wallet or dapp) has no caller: `maybe_msg_sender()` is
`none` and `msg_sender()` panics. The `from` supplied when simulating
still only controls note/key visibility; it is never exposed as a
sender.
- `HandshakeRegistry::get_app_siloed_secret` drops the forgeable
`caller` parameter and silos by `self.msg_sender()`, so a contract can
only retrieve secrets siloed to its own address.
- `TestEnvironment` gains `ExecuteUtilityOptions::with_from` to simulate
a cross-contract caller in tests without routing through an actual
nested call.

Fixes F-671

---------

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Auto-approved

@AztecBot

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

@AztecBot AztecBot added this pull request to the merge queue Jun 20, 2026
Merged via the queue into v5-next with commit 4df7243 Jun 20, 2026
14 checks passed
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