Skip to content

fix: restore unrestricted capsule scope access in TXE#22169

Draft
AztecBot wants to merge 2 commits intomerge-train/fairiesfrom
claudebox/fix-merge-train-fairies-22131
Draft

fix: restore unrestricted capsule scope access in TXE#22169
AztecBot wants to merge 2 commits intomerge-train/fairiesfrom
claudebox/fix-merge-train-fairies-22131

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

Summary

PR #22136 (remove ALL_SCOPES) replaced 'ALL_SCOPES' with keyStore.getAccounts() when constructing CapsuleService in the TXE. This broke capsule unit tests in aztec-nr that use arbitrary scope addresses (e.g. 0xface) since no accounts are registered in those simple tests, resulting in an empty allowed scopes list.

This PR adds a CapsuleService.unrestricted() factory method that bypasses scope validation, and uses it in all TXE CapsuleService construction sites to restore the pre-#22136 behavior where test environments allow all capsule scopes.

Fix details

  • CapsuleService: Added unrestricted static factory and updated assertAllowedScope to accept 'unrestricted' as the allowed scopes value.
  • TXESession: All 3 CapsuleService construction sites now use CapsuleService.unrestricted().
  • TXEOracleTopLevelContext: Both CapsuleService construction sites now use CapsuleService.unrestricted().

Test plan

  • Verified the previously failing test capsules::test::for_each_called_with_all_elements now passes
  • Verified all capsule unit tests in noir_aztec pass
  • Verified CapsuleService unit tests in @aztec/pxe still pass (scope enforcement in production PXE unchanged)

ClaudeBox log: https://claudebox.work/s/cd86b05e9da8b25a?run=1

PR #22136 replaced ALL_SCOPES with keyStore.getAccounts() in the TXE's
CapsuleService construction. This broke capsule unit tests that use
arbitrary scope addresses (e.g. 0xface) since no accounts are registered
in those tests, resulting in an empty allowed scopes list.

Add CapsuleService.unrestricted() factory method and use it in TXE to
restore the pre-#22136 behavior where test environments allow all scopes.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant