Skip to content

feat: Add support for Interop Migration using OPCM v2#18738

Merged
smartcontracts merged 12 commits intoethereum-optimism:developfrom
defi-wonderland:sc-feat/opcm2-interop-migrate
Jan 23, 2026
Merged

feat: Add support for Interop Migration using OPCM v2#18738
smartcontracts merged 12 commits intoethereum-optimism:developfrom
defi-wonderland:sc-feat/opcm2-interop-migrate

Conversation

@0xiamflux
Copy link
Copy Markdown
Contributor

Add Interop Migration Support for OPCM v2

Implements Interop Migration functionality to work with OP Contracts Manager v2.

Changes

  • Version Detection: Use semantic version comparison (version() >= 7.0.0) instead of feature flags
  • Input Structure: Restructure MigrateInputV1 with nested GameParameters and Proposal structs
  • Type Updates: Change DisputeGameConfig.GameArgs from Hash to bytes for correct ABI encoding
  • CLI Separation: Split migrate and migrate-v2 into separate commands

Testing

  • Add tests for interop migration v1 and v2
  • Add migration input encoding tests
  • Add invalid game type validation tests

* feat: support interop migration in OPCMv2

* fix: merge conflicts

* fix: proper interface usage

* feat: update VerifyOPCM for migrator

* chore: lint

* fix: pr tweaks

* fix: update go side

* fix: simplify game data decoding logic

* test: add test for invalid starting game type

* fix: pr review

* feat: add interop migration support for op-deployer

* feat: add opcm v2 input for interop migration

* feat: refactor interop migration to use ABI encoding and semver detection

Replace JSON marshaling with proper ABI encoding using w3 library for migrate inputs.
Change OPCM version detection from isDevFeatureEnabled to semantic version comparison.
Restructure MigrateInputV1 to use nested GameParameters and Proposal structs.
Update DisputeGameConfig.GameArgs from Hash to bytes for correct ABI encoding.
Add isVersionAtLeast helper for version comparison (OPCM v2 starts at 7.0.0).
Update tests and contracts to use version() method instead of feature flags.

* docs: add description comments to migrate.go

* feat: add opcmv2 migrate support to WithSuperRoots

* fix: game parameters uint64 types

* refactor: move IsVersionAtLeast helper to utils and add tests

* fix: uint64 to big int conversion in EncodedMigrateInputV1

* test: interop migration v2

* test: interop migration v2 (not working)

* test: updates migration test to migrate to OptimismPortalInterop

* fix: test comments

* test: add migrate input v1 encoding test

* test: add interop migration v1 test

* test: merge TestInteropMigration v1 and v2 tests

---------

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

* refactor: separate migrate from migrate-v2 cli command

---------

Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com>
Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
@0xiamflux 0xiamflux changed the title feat: opcm2 interop migrate (#796) feat: Add support for Interop Migration using OPCM v2 Jan 9, 2026
* feat: add migrate cli command tests

* poc: e2e cli migrate tests

* fix: replace stdout with app writer

* refactor: replace default value for StartingRespectedGameTypeFlag

* fix: migrate cli v1 and v2 e2e tests

---------

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
@0xiamflux 0xiamflux marked this pull request as ready for review January 13, 2026 15:47
@0xiamflux 0xiamflux requested review from a team as code owners January 13, 2026 15:47
@0xiamflux 0xiamflux requested review from ajsutton and geoknee January 13, 2026 15:47
@0xOneTony
Copy link
Copy Markdown
Contributor

/ci authorize 873b6e8

* fix: remove address 0 condition to use opcmv2 & refactor useOPCMV2 internal variable in InteropMigration script

* test: add interop migration run revert cases

* fix: restore migrate cli flag order

* fix: migrateInput V2 json field
@0xOneTony
Copy link
Copy Markdown
Contributor

/ci authorize 2f43806

* chore: remove unused imports

* chore: fix tests naming
@0xOneTony
Copy link
Copy Markdown
Contributor

/ci authorize 44dd749

0xiamflux and others added 2 commits January 15, 2026 19:33
Conflicts:
- packages/contracts-bedrock/scripts/deploy/InteropMigration.s.sol
@0xOneTony
Copy link
Copy Markdown
Contributor

/ci authorize b59accd

* test: fix struct property names

* fix: use correct exported function name

* chore: removes unused import
@0xOneTony
Copy link
Copy Markdown
Contributor

/ci authorize 374f5bc

* chore: remove unused flags

* chore: close rpc client in migrate

* chore: add sanity check when encoding migrate input

* refactor: reutilizes isVersionAtLeast to check if using OPCM v2

* refactor: unify migrate v1 and v2 flows in the same CLI

* refactor: check for common required flags, reduce repeated code between migrate v1 and v2 paths

* chore: rename Migrate exclusive vars to indicate they are supposed to be used during migration only

* chore: remove unused OPChainProxyAdminFlag flag

* chore: close underlying client in migrate path

* chore: add overflow uint check

* chore: rename variable deployer to deployerAddr

* chore: add overflow check for starting respected game type in migrate flow

* fix: encode gameArgs as abi encoded bytes32

* chore: rename starting Respected game type related vars on migrate flow

* chore: remove repeated required flags tests
@0xOneTony
Copy link
Copy Markdown
Contributor

/ci authorize 665215e

@smartcontracts smartcontracts added this pull request to the merge queue Jan 23, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 23, 2026
@smartcontracts smartcontracts added this pull request to the merge queue Jan 23, 2026
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2026
* feat: opcm2 interop migrate (#796)

* feat: support interop migration in OPCMv2

* fix: merge conflicts

* fix: proper interface usage

* feat: update VerifyOPCM for migrator

* chore: lint

* fix: pr tweaks

* fix: update go side

* fix: simplify game data decoding logic

* test: add test for invalid starting game type

* fix: pr review

* feat: add interop migration support for op-deployer

* feat: add opcm v2 input for interop migration

* feat: refactor interop migration to use ABI encoding and semver detection

Replace JSON marshaling with proper ABI encoding using w3 library for migrate inputs.
Change OPCM version detection from isDevFeatureEnabled to semantic version comparison.
Restructure MigrateInputV1 to use nested GameParameters and Proposal structs.
Update DisputeGameConfig.GameArgs from Hash to bytes for correct ABI encoding.
Add isVersionAtLeast helper for version comparison (OPCM v2 starts at 7.0.0).
Update tests and contracts to use version() method instead of feature flags.

* docs: add description comments to migrate.go

* feat: add opcmv2 migrate support to WithSuperRoots

* fix: game parameters uint64 types

* refactor: move IsVersionAtLeast helper to utils and add tests

* fix: uint64 to big int conversion in EncodedMigrateInputV1

* test: interop migration v2

* test: interop migration v2 (not working)

* test: updates migration test to migrate to OptimismPortalInterop

* fix: test comments

* test: add migrate input v1 encoding test

* test: add interop migration v1 test

* test: merge TestInteropMigration v1 and v2 tests

---------

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

* refactor: separate migrate from migrate-v2 cli command

---------

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

* test: opcm2 migrate cli test (#798)

* feat: add migrate cli command tests

* poc: e2e cli migrate tests

* fix: replace stdout with app writer

* refactor: replace default value for StartingRespectedGameTypeFlag

* fix: migrate cli v1 and v2 e2e tests

---------

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

* fix: interop migration fixes

* fix: remove address 0 condition to use opcmv2 & refactor useOPCMV2 internal variable in InteropMigration script

* test: add interop migration run revert cases

* fix: restore migrate cli flag order

* fix: migrateInput V2 json field

* chore: opcm2 pr (#799)

* chore: remove unused imports

* chore: fix tests naming

* fix: add uint32 input range validation in migrate v2

* fix: opcm2 misc (#802)

* test: fix struct property names

* fix: use correct exported function name

* chore: removes unused import

* fix: opcm2 review comments (#808)

* chore: remove unused flags

* chore: close rpc client in migrate

* chore: add sanity check when encoding migrate input

* refactor: reutilizes isVersionAtLeast to check if using OPCM v2

* refactor: unify migrate v1 and v2 flows in the same CLI

* refactor: check for common required flags, reduce repeated code between migrate v1 and v2 paths

* chore: rename Migrate exclusive vars to indicate they are supposed to be used during migration only

* chore: remove unused OPChainProxyAdminFlag flag

* chore: close underlying client in migrate path

* chore: add overflow uint check

* chore: rename variable deployer to deployerAddr

* chore: add overflow check for starting respected game type in migrate flow

* fix: encode gameArgs as abi encoded bytes32

* chore: rename starting Respected game type related vars on migrate flow

* chore: remove repeated required flags tests

---------

Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com>
Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
Co-authored-by: 0xOneTony <112496816+0xOneTony@users.noreply.github.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 23, 2026
@0xOneTony
Copy link
Copy Markdown
Contributor

/ci authorize 5d0c754

@0xOneTony
Copy link
Copy Markdown
Contributor

/ci authorize 71c252e

2 similar comments
@smartcontracts
Copy link
Copy Markdown
Contributor

/ci authorize 71c252e

@smartcontracts
Copy link
Copy Markdown
Contributor

/ci authorize 71c252e

@smartcontracts smartcontracts added this pull request to the merge queue Jan 23, 2026
Merged via the queue into ethereum-optimism:develop with commit 15e3bc3 Jan 23, 2026
259 of 262 checks passed
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.

5 participants