Skip to content

feat: zk go deployer#20219

Open
ashitakah wants to merge 13 commits intoethereum-optimism:developfrom
defi-wonderland:feat/zk-go-deployer
Open

feat: zk go deployer#20219
ashitakah wants to merge 13 commits intoethereum-optimism:developfrom
defi-wonderland:feat/zk-go-deployer

Conversation

@ashitakah
Copy link
Copy Markdown
Contributor

Changed

  • upgrade.go
    Added support for GameTypeZKDisputeGame (type 10), including the ZKDisputeGameConfig struct and ABI encoding required for the OPCM V2 upgrade flow.

  • add_game_type.go
    Hooked ZKDisputeGameType into the game type registry for devstack environments.

  • chain_intent.go
    Introduced ZKDisputeGameParams and an optional ZKDisputeGame field on AdditionalDisputeGame.
    Added validation in Check() to reject any ZK game entry with:

    • zero Verifier address
    • zero AbsolutePrestate
      This prevents silently broken game deployments.
  • devfeatures.go
    Added ZKDisputeGameDevFlag.
    The flag is automatically OR-ed into the DevFeatureBitmap in pipeline/implementations.go whenever any chain intent includes an AdditionalDisputeGame with VMType == VMTypeZK.
    This ensures ZkDisputeGameImpl is deployed without manual bitmap configuration.

  • pipeline/implementations.go
    Auto-enables ZKDisputeGameDevFlag when a ZK game is present in any chain’s AdditionalDisputeGames, then forwards it to DeployImplementations.

  • DeployImplementations.s.sol / VerifyOPCM.s.sol

    • Plumbed zkDisputeGameImpl through the deploy script Implementations struct.
    • Added it to validatorGetterChecks to ensure it is verified against the container during deployment.
  • Remaining files
    Added plumbing to read and persist zkDisputeGameImpl from ReadImplementationAddresses into state.


Why the initial deployment files weren't touched

  • DeployOPChain.s.sol intentionally registers the ZK game slot with enabled: false.
  • ZK is not intended to be activated for new chains at deployment time.
  • Instead, it is enabled on existing chains through the OPCM V2 upgrade path.

@ashitakah
Copy link
Copy Markdown
Contributor Author

/ci authorize 3ad0694

@0xOneTony 0xOneTony marked this pull request as ready for review April 21, 2026 16:44
@0xOneTony 0xOneTony requested review from a team and smartcontracts April 21, 2026 16:44
@0xOneTony 0xOneTony requested review from a team as code owners April 21, 2026 16:44
Copy link
Copy Markdown
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good generally. It looks like we have added support for ZK to op-devstack but don't have any tests that actually enable it. Would be good to add one so that we actually exercise the op-deployer code in a real situation rather than just unit tests.

Auto-enabling the dev feature also seems a bit dangerous so likely should just depend on the user doing that explicitly.

Comment on lines +47 to +56
// Auto-enable ZKDisputeGameFlag if any chain has a ZK dispute game in AdditionalDisputeGames.
outer:
for _, chain := range intent.Chains {
for _, game := range chain.AdditionalDisputeGames {
if game.VMType == state.VMTypeZK {
proofParams.DevFeatureBitmap = devfeatures.EnableDevFeature(proofParams.DevFeatureBitmap, devfeatures.ZKDisputeGameFlag)
break outer
}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we do this auto-enablement of dev features anywhere else? It seems dangerous and we should just have the caller explicitly enable the dev feature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right, and if it could be risky, I'll correct it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashitakah
Copy link
Copy Markdown
Contributor Author

Looks good generally. It looks like we have added support for ZK to op-devstack but don't have any tests that actually enable it. Would be good to add one so that we actually exercise the op-deployer code in a real situation rather than just unit tests.

Auto-enabling the dev feature also seems a bit dangerous so likely should just depend on the user doing that explicitly.

8736fc7

New tests are added

@ashitakah
Copy link
Copy Markdown
Contributor Author

/ci authorize d95d853

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.

2 participants