Skip to content

fix: restrict access to scoped capsules#22113

Merged
mverzilli merged 3 commits into
merge-train/fairiesfrom
martin/restrict-access-to-scoped-capsules
Mar 30, 2026
Merged

fix: restrict access to scoped capsules#22113
mverzilli merged 3 commits into
merge-train/fairiesfrom
martin/restrict-access-to-scoped-capsules

Conversation

@mverzilli

Copy link
Copy Markdown
Contributor

Introduces checks that capsule operations invoked through oracles are within the scopes in context of execution

Closes F-505

@nventuro nventuro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very nice!

Comment thread yarn-project/pxe/src/storage/capsule_store/capsule_service.ts
Comment thread yarn-project/pxe/src/storage/capsule_store/capsule_service.ts Outdated
@nventuro

Copy link
Copy Markdown
Contributor

It'd be good to begin keeping track of patch notes. This technically is a behavioral change in the oracle, it'd be nice to be able to quickly get to this as the source of a new error a user may run into.

@mverzilli mverzilli enabled auto-merge (squash) March 30, 2026 09:35
@mverzilli

Copy link
Copy Markdown
Contributor Author

It'd be good to begin keeping track of patch notes. This technically is a behavioral change in the oracle, it'd be nice to be able to quickly get to this as the source of a new error a user may run into.

Good call. I added a mention on the migration notes, but also created an error code and URI for it.

@mverzilli mverzilli merged commit 57d3bd0 into merge-train/fairies Mar 30, 2026
11 checks passed
@mverzilli mverzilli deleted the martin/restrict-access-to-scoped-capsules branch March 30, 2026 09:55
@AztecBot

Copy link
Copy Markdown
Collaborator

❌ Failed to cherry-pick to v4-next due to conflicts. (🤖) View backport run.

github-merge-queue Bot pushed a commit that referenced this pull request Mar 30, 2026
BEGIN_COMMIT_OVERRIDE
fix: restrict access to scoped capsules (#22113)
END_COMMIT_OVERRIDE
AztecBot added a commit that referenced this pull request Mar 30, 2026
CapsuleService does not exist on v4-next (introduced by #22113 which
hasn't landed yet), so all CapsuleService references are reverted to
use capsuleStore directly. Migration notes conflict resolved by
accepting the new ALL_SCOPES removal documentation.
mverzilli added a commit that referenced this pull request Mar 30, 2026
## Summary

Backport of #22113
to v4-next.

Introduces a `CapsuleService` wrapper that enforces scope-based access
control on capsule operations invoked through oracles, ensuring they are
within the scopes authorized for the current execution context.

## Cherry-pick conflicts

Conflicts were in docs files only:
- `docs/docs-developers/docs/resources/migration_notes.md` — positional
conflict in TBD section (incoming content for capsule scope enforcement
note + `## 4.2.0-aztecnr-rc.2` header)
- `docs/netlify.toml` — missing `/errors/9` and `/errors/10` redirect
entries

Both resolved by accepting the incoming content. All TypeScript changes
applied cleanly.

## Test plan

- [ ] CI passes on backport branch
- [ ] Capsule scope enforcement works as described in migration notes
mverzilli added a commit that referenced this pull request Mar 30, 2026
## Summary

Backport of #22136
to v4-next, stacked on
#22157 (backport of
#22113 scoped capsules).

Removes the `ALL_SCOPES` option and `AccessScopes` type, forcing all
callers to explicitly specify which addresses are in scope via
`AztecAddress[]`. This is a breaking change in the PXE/wallet interface.

## Stacking

This PR is stacked on `claudebox/backport-22113-scoped-capsules`
(#22157) which introduces CapsuleService. With that base in place, the
cherry-pick applies cleanly with no conflicts.
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