fix: restore unrestricted capsule scope access in TXE#22169
Draft
AztecBot wants to merge 2 commits intomerge-train/fairiesfrom
Draft
fix: restore unrestricted capsule scope access in TXE#22169AztecBot wants to merge 2 commits intomerge-train/fairiesfrom
AztecBot wants to merge 2 commits intomerge-train/fairiesfrom
Conversation
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.
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
PR #22136 (remove ALL_SCOPES) replaced
'ALL_SCOPES'withkeyStore.getAccounts()when constructingCapsuleServicein 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 TXECapsuleServiceconstruction sites to restore the pre-#22136 behavior where test environments allow all capsule scopes.Fix details
CapsuleService: Addedunrestrictedstatic factory and updatedassertAllowedScopeto accept'unrestricted'as the allowed scopes value.TXESession: All 3CapsuleServiceconstruction sites now useCapsuleService.unrestricted().TXEOracleTopLevelContext: BothCapsuleServiceconstruction sites now useCapsuleService.unrestricted().Test plan
capsules::test::for_each_called_with_all_elementsnow passesnoir_aztecpassCapsuleServiceunit tests in@aztec/pxestill pass (scope enforcement in production PXE unchanged)ClaudeBox log: https://claudebox.work/s/cd86b05e9da8b25a?run=1