Skip to content

feat: ZKDisputeGame Multi-chain Super Game Migration Paths#21518

Open
ashitakah wants to merge 56 commits into
ethereum-optimism:developfrom
defi-wonderland:feat/migration-path-szkdg
Open

feat: ZKDisputeGame Multi-chain Super Game Migration Paths#21518
ashitakah wants to merge 56 commits into
ethereum-optimism:developfrom
defi-wonderland:feat/migration-path-szkdg

Conversation

@ashitakah

@ashitakah ashitakah commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the interop migration path (Path C): OPContractsManagerV2.setInteropDisputeGames(...), which re-points the shared dispute games of an already-interop set to a new respected super game in a single transaction covering all chains. Current use case is the post-migration transition from shared fault proofs to a shared super ZKDisputeGame. Reuses the migrator machinery; the standard upgrade() path can't be used since it re-inits per chain and would clobber the shared AnchorStateRegistry / ETHLockbox. Paths A and B (isolated chains) need no contract changes and go through upgrade(), since ZK is already in isSuperGame.

Changes

Contracts — src/L1/opcm/OPContractsManagerMigrator.sol

Area Change
setInteropDisputeGames New function. Validates the chain set, re-initializes the shared AnchorStateRegistry with the new respected game type + anchor root, then sets the dispute game impls on the shared DisputeGameFactory via the existing _getGameImpl / _makeGameArgs. Enabled configs register, disabled configs clear. No new infra deployed, per-chain portals untouched.
Guards Gates on OPTIMISM_PORTAL_INTEROP + ZK_DISPUTE_GAME dev features (TODO to drop the ZK gate once finalized; the function is generic across super games). Requires startingRespectedGameType ∈ isSuperGame. Runtime check that all portals resolve to the same shared ASR.
Errors OPContractsManagerMigrator_ZKDisputeGameNotEnabled, OPContractsManagerMigrator_NotSharedInteropSet.

Contracts — src/L1/opcm/OPContractsManagerV2.sol

Area Change
setInteropDisputeGames Thin entry point, _onlyDelegateCall + delegatecall to the migrator (mirrors migrate()). Transitional, removed once interop is native in OPCM.
Version 7.1.227.1.23.

Interfaces

File Change
interfaces/L1/opcm/IOPContractsManagerMigrator.sol Added setInteropDisputeGames + the two errors.
interfaces/L1/opcm/IOPContractsManagerV2.sol Added setInteropDisputeGames.

Forge script — scripts/deploy/SetInteropDisputeGames.s.sol

Area Change
Script New Input / Output / run mirroring InteropMigration.s.sol. Etches DummyCaller to simulate the governance delegatecall. checkOutput asserts on chain: all portals share the DGF, respected game type updated, and each input config applied (enabled registered, disabled cleared).

Op-deployer (Go)

File Change
op-deployer/pkg/deployer/manage/set_interop_dispute_games.go SetInteropDisputeGames runner, encodeZKGameArgs (5-field ZK config), SetInteropDisputeGamesCLI. Validates all address flags with IsHexAddress. Default clears only SUPER_CANNON_KONA (9, the permissionless slot ZK replaces) and keeps SUPER_PERMISSIONED_CANNON (5) as the permissioned liveness backup.
op-deployer/pkg/deployer/manage/flags.go New flags (--system-config-proxy-addresses, --source-game-types, --zk-verifier-address, --zk-max-challenge-duration, --zk-max-prove-duration) + set-interop-dispute-games command.

Tests

File Change
test/L1/opcm/OPContractsManagerV2.t.sol test_setInteropDisputeGames_succeeds (migrate to interop with SPDG + kona, swap to ZK, asserts SPDG kept, ZK registered + respected, kona cleared), _notDelegateCalled_reverts, _notSharedInteropSet_reverts.
op-deployer/pkg/deployer/manage/set_interop_dispute_games_test.go TestEncodeZKGameArgs (encoder round-trip + validation), TestSetInteropDisputeGames (forked-Sepolia e2e: deploy with ZK impl, migrate to interop, swap, asserts the end shape on chain).

Snapshots

File Change
snapshots/semver-lock.json, snapshots/abi/* Regenerated for the OPCMv2 version bump and the new setInteropDisputeGames ABI.

Notes

Closes #20759

0xarktos and others added 30 commits May 21, 2026 13:38
Comment thread packages/contracts-bedrock/lib/superchain-registry Outdated
Comment thread packages/contracts-bedrock/src/L1/opcm/OPContractsManagerMigrator.sol Outdated
Comment thread packages/contracts-bedrock/src/L1/opcm/OPContractsManagerMigrator.sol Outdated
@ashitakah ashitakah marked this pull request as ready for review June 23, 2026 17:15
@ashitakah ashitakah requested review from a team and Inphi June 23, 2026 17:15
@ashitakah ashitakah requested review from a team as code owners June 23, 2026 17:15
@ashitakah

Copy link
Copy Markdown
Contributor Author

/ci authorize 5b8667f

@0xarktos 0xarktos changed the title feat: migration path C zkdg feat: ZKDisputeGame Multi-chain Super Game Migration Paths Jul 3, 2026
@Inphi

Inphi commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@ashitakah Could you explain more about the issue of using upgrade for this migration? How are the ASR and EthlockBox clobbered if we go with that route?

@0xarktos

0xarktos commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@ashitakah Could you explain more about the issue of using upgrade for this migration? How are the ASR and EthlockBox clobbered if we go with that route?

Hey @Inphi, as we outlined in the document we shared here the regular upgrade flow touches state and re-initializes contracts for every chain regardless if it runs on shared infra (DelayedWETH, ASR) or not. This means that the only changes that would persist would be the configs of the last chain in the upgrade call. This generally increases operational complexity and increases margin or error since we don't want to be touching those shared parts just for a game flip so a separate flow felt safer/more isolated.

Additionally, initially IIRC we thought that the reinitializer guard in the shared ASR would block multiple inits and cause the upgrade to revert but looking at the proxy upgrade again this doesnt look like this is the case since StorageSetter clears the init version with each upgrade.

Lmk what you think and if you're open to converting it to a regular upgrade e2e test flow instead of adding this separate path. I'll be taking over this task now.

@0xarktos

0xarktos commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/ci authorize 57cb220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SuperZKDG] Path C: SFDG → SZKDG

4 participants