feat(op-devstack): add withdrawal test support with OptimismPortalProxyAddr and setRespectedGameType#337
Merged
fakedev9999 merged 8 commits intoJan 29, 2026
Conversation
…erface Add OptimismPortalProxyAddr() method to the L2Deployment interface to allow tests to access the OptimismPortal2 proxy address for withdrawal lifecycle testing. Changes: - Add OptimismPortalProxyAddr() to L2Deployment interface in stack/l2_network.go - Add implementation in sysext/addrbook.go with constant and getter - Add implementation in sysgo/deployer.go with field and getter This enables op-succinct to write e2e tests that validate the full withdrawal lifecycle through OptimismPortal2.
3 tasks
Add setRespectedGameType call after deploying OPSuccinct fault dispute game contracts. This sets the portal's respectedGameType to 42 (OPSuccinct game type), which is required for the StandardBridge DSL to find games of the correct type during withdrawal proving. Without this fix, the StandardBridge DSL fails to find any games because it filters by respectedGameType (default 1) while OPSuccinct creates games of type 42.
The setRespectedGameType function requires the guardian role, which in the devstack is mapped to SuperchainConfigGuardianKey (a SuperchainOperatorRole), not L1ProxyAdminOwnerRole (a ChainOperatorRole). Additionally, in recent Optimism contract versions, setRespectedGameType is on AnchorStateRegistry (not OptimismPortal2). Updated to: - Call AnchorStateRegistry instead of OptimismPortal2 - Use raw transaction since there's no AnchorStateRegistry binding - Use the correct SuperchainConfigGuardianKey for authorization
…eType The OPSuccinct FDG deployment creates a MockSystemConfig with the deployer (L1ProxyAdminOwnerRole) as the guardian, not the standard SuperchainConfigGuardianKey. This caused setRespectedGameType to fail with AnchorStateRegistry_Unauthorized error. Fixed by using ChainOperatorKeys(L1ProxyAdminOwnerRole) instead of SuperchainOperatorKeys(SuperchainConfigGuardianKey).
The StandardBridge DSL reads respectedGameType from the standard devstack's OptimismPortal2, which delegates to the standard AnchorStateRegistry. Previously we only set respectedGameType on the OPSuccinct-deployed AnchorStateRegistry, causing the DSL to look for game type 1 when OPSuccinct creates games of type 42. This fix: 1. Adds setStandardPortalRespectedGameType() to read the standard portal's AnchorStateRegistry and set its respectedGameType 2. Calls this function after OPSuccinct FDG deployment to ensure both AnchorStateRegistries have respectedGameType=42 The standard AnchorStateRegistry uses SuperchainConfigGuardianKey as its guardian (vs L1ProxyAdminOwnerRole for the OPSuccinct one).
Register game type 42 in the STANDARD DisputeGameFactory instead of creating a separate OPSuccinct DGF. This ensures OptimismPortal2 uses the same DGF that games are created in, fixing the withdrawal test's "out-of-bounds access" error when proveWithdrawalTransaction tried to look up a game index in the wrong DGF. Changes: - Pass EXISTING_DISPUTE_GAME_FACTORY_PROXY env var to forge deployment - Remove overwrite of l2Net.deployment.disputeGameFactoryProxy
…hdrawal test The withdrawal test was failing with OptimismPortal_ImproperDisputeGame error because games were referencing a different AnchorStateRegistry than the one OptimismPortal2 uses for isGameProper() checks. Changes: - Read standard ASR address from OptimismPortal2 via anchorStateRegistry() call - Pass EXISTING_ANCHOR_STATE_REGISTRY to deployment script - Remove redundant setRespectedGameType call on OPSuccinct ASR (now using standard) This ensures the isGameProper() check passes: return address(factoryRegisteredGame) == address(_game) && asr == address(this);
Remove the dead setRespectedGameType function that was intended for setting respectedGameType on OPSuccinct's own AnchorStateRegistry. This function became obsolete when we switched to using the standard AnchorStateRegistry (via setStandardPortalRespectedGameType) to ensure isGameProper() checks pass. The function was never called after the architecture change to use the standard DGF and ASR instead of deploying separate OPSuccinct ones.
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
Add infrastructure required for op-succinct withdrawal e2e tests to work with the standard OptimismPortal2 and AnchorStateRegistry.
Changes
1. Expose OptimismPortalProxyAddr in L2Deployment interface
OptimismPortalProxyAddr()method toL2Deploymentinterface instack/l2_network.gosysext/addrbook.goandsysgo/deployer.go2. Add setStandardPortalRespectedGameType function
3. Support using existing DGF and ASR
EXISTING_DISPUTE_GAME_FACTORY_PROXYto register game type 42 in the standard DGF instead of creating a new oneEXISTING_ANCHOR_STATE_REGISTRYto use the standard ASR instead of deploying a new oneisGameProper()check to pass (games must reference the same ASR/DGF that the portal uses)Why These Changes Are Needed
The withdrawal test flow requires:
isGameProper()validationWithout these changes, the withdrawal test fails with:
Files Changed
stack/l2_network.goOptimismPortalProxyAddr()to interfacesysext/addrbook.gosysgo/deployer.gosysgo/deployer_succinct.gosetStandardPortalRespectedGameType, pass existing DGF/ASR to deploymentRelated