Skip to content

feat: opcm zk roots#19685

Open
ashitakah wants to merge 65 commits intoethereum-optimism:developfrom
defi-wonderland:feat/opcm-zk-roots
Open

feat: opcm zk roots#19685
ashitakah wants to merge 65 commits intoethereum-optimism:developfrom
defi-wonderland:feat/opcm-zk-roots

Conversation

@ashitakah
Copy link
Copy Markdown
Contributor

@ashitakah ashitakah commented Mar 20, 2026

Summary

ZK_DISPUTE_GAME (game type 10) into OPCM V2's deploy and validation flows. This includes a new ZKDisputeGameConfig struct with ZK-specific parameters (absolutePrestate, verifier, maxChallengeDuration, maxProveDuration, challengerBond), plumbed through OPContractsManagerUtils.makeGameArgs and getGameImpl.

The ZK dispute game is gated behind DevFeatures.ZK_DISPUTE_GAME - it can't be enabled unless the dev feature is active and zkDisputeGameImpl is set. Deploy scripts are updated to include the ZK game config (disabled by default).


Changes

Contracts

File Description
OPContractsManagerV2.sol Adds ZK_DISPUTE_GAME to validGameTypes, validates the dev feature flag is active, and checks zkDisputeGameImpl is set
OPContractsManagerUtils.sol Handles ZK_DISPUTE_GAME in getGameImpl() and makeGameArgs(), encoding constructor args (absolutePrestate, verifier, maxChallengeDuration, maxProveDuration, challengerBond, anchorStateRegistry, delayedWETH, l2ChainId)
OPContractsManagerContainer.sol Adds zkDisputeGameImpl to Implementations
OPContractsManagerMigrator.sol Clears ZK_DISPUTE_GAME implementation in DGF during migration
Types.sol Defines ZK_DISPUTE_GAME = GameType.wrap(10)

Interfaces

File Description
IOPContractsManagerUtils.sol Adds ZKDisputeGameConfig struct and OPContractsManagerUtils_UnsupportedGameType error
IOPContractsManagerContainer.sol Adds zkDisputeGameImpl to Implementations

Scripts

File Description
Deploy.s.sol, DeployImplementations.s.sol, DeployOPChain.s.sol Include ZK dispute game config (disabled by default)

Tests

File Description
OPContractsManagerV2.t.sol ZK game deploy, feature flag validation, integration with existing game types
OPContractsManagerUtils.t.sol makeGameArgs and getGameImpl with ZK_DISPUTE_GAME
OPContractsManagerContainer.t.sol Updated for the new zkDisputeGameImpl field

@ashitakah ashitakah requested review from a team and stevennevins March 20, 2026 14:40
@ashitakah ashitakah marked this pull request as draft March 20, 2026 14:40
@wiz-inc-a178a98b5d
Copy link
Copy Markdown

wiz-inc-a178a98b5d bot commented Mar 25, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@ashitakah ashitakah force-pushed the feat/opcm-zk-roots branch from 4fda70b to 56c0a87 Compare March 25, 2026 21:29
Comment thread packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol
Comment thread packages/contracts-bedrock/interfaces/L1/opcm/IOPContractsManagerUtils.sol Outdated
Comment thread packages/contracts-bedrock/interfaces/L1/opcm/IOPContractsManagerUtils.sol Outdated
Comment thread op-up/smoke.go
Comment thread op-chain-ops/addresses/contracts.go Outdated
Comment thread op-chain-ops/interopgen/deployments.go Outdated
Comment thread op-deployer/pkg/deployer/pipeline/dispute_games.go Outdated
Comment thread op-deployer/pkg/deployer/pipeline/dispute_games.go Outdated
Comment thread packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol Outdated
Comment thread packages/contracts-bedrock/src/L1/opcm/OPContractsManagerV2.sol Outdated
Comment thread packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
Comment thread packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol Outdated
Comment thread packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol
@0xChin
Copy link
Copy Markdown
Contributor

0xChin commented Mar 30, 2026

@ashitakah
Copy link
Copy Markdown
Contributor Author

/ci authorize 0705b6b

@ashitakah
Copy link
Copy Markdown
Contributor Author

We decided not to touch Go and to handle it in a separate PR, but the CI needs these changes to sync with the deployment and ensure the tests run successfully. That’s why the files were modified

@ashitakah
Copy link
Copy Markdown
Contributor Author

/ci authorize d07250f

@0xChin
Copy link
Copy Markdown
Contributor

0xChin commented Apr 15, 2026

/ci authorize 0529844

@0xChin
Copy link
Copy Markdown
Contributor

0xChin commented Apr 15, 2026

/ci authorize a5d739d

@ashitakah
Copy link
Copy Markdown
Contributor Author

There's still more work to ensure that the ZK Dispute game can be validated. The validate and validateWithOverrides functions in the standard validator contract have not been updated to check the ZK dispute game. Also note that the standard validator getGameImplementation function needs to be tweaked for the ZK dispute game.

Lastly, there should be a unit test asserting the ZK Dispute game validation path and a negative test that ensures that the path was actually tested. As an example, observe how the super DG validation errors are asserted dependent on the super feature flag -

bool superRoot = isDevFeatureEnabled(DevFeatures.SUPER_ROOT_GAMES_MIGRATION);

@Inphi Thank you so much for the feedback and for taking the time. We have addressed the comment and pushed the corresponding fixes in the latest commits. The only problem we encountered was related to the contract size, which has now been fully resolved. Feel free to take a look at the latest commits and let us know if everything looks good on your end!

0xChin and others added 4 commits April 15, 2026 09:36
The merge from develop resolved the bundle conflict by keeping
the stale version from this branch. Regenerated via
`just generate-nut-bundle` to match the current compiled artifacts.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@0xChin
Copy link
Copy Markdown
Contributor

0xChin commented Apr 15, 2026

/ci authorize b169c5b

Comment thread packages/contracts-bedrock/src/L1/OPContractsManagerStandardValidator.sol Outdated
@ashitakah
Copy link
Copy Markdown
Contributor Author

/ci authorize 4724d5e

@0xChin
Copy link
Copy Markdown
Contributor

0xChin commented Apr 15, 2026

/ci authorize 6967086

@0xChin
Copy link
Copy Markdown
Contributor

0xChin commented Apr 15, 2026

/ci authorize ce118ff

@0xChin
Copy link
Copy Markdown
Contributor

0xChin commented Apr 15, 2026

@Inphi as Ashi said, for the refactor comment it became a bit messy and we decided to revert it. The other NIT for the refactor was addressed 👍

@Inphi Inphi enabled auto-merge April 15, 2026 20:30
@Inphi
Copy link
Copy Markdown
Contributor

Inphi commented Apr 15, 2026

Good to merge once @0xOneTony's comments are resolved.

@Inphi Inphi added this pull request to the merge queue Apr 15, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 15, 2026
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.

6 participants