feat: add optional additional scopes to wallet transaction API#20487
Open
nchamo wants to merge 4 commits intomerge-train/fairiesfrom
Open
feat: add optional additional scopes to wallet transaction API#20487nchamo wants to merge 4 commits intomerge-train/fairiesfrom
nchamo wants to merge 4 commits intomerge-train/fairiesfrom
Conversation
nchamo
commented
Feb 13, 2026
|
|
||
| #[external("private")] | ||
| fn test_recursively_create_notes(owner: AztecAddress, how_many_recursions: u64) { | ||
| fn test_recursively_create_notes(recipients: [AztecAddress; 10], how_many_recursions: u64) { |
Contributor
Author
There was a problem hiding this comment.
We had to make these changes when we introduced scopes, because there was no way to inject multiple scopes. Since now there is, we can revert the change we made
…move unnecessary scopes
…ivate token transfer
nchamo
commented
Feb 13, 2026
|
|
||
| isStaticCall = isStaticCall || this.callContext.isStaticCall; | ||
|
|
||
| // When scopes are set and the target contract is a registered account (has keys in the keyStore), |
mverzilli
reviewed
Feb 13, 2026
| // When `from` is the zero address (e.g. when deploying a new account contract), we use only the | ||
| // additionalScopes if any, or an empty list which acts as deny-all: no notes are visible and | ||
| // no keys are accessible. Otherwise, we combine `from` with any additionalScopes, deduplicating. | ||
| protected scopesFor(from: AztecAddress, additionalScopes: AztecAddress[] = []): AztecAddress[] { |
Contributor
There was a problem hiding this comment.
I find this name doesn't make match sense, maybe scopesFrom would make more sense.
And the comments are just a natural language description of the imperative steps the function does, which personally distracted me more than just reading the code. I would just remove the comment.
mverzilli
reviewed
Feb 13, 2026
Contributor
mverzilli
left a comment
There was a problem hiding this comment.
Looks good! I think it's missing migration notes, and some documentation in general
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.
Summary
Previously,
PrivateExecutionOracleautomatically expanded scopes when making nested private calls to registered account contracts. This behavior was pretty hidden and made it hard to reason about which addresses' private state was accessible during execution.This PR removes the auto-expansion and instead introduces an explicit
additionalScopesoption onsend(),simulate(), anddeploy(). Callers now declare upfront which additional addresses' private state they need access to beyond the sender's.