feat: migration path C zkdg#21518
Draft
ashitakah wants to merge 44 commits into
Draft
Conversation
…y with convention, update interface
…CWIA args encoding
…chainid 0 enforcement
…at/super-zk-dispute-game
* feat: merge with dev
* feat: merge with dev
* fix: merge with dev
* fix: merge with dev
* feat: opcm super zkdg
* feat: opcm super zkdg
* fix: enforce l2ChainId=0 in StandardValidator ZK game args
ZK_DISPUTE_GAME is a super game; the chain ID is embedded in per-game
extraData via the super-root proof, not in the immutable factory args
(makeGameArgs sets chainId=0 for isSuperGame() types). The previous
check args.l2ChainId == _l2ChainID always failed; drop the unused
_l2ChainID parameter and assert args.l2ChainId == 0.
* refactor: rename ZK_DISPUTE_GAME → SUPER_ZK_DISPUTE_GAME
Aligns the game type naming with the existing super-game convention
(CANNON→SUPER_CANNON, ASTERISC_KONA→SUPER_ASTERISC_KONA) since game type
10 uses super-root semantics (l2ChainId=0 in factory args). Also fixes
the StandardValidator ZKDG-60 check that always failed for super games
(args.l2ChainId == _l2ChainID → args.l2ChainId == 0) and removes the
now-unused _l2ChainID parameter.
Solidity:
- GameTypes.ZK_DISPUTE_GAME → SUPER_ZK_DISPUTE_GAME
- IOPContractsManagerUtils.ZKDisputeGameConfig → SuperZKDisputeGameConfig
- DevFeatures.ZK_DISPUTE_GAME flag, zkDisputeGameImpl field, and
LibGameArgs.ZKGameArgs struct are intentionally kept (internal names).
Go (op-deployer):
- embedded.GameTypeZKDisputeGame → GameTypeSuperZKDisputeGame
- embedded.ZKDisputeGameConfig → SuperZKDisputeGameConfig
- state.VMTypeZK ("ZK") → VMTypeSuperZK ("SUPER_ZK")
- state.ZKDisputeGameParams → SuperZKDisputeGameParams
- state.ErrZKDisputeGameMissingParams → ErrSuperZKDisputeGameMissingParams
- JSON fields zkDisputeGame/zkDisputeGameConfig → superZkDisputeGame/
superZkDisputeGameConfig
Note: the SuperZKDisputeGame.sol contract rename itself lands in a
companion PR; this PR keeps zkDisputeGameImpl field and devfeatures.
ZKDisputeGameFlag untouched until that merges.
* feat: rename and validator
* fix: revert renaming
* fix: merge with develop
* fix: coments
* chore: bump superchain-registry to match develop
* feat: remove l2 chain
* fix: complete l2ChainId removal
* fix: complete l2ChainId removal
* fix: lint and build
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
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 superZKDisputeGame. Reuses the migrator machinery; the standardupgrade()path can't be used since it re-inits per chain and would clobber the sharedAnchorStateRegistry/ETHLockbox. Paths A and B (isolated chains) need no contract changes and go throughupgrade(), since ZK is already inisSuperGame.Changes
Contracts —
src/L1/opcm/OPContractsManagerMigrator.solsetInteropDisputeGamesAnchorStateRegistrywith the new respected game type + anchor root, then sets the dispute game impls on the sharedDisputeGameFactoryvia the existing_getGameImpl/_makeGameArgs. Enabled configs register, disabled configs clear. No new infra deployed, per-chain portals untouched.OPTIMISM_PORTAL_INTEROP+ZK_DISPUTE_GAMEdev features (TODO to drop the ZK gate once finalized; the function is generic across super games). RequiresstartingRespectedGameType ∈ isSuperGame. Runtime check that all portals resolve to the same shared ASR.OPContractsManagerMigrator_ZKDisputeGameNotEnabled,OPContractsManagerMigrator_NotSharedInteropSet.Contracts —
src/L1/opcm/OPContractsManagerV2.solsetInteropDisputeGames_onlyDelegateCall+ delegatecall to the migrator (mirrorsmigrate()). Transitional, removed once interop is native in OPCM.7.1.22→7.1.23.Interfaces
interfaces/L1/opcm/IOPContractsManagerMigrator.solsetInteropDisputeGames+ the two errors.interfaces/L1/opcm/IOPContractsManagerV2.solsetInteropDisputeGames.Forge script —
scripts/deploy/SetInteropDisputeGames.s.solInput/Output/runmirroringInteropMigration.s.sol. EtchesDummyCallerto simulate the governance delegatecall.checkOutputasserts on chain: all portals share the DGF, respected game type updated, and each input config applied (enabled registered, disabled cleared).Op-deployer (Go)
op-deployer/pkg/deployer/manage/set_interop_dispute_games.goSetInteropDisputeGamesrunner,encodeZKGameArgs(5-field ZK config),SetInteropDisputeGamesCLI. Validates all address flags withIsHexAddress. Default clears onlySUPER_CANNON_KONA(9, the permissionless slot ZK replaces) and keepsSUPER_PERMISSIONED_CANNON(5) as the permissioned liveness backup.op-deployer/pkg/deployer/manage/flags.go--system-config-proxy-addresses,--source-game-types,--zk-verifier-address,--zk-max-challenge-duration,--zk-max-prove-duration) +set-interop-dispute-gamescommand.Tests
test/L1/opcm/OPContractsManagerV2.t.soltest_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.goTestEncodeZKGameArgs(encoder round-trip + validation),TestSetInteropDisputeGames(forked-Sepolia e2e: deploy with ZK impl, migrate to interop, swap, asserts the end shape on chain).Snapshots
snapshots/semver-lock.json,snapshots/abi/*setInteropDisputeGamesABI.Notes
SUPER_PERMISSIONED_CANNON(permissioned backup) +ZK_DISPUTE_GAME(permissionless, respected), mirroring today's permissioned + permissionless super shape.SPDG/SFDG→ ZK) and full game-lifecycle / finalization tests are handled in the integration tests PR.SUPER_ROOT_GAMES_MIGRATION; MigrationValidator requires the cannon super types). Tracked with theZKDG-NOSHAPETODO.Closes #20757