Skip to content

feat: shared dispute game migration for interop#19840

Merged
stevennevins merged 41 commits intodevelopfrom
feat/interop-shared-dispute-game
Apr 8, 2026
Merged

feat: shared dispute game migration for interop#19840
stevennevins merged 41 commits intodevelopfrom
feat/interop-shared-dispute-game

Conversation

@stevennevins
Copy link
Copy Markdown
Contributor

@stevennevins stevennevins commented Mar 31, 2026

Description

Move migrateToSuperRoots(), migrateLiquidity(), and 3 param initialize() from OptimismPortalInterop to OptimismPortal2.

And unify OPCM_V2 to target OptimismPortal2 for the Interop migration codepath

Tests

Tests the superchain system features are properly configured
Tests that migration succeeds with the system feature is enabled

Additional context

Part of #19699

Associated design doc: https://github.com/ethereum-optimism/design-docs/blob/main/protocol/proofs/shared-dispute-game-migration.md

Metadata

Closes #19708
Closes #19710
Closes #19011

@stevennevins stevennevins requested review from a team and JosepBove March 31, 2026 18:38
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.9%. Comparing base (a111e9e) to head (3a0c898).
⚠️ Report is 159 commits behind head on develop.

Files with missing lines Patch % Lines
...contracts-bedrock/src/L1/OptimismPortalInterop.sol 0.0% 2 Missing ⚠️
...kages/contracts-bedrock/src/L1/OptimismPortal2.sol 96.1% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #19840     +/-   ##
==========================================
+ Coverage     74.8%    77.9%   +3.0%     
==========================================
  Files          194      139     -55     
  Lines        10852     6843   -4009     
==========================================
- Hits          8120     5331   -2789     
+ Misses        2588     1512   -1076     
+ Partials       144        0    -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 77.9% <92.3%> (-2.0%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/contracts-bedrock/src/L1/ETHLockbox.sol 100.0% <100.0%> (ø)
...ock/src/L1/OPContractsManagerStandardValidator.sol 97.5% <100.0%> (-0.1%) ⬇️
...edrock/src/L1/opcm/OPContractsManagerContainer.sol 100.0% <ø> (ø)
...bedrock/src/L1/opcm/OPContractsManagerMigrator.sol 95.8% <100.0%> (ø)
...racts-bedrock/src/L1/opcm/OPContractsManagerV2.sol 97.2% <100.0%> (-0.6%) ⬇️
...es/contracts-bedrock/src/libraries/DevFeatures.sol 100.0% <ø> (ø)
...kages/contracts-bedrock/src/L1/OptimismPortal2.sol 98.1% <96.1%> (-0.4%) ⬇️
...contracts-bedrock/src/L1/OptimismPortalInterop.sol 3.4% <0.0%> (-95.2%) ⬇️

... and 55 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread packages/contracts-bedrock/interfaces/L1/IOptimismPortal2.sol Outdated
Comment thread packages/contracts-bedrock/src/L1/opcm/OPContractsManagerV2.sol
Comment thread packages/contracts-bedrock/src/L1/OptimismPortal2.sol
@pauldowman pauldowman linked an issue Apr 1, 2026 that may be closed by this pull request
Comment thread packages/contracts-bedrock/src/L1/OptimismPortal2.sol
Comment thread packages/contracts-bedrock/interfaces/L1/IOptimismPortal2.sol
Comment thread packages/contracts-bedrock/src/L1/OptimismPortal2.sol
@stevennevins stevennevins force-pushed the feat/interop-shared-dispute-game branch from 6f4c1bd to 10808b1 Compare April 3, 2026 14:27
@stevennevins stevennevins requested review from maurelian and wwared April 3, 2026 14:46
@stevennevins stevennevins force-pushed the feat/interop-shared-dispute-game branch 2 times, most recently from 0bb90ac to 025ffda Compare April 6, 2026 16:38
Comment thread packages/contracts-bedrock/src/L1/OptimismPortal2.sol Outdated
Copy link
Copy Markdown
Contributor

@wwared wwared 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 to me, I'm approving but better to wait for more approvals from others since this touches a lot of surface area

CI seems to be failing due to semver-lock.json changing for src/L1/OptimismPortal2.sol but the version not being updated

Comment thread packages/contracts-bedrock/test/L1/SystemConfig.t.sol Outdated
Comment thread packages/contracts-bedrock/src/L1/OptimismPortal2.sol
@stevennevins stevennevins force-pushed the feat/interop-shared-dispute-game branch from b041770 to a228e67 Compare April 8, 2026 14:10
@stevennevins stevennevins requested a review from a team as a code owner April 8, 2026 17:44
Copy link
Copy Markdown
Contributor

@maurelian maurelian left a comment

Choose a reason for hiding this comment

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

I reviewed this with @stevennevins on a call. It LGTM.

@stevennevins stevennevins added this pull request to the merge queue Apr 8, 2026
@stevennevins stevennevins removed this pull request from the merge queue due to a manual request Apr 8, 2026
@stevennevins stevennevins added this pull request to the merge queue Apr 8, 2026
Merged via the queue into develop with commit 05cd6db Apr 8, 2026
115 checks passed
@stevennevins stevennevins deleted the feat/interop-shared-dispute-game branch April 8, 2026 20:27
InoMurko pushed a commit to ConstellationCrypto/optimism that referenced this pull request Apr 12, 2026
)

* feat: integrate SysFeature for Interop

* feat: add interop migration functions and eth lockbox to portal2

* chore: rename function to migrateToSharedDisputeGame

* chore: bump snapshots

* fix: use Portal2 in OPCM migrator

* fix: semver bumps from interface change

* fix: only overwrite the lock box when passing non-zero value

* chore: update comments to refer to OptimismPortal2 instead of OptimismPortalInterop

* fix: mismatched names

* fix: enable INTEROP feature flag in v1 OPCM deploy path

* fix: remove casting to OptimismPortalInterop

* chore: remove OptimismPortalInterop dead code

* chore: update comment to remove OptimismPortalInterop

* chore: remove OptimismPortalInterop specific tests since we now test OptimismPortal2 via the feature flag

* fix: restore superRootsActive flag in super-roots withdrawal proof tests

* fix: test name camelCase

* chore: remove OptimismPortalInterop from Initializable tests and remove interface from OPCM_V2

* fix: normalize INTEROP feature in SystemConfig fuzz test

* chore: add references for OptimismPortalInterop removal issue

* chore: remove stale comment about superRootsActive

* fix(portal): bump OptimismPortal2 version and fix OPCM_V2 interop upgrade ordering

Bump OptimismPortal2.version() from 5.4.0 to 5.5.0 so OPCM_V2 can
upgrade from OptimismPortalInterop (5.4.1+interop) without triggering
the DowngradeNotAllowed check.

In OPContractsManagerV2._apply(), set the ETH_LOCKBOX feature on
SystemConfig before upgrading the portal. Unlike OptimismPortalInterop
which blindly sets the ethLockbox, OptimismPortal2.initialize() calls
_assertValidLockboxState() which requires the ETH_LOCKBOX feature flag
and ethLockbox address to be consistent.

Update superRootsActive tests to support both OPCM_V2 (gameType mock)
and legacy (slot 63 manipulation) paths via _enableSuperRootBehavior
helper.

* chore: update checks for superRootActie to be for the INTEROP feature flag

* fix: standard validator assertions to be for Portal2 instead of PortalInterop when OPCM_V2 and Interop feature flags enabled

* fix: change event params back to non-indexed versions

* chore: clean up branching logic for portal/opcm feature flags

* chore: refactor the checks in assertValidPortal

* chore: organize functions by visibility

* fix: implement the _assertValidInteropState helper and add to initalize

* fix: update assert for INTEROP flag instead of superroots active

* chore: add clarification to the comment about the prerequisites to the portal migration functions

* chore: add TODO issue tracking for follow up removal

* fix: add missing OptimismPortal_InvalidInteropState error to IOptimismPortal2

* fix: assertions for the forked upgrade scenario

* refactor: remove OPCM_V2 feature flag, make V2 canonical

* Fix: docs

* Fix: some more doc-related issues

* fix: check ETH_LOCKBOX in _isUsingInterop and bump semver

Update _isUsingInterop() to require both INTEROP and ETH_LOCKBOX
features, preventing migrate* functions from executing if lockbox
is misconfigured at runtime.

Bump OptimismPortal2 5.5.0 -> 5.6.0
Bump OptimismPortalInterop 5.4.1+interop -> 5.5.1+interop

* fix: use assertTrue/assertFalse instead of vm.assertTrue/vm.assertFalse

* chore: forge fmt and snapshots bump

* fix: update check for using superroots in the dsl

* ci: retrigger workflow

---------

Co-authored-by: Rodrigo Araujo <rod.dearaujo@gmail.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

4 participants