Skip to content

feat: initial add-game-type-v2 command#770

Merged
0xiamflux merged 19 commits intosc-feat/opcm2-add-gametypev2-commandfrom
feat/opcm2-addgametypev2-command
Dec 19, 2025
Merged

feat: initial add-game-type-v2 command#770
0xiamflux merged 19 commits intosc-feat/opcm2-add-gametypev2-commandfrom
feat/opcm2-addgametypev2-command

Conversation

@0xiamflux
Copy link
Copy Markdown

@0xiamflux 0xiamflux commented Dec 18, 2025

Note

Adds OPCM v2-aware upgrade flow and scripts, introduces manage add-game-type-opcm-v2 CLI, and updates tests/e2e to support both v1 and v2 with extra instructions.

  • CLI/Manage:
    • New command: manage add-game-type-opcm-v2 (aliases embedded upgrader) with --config, --override-artifacts-url, and --outfile flags.
    • Validation and error-path tests for the new CLI.
  • Upgrader (embedded):
    • UpgradeOPChainInput now supports both v1 chainConfigs and v2 upgradeInput (with DisputeGameConfig, ExtraInstruction).
    • Encoding helpers for v2 and v1; prefer v2 if present. Adds UpgradeSuperchainConfigInput.extraInstructions.
    • Testdata config added; comprehensive unit tests for encoding/validation.
  • Contracts scripts:
    • UpgradeOPChain.s.sol and UpgradeSuperchainConfig.s.sol now auto-detect OPCM v1/v2 via dev feature flag and delegate to version-specific DummyCallers (V1/V2). AddGameType.s.sol clarified as v1-only.
  • Integration/E2E:
    • End-to-end upgrade test refactored to run for default and OPCM v2 flags; adds v2 superchain/chain upgrade flows and code checks.
    • Increases test timeout; minor API rename (EncodedChainConfigsChainConfigs).

Written by Cursor Bugbot for commit e4da83a. This will update automatically on new commits. Configure here.

0xniha and others added 11 commits December 12, 2025 11:46
* feat: upgrade op chain wip

* feat: add deployv2 wip

* fix: deployerv2 wip

* refactor: remove additional V2 version of scripts

* refactor: adds OPCM v2 support for UpgradeOPChain.s.sol

* refactor: adds OPCM v2 support for UpgradeSuperchainConfig.s.sol

* fix: uses correct json key for upgradeInput

* fix: uses correct feature flag for OPCM v2 in devfeatures.go

* chore: add json tag to ExtraInstruction

---------

Co-authored-by: Flux <175354924+0xiamflux@users.noreply.github.com>
* feat: adds intermediary struct for op-deployer upgrade

* chore: moved upgrade scripts to v6_0_0

* chore: remove v2 go scripts

* refactor: make v2_0_0 upgrade path to support both OPCM v1 and v2

* feat: add support for both OPCM v1 and v2 on embedded upgrade

* refactor: make v6_0_0 fall back to v2_0_0

* refactor: add extra instructions for upgrade superchain input

* test: fix op-deployer tests

* chore: remove deploy OP chain test step

* test: use systemconfig proxy address

* fix: remove the unneeded proxyadmin in OPChainConfig in op-deployer

* refactor: revert v2_0_0 changes in favor of a new v6_0_0 that supports OPCMv2

* feat: add v6_0_0 upgrade

* fix: check for 0 len OPChainConfigs
Conflicts:
- pkg/deployer/integration_test/apply_test.go
- pkg/deployer/integration_test/cli/upgrade_test.go
chore: sync sc-feat/opcm2-upgrade-op-chain with develop
chore: sync sc-feat/opcm2-upgrade-op-chain with develop
…-comments

fix: opcm2 upgradeopchain comments
…radeOPChain (#768)

* test: add missing extra instructions for OPCM v2 input

* fix: add correct game type for cannon kona
@0xiamflux 0xiamflux self-assigned this Dec 18, 2025
@0xiamflux 0xiamflux added the hold Do not merge for now label Dec 18, 2025
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 16

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Copy Markdown
Member

@0xOneTony 0xOneTony left a comment

Choose a reason for hiding this comment

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

Do you think its worth adding a comment on the AddGameType solidity script that the script is not supported for OPCMv2 or something like that?

Comment on lines +101 to +102
// TODO(#????): Update this to use an actual deployed OPCM V2 contract
t.Skip("Skipping until we have a deployed OPCM V2 contract")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

how do we know if this test works though?

0xOneTony
0xOneTony previously approved these changes Dec 19, 2025
@0xOneTony 0xOneTony marked this pull request as draft December 19, 2025 17:26
@0xiamflux 0xiamflux changed the base branch from sc-feat/opcm2-upgrade-op-chain to sc-feat/opcm2-add-gametypev2-command December 19, 2025 18:02
@0xiamflux 0xiamflux dismissed 0xOneTony’s stale review December 19, 2025 18:02

The base branch was changed.

…ddgametypev2-command

Conflicts:
	op-deployer/pkg/deployer/devfeatures.go
	packages/contracts-bedrock/test/opcm/UpgradeOPChain.t.sol
	packages/contracts-bedrock/test/opcm/UpgradeSuperchainConfig.t.sol
@0xiamflux 0xiamflux marked this pull request as ready for review December 19, 2025 18:13
@0xiamflux 0xiamflux removed the hold Do not merge for now label Dec 19, 2025
@0xiamflux 0xiamflux merged commit c3a8fd6 into sc-feat/opcm2-add-gametypev2-command Dec 19, 2025
2 checks passed
@0xiamflux 0xiamflux deleted the feat/opcm2-addgametypev2-command branch December 19, 2025 18:14
"enabled": true,
"initBond": "0x0",
"gameType": 0,
"gameArgs": "0x"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Test data JSON uses incompatible hex format for big.Int

The test data file uses hex-formatted strings "0x0" for initBond and "0x" for gameArgs, but Go's standard JSON unmarshaling for *big.Int expects decimal strings (not hex), and []byte expects base64-encoded strings (not hex). If this config file is used with json.Unmarshal, parsing will fail. While this file isn't currently referenced in tests, it would cause runtime errors if used as example configuration.

Fix in Cursor Fix in Web

0xOneTony pushed a commit that referenced this pull request Jan 9, 2026
…timism#18660)

* feat: initial add-game-type-v2 command (#770)

* WIP: opcmv2 upgrade op chain (#752)

* feat: upgrade op chain wip

* feat: add deployv2 wip

* fix: deployerv2 wip

* refactor: remove additional V2 version of scripts

* refactor: adds OPCM v2 support for UpgradeOPChain.s.sol

* refactor: adds OPCM v2 support for UpgradeSuperchainConfig.s.sol

* fix: uses correct json key for upgradeInput

* fix: uses correct feature flag for OPCM v2 in devfeatures.go

* chore: add json tag to ExtraInstruction

---------

Co-authored-by: Flux <175354924+0xiamflux@users.noreply.github.com>

* feat: adds intermediary struct for op-deployer upgrade (#759)

* feat: adds intermediary struct for op-deployer upgrade

* chore: moved upgrade scripts to v6_0_0

* chore: remove v2 go scripts

* refactor: make v2_0_0 upgrade path to support both OPCM v1 and v2

* feat: add support for both OPCM v1 and v2 on embedded upgrade

* refactor: make v6_0_0 fall back to v2_0_0

* refactor: add extra instructions for upgrade superchain input

* test: fix op-deployer tests

* chore: remove deploy OP chain test step

* test: use systemconfig proxy address

* fix: remove the unneeded proxyadmin in OPChainConfig in op-deployer

* refactor: revert v2_0_0 changes in favor of a new v6_0_0 that supports OPCMv2

* feat: add v6_0_0 upgrade

* fix: check for 0 len OPChainConfigs

* chore: pre-pr ready

* Merge pull request #764 from defi-wonderland/fix/opcm2-upgradeopchain-comments

fix: opcm2 upgradeopchain comments

* refactor: remove enshrined v7_0_0 upgrade in op-deployer (#766)

* test: use correct game type and pass correct extra instruction to UpgradeOPChain (#768)

* test: add missing extra instructions for OPCM v2 input

* fix: add correct game type for cannon kona

* feat: initial add-game-type-v2 command

* test: add tests for ShouldAllowV1 flag

* refactor: remove shouldAllowV1 flag

* chore: remove unused private key flag from the add game type v2 command

* chore: remove skipping upgrade test

* chore: name changes and comments

* chore: update usage description add-game-type-v2

* test: update add-game-type-opcm-v2 tests

---------

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>

* chore: opcm2 addgametypev2 comments (#780)

* chore: move ABI types to lib file

* chore: move hardcoded values to constants file

* refactor: make abi_types use MustType

* test: deploys OPCM v2 for use during CLI testing (#784)

* test: deploys OPCM v2 for use during CLI testing

* chore: reference a github issue for TODO

* test: add assertions on the output of add game type command

* test: update cli tests (#792)

* chore: Address review comments (#793)

* refactor: remove re-declared flags from add-game-type v2

* chore: remove irrelevant TODO

* refactor: rename "add-game-type-opcm-v2" command to "add-game-type-v2"

* test: add cache dir check for add-game-type-v2

* test: removes cache dir files check on e2e test (#794)

---------

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
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.

3 participants