Skip to content

feat: validate inputs in OptimismPortal2.migrateToSharedDisputeGame#20928

Open
stevennevins wants to merge 3 commits into
developfrom
stevennevins/validate-migrate-shared-dispute-game
Open

feat: validate inputs in OptimismPortal2.migrateToSharedDisputeGame#20928
stevennevins wants to merge 3 commits into
developfrom
stevennevins/validate-migrate-shared-dispute-game

Conversation

@stevennevins
Copy link
Copy Markdown
Contributor

@stevennevins stevennevins commented May 20, 2026

Description

Add sanity checks to OptimismPortal2.migrateToSharedDisputeGame for zero-address and unauthorized lockbox.

This is a defense-in-depth addition. The conventional OPContractsManagerMigrator.migrate path already calls _newLockbox.authorizePortal(portal) before migrateToSharedDisputeGame and prevents these input errors

fixes #20881

Reject zero-address lockbox/registry and require the new lockbox
to have already authorized this portal. Defense-in-depth against
operator footguns when the ProxyAdmin owner calls the portal
entrypoint directly, bypassing the OPCM migrator.
@stevennevins stevennevins requested review from a team and smartcontracts May 20, 2026 19:41
@stevennevins stevennevins changed the title Validate inputs in OptimismPortal2.migrateToSharedDisputeGame feat: validate inputs in OptimismPortal2.migrateToSharedDisputeGame May 20, 2026
Replace vm.mockCall scaffolding with freshly-deployed ETHLockbox and
AnchorStateRegistry proxies that go through the real initialize path.
Mirrors the wiring OPContractsManagerMigrator performs before calling
migrateToSharedDisputeGame, so the portal's validation checks are
exercised end-to-end against actual contracts.
Comment thread packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol
Comment thread packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.0%. Comparing base (6e38f8a) to head (85148d8).
⚠️ Report is 5 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #20928     +/-   ##
==========================================
- Coverage     76.3%    76.0%   -0.4%     
==========================================
  Files          185      130     -55     
  Lines        10698     6667   -4031     
==========================================
- Hits          8166     5067   -3099     
+ Misses        2388     1600    -788     
+ Partials       144        0    -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 76.0% <100.0%> (-6.4%) ⬇️

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

Files with missing lines Coverage Δ
...kages/contracts-bedrock/src/L1/OptimismPortal2.sol 98.2% <100.0%> (+<0.1%) ⬆️

... and 68 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.

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.

fix: cantina u19 #29 portal migration accepts bad targets

1 participant