refactor(contracts): remove OPCMv1 from all Solidity code#19795
refactor(contracts): remove OPCMv1 from all Solidity code#19795smartcontracts wants to merge 24 commits intodevelopfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #19795 +/- ##
==========================================
- Coverage 75.9% 75.8% -0.1%
==========================================
Files 684 628 -56
Lines 73143 68612 -4531
==========================================
- Hits 55532 52067 -3465
+ Misses 17467 16545 -922
+ Partials 144 0 -144
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
c038e35 to
72d2dea
Compare
|
/retest memory-all-opn-op-geth |
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
5459530 to
c478f58
Compare
Delete OPContractsManager v1 contract, interface, tests, snapshots, and all v1/v2 branching logic. OPContractsManagerV2 is now the sole OPCM — all deploy scripts and test infrastructure use V2 exclusively. Key changes: - Delete OPContractsManager.sol (2203 lines, 7 inner contracts) - Gut IOPContractsManager.sol interface to empty - Remove DevFeatures.OPCM_V2 flag and Constants.OPCM_V2_MIN_VERSION - Remove AddGameType.s.sol (v1-only script) - Remove opcm-upgrade-checks (v1-only CI check) - Update all deploy scripts to unconditionally use V2 types - Update all test files to remove v1 branches and assertions - Delete 12 v1 snapshot files (ABI + storage layout) V2 contracts in src/L1/opcm/ are untouched (zero V1 dependencies). This is PR 1 of the OPCMv1 removal series. Go code and CI matrix changes follow in subsequent PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add back v1 OPCM fields as address/bytes32 placeholders in Solidity script structs to maintain ABI compatibility with Go op-deployer. - DeployImplementations.Output: 6 deprecated address fields (always zero) - ReadSuperchainDeployment.Input: opcmAddress field (ignored) - ReadSuperchainDeployment.Output: 5 ProtocolVersions fields (always zero) These fields are never populated — they exist solely so Go's ABI encoding matches the Solidity struct layout. They will be removed atomically with the Go struct fields in a follow-up PR. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update Go op-deployer to unconditionally use OPCMv2 instead of branching on the OPCM_V2 dev feature flag, matching the Solidity contract deletion. - opchain.go: unconditionally use OpcmV2Impl instead of defaulting to v1 OpcmImpl - init.go: update ReadSuperchainDeployment call for new struct layout - artifacts.go: point Opcm mapping to V2 artifact, remove 5 deleted v1 sub-contract artifact mappings - Tests updated to match new behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mpat Since v1 OPContractsManager is deleted, dio.Opcm is always zero. Populate OpcmImpl with dio.OpcmV2 so downstream consumers (op-devstack, e2e tests) get a valid OPCM address. The OpcmImpl field will be renamed/removed in the follow-up Go PR. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The v1 OPCM Go bindings are stale (v1 contract deleted), so superroot.go can no longer use OPContractsManagerMetaData to ABI-encode migrate calls. Remove the v1 path entirely and use an inline v2 migrator ABI for the migrate call. - Remove isOPCMV2 version check (always v2 now) - Remove v1 MigrateInput path with UsePermissionlessGame/GameParameters - Add OPContractsManagerMigratorABI() helper with inline v2 ABI JSON - Remove unused deployer import and versionFn var Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- apply_test: OpcmImpl now equals OpcmV2Impl (not zero) - implementations_test: check OpcmV2 instead of Opcm (deprecated zero field) - migrate_test: remove opcm-v1 test case from table-driven test - migrate_test (CLI): skip TestCLIMigrateV1 (v1 contract deleted) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dead code left behind when v1 migration path was removed. Caught by go-lint CI check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add vm.assume to exclude OPCM address from fuzz inputs in migrate test (triggers _onlyDelegateCall instead of expected ProxyAdminOwnerMismatch) - Change implsOutput.Opcm → implsOutput.OpcmV2 in bootstrap test assertions (Opcm field is always zero now that v1 is deleted) - Add OpcmV2Impl to manual state population in migrate tests so opchain.go can find the OPCM address - Remove v6.0.0-rc.2 upgrade test case (v1 OPCM on Sepolia, embedded artifacts no longer support v1 upgrades) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The AddGameType.s.sol script was deleted as part of OPCMv1 removal. Rewrite addGameTypeForRuntime to use the V2 upgrade path (UpgradeOPChain.s.sol with UpgradeInputV2/DisputeGameConfig) instead of the deleted V1 AddGameType script. Also skip TestAddGameType in manage package since it depends on the deleted script. The V2 equivalent is TestManageAddGameTypeV2_CLI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
OPCMv2.upgrade() requires exactly 3 dispute game configs in order (CANNON, PERMISSIONED_CANNON, CANNON_KONA). The previous commit only sent 1 config per game type, causing InvalidGameConfigs revert. Restructure addGameTypesForRuntime to build all 3 configs in a single upgrade call: requested game types are enabled, others are disabled. Also add the required PermittedProxyDeployment extra instruction. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- interopgen/deploy.go: use superDeployment.OpcmV2 instead of .Opcm (v1 field is always zero now). Fixes all interop/devstack tests. - apply_test.go: TestEndToEndBootstrapApply now uses OPCMV2DevFlag and impls.OpcmV2 (v1 path no longer exists). - apply_test.go: remove "default" (non-V2) test case from TestEndToEndBootstrapApplyWithUpgrade. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- interopgen/deploy.go: convert MigrateInputV1 to MigrateInputV2 since InteropMigration.s.sol no longer supports V1 format. V2 uses ChainSystemConfigs + DisputeGameConfigs instead of OpChainConfigs. - apply_test.go: revert DevFeatureBitmap back to empty (V2 is default now, no flag needed). Set SuperchainConfigProxy in intent so the pipeline doesn't try to resolve it from OPCM (V2 OPCM doesn't expose superchainConfig() directly). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When an OPCM address is provided via intent.OPCMAddress (pre-deployed), the init stage only populated OpcmImpl. The opchain stage reads OpcmV2Impl, which was left as zero, causing "OPCM implementation is not deployed" error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DevFeatures and GameType/GameTypes imports were dropped when removing v1 IOPContractsManager imports during rebase conflict resolution. Regenerate semver-lock.json. Includes linter auto-fixes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
After rebase, the V2 contract now requires 6 game types (including super root types) instead of 3. Add SUPER_CANNON, SUPER_PERMISSIONED_CANNON, SUPER_CANNON_KONA as disabled configs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
V2 OPCM sets initBonds[PERMISSIONED_CANNON] = 0.08 ether via DEFAULT_INIT_BOND. DisputeGameFactory.create() requires msg.value to match the init bond. The test's sendTx was dropping the Value field from the TxCandidate, sending msg.value=0 which reverts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The interop migration only configured game type 0 (CANNON) but the proposer uses game type 4 (SUPER_CANNON) as the respected game type. DisputeGameFactory.create(4, ...) reverted with NoImplementation because no implementation was registered for type 4. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The V1 migrate path registered SUPER_CANNON, SUPER_PERMISSIONED_CANNON, and SUPER_CANNON_KONA from OpChainConfigs. The V2 path only registered SUPER_CANNON, causing: - TestPreinteropSingleChainFaultProofs: challenger can't find SUPER_CANNON_KONA implementation for split depth query - TestProposals: factory has no SUPER_CANNON implementation (interopgen path) Register all 3 super game types in both superroot.go and interopgen deploy.go migrate paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add version guards to UpgradeOPChain.s.sol and InteropMigration.s.sol: require OPCM >= v7.0.0 with descriptive error instead of silent revert - Replace inline ABI JSON in superroot.go with forge artifact loading - Remove bindings.Proposal dependency, define Proposal struct locally - Remove stale op-e2e/bindings/opcontractsmanager.go (v1 dead code) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c478f58 to
d0a920f
Compare
The V1→V2 migration conversion only registered game types 0 (Cannon) and 4 (Super Cannon), missing type 9 (Super Cannon Kona). The proposer creates games of type 9, so TestProposals timed out waiting for a game that could never be created. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
#wiz_ignore False positive — the file path in |
| ) | ||
|
|
||
| func TestAddGameType(t *testing.T) { | ||
| t.Skip("OPCMv1 contract deleted — AddGameType.s.sol no longer exists. Use TestManageAddGameTypeV2_CLI instead.") |
There was a problem hiding this comment.
Can just remove this entirely now
There was a problem hiding this comment.
op-deployer/pkg/deployer/opcm/add_game_type.go:119 also references AddGameType.s.sol
There was a problem hiding this comment.
Will handle in follow-up PR
There was a problem hiding this comment.
Some stale references to deleted files
| # | File | Line | Type |
|---|---|---|---|
| 1 | .semgrep/rules/sol-rules.yaml | 247 | Stale exclude path |
| 2 | .semgrep/rules/sol-rules.yaml | 323 | Stale exclude path |
| 3 | docs/public-docs/notices/op-deployer-upgrade-deprecation.mdx | 32 | Broken GitHub link to deleted file |
| 4 | packages/contracts-bedrock/book/src/policies/versioning.md | 82 | Broken GitHub link to deleted file |
| 5 | packages/contracts-bedrock/book/src/policies/versioning.md | 84 | Broken GitHub link (with specific line anchor) |
Some more stale references
| # | File | Line | Type |
|---|---|---|---|
| 1 | op-deployer/pkg/deployer/manage/migrate.go | 50 | Stale comment — IOPContractsManagerInteropMigrator deleted |
| 2 | op-deployer/pkg/deployer/manage/migrate.go | 59 | Stale comment — IOPContractsManagerInteropMigrator deleted |
| 3 | op-deployer/pkg/deployer/manage/migrate.go | 71 | Stale comment — IOPContractsManagerInteropMigrator deleted |
| 4 | packages/contracts-bedrock/book/src/contributing/opcm.md | 18 | Stale doc — OPContractsManager (v1 entry point) deleted |
| 5 | packages/contracts-bedrock/book/src/contributing/opcm.md | 21 | Stale doc — OPContractsManagerGameTypeAdder deleted |
| 6 | packages/contracts-bedrock/book/src/contributing/opcm.md | 22 | Stale doc — OPContractsManagerDeployer deleted |
| 7 | packages/contracts-bedrock/book/src/contributing/opcm.md | 23 | Stale doc — OPContractsManagerUpgrader deleted |
| 8 | packages/contracts-bedrock/book/src/contributing/opcm.md | 24 | Stale doc — OPContractsManagerContractsContainer deleted |
| 9 | packages/contracts-bedrock/book/src/contributing/opcm.md | 80 | Stale doc — OPContractsManagerUpgrader deleted |
| 10 | packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol | 185 | Stale override — OPContractsManagerGameTypeAdder deleted |
| 11 | packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol | 186 | Stale override — OPContractsManagerDeployer deleted |
| 12 | packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol | 188 | Stale override — OPContractsManagerUpgrader deleted |
| 13 | packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol | 189 | Stale override — OPContractsManagerInteropMigrator deleted |
| 14 | packages/contracts-bedrock/scripts/deploy/VerifyOPCM.s.sol | 195 | Stale override — OPContractsManagerContractsContainer deleted |
| 15 | ops/ai-eng/contracts-test-maintenance/exclusion.toml | 15 | Stale exclusion — OPContractsManagerContractsContainer.t.sol deleted |
| 16 | ops/ai-eng/contracts-test-maintenance/docs/runbook.md | 296 | Stale example — OPContractsManagerContractsContainer.t.sol deleted |
The test suite was deleted as part of the OPCMv1 removal, but it should have been migrated to V2 types instead. This restores it with: - Remove IOPContractsManager (v1) imports, use deploy.cfg() for config - Remove DevFeatures.OPCM_V2 branching, keep V2 path unconditionally - Remove v1-only addGameType/newGameInputFactory helpers - Simplify DelayedWETH tests by removing v1/v2 assertion branches - Remove unused IBigStepper import Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
packages/contracts-bedrock/test/L1/OPContractsManagerStandardValidator.t.sol
Show resolved
Hide resolved
| // Since both OPCM V1 and V2 have contractsContainer var and they point to different contract file names, | ||
| // in the code logic, we rename any occurrences of it to "contractsContainerV1" or "contractsContainerV2" before | ||
| // using it to read the mapping. | ||
| fieldNameOverrides["contractsContainerV1"] = "OPContractsManagerContractsContainer"; |
There was a problem hiding this comment.
Will handle in follow-up
Strip comments that just explain "this is V2 now" or "OPCMv1 has been removed" — the code is self-evident after the removal. Kept comments that explain why deprecated zero-valued struct fields exist (Go ABI compatibility). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Remove OPContractsManager v1 from all Solidity code, making OPContractsManagerV2 the sole OPCM.
OPContractsManager.sol(2203 lines, 7 inner contracts) and gutIOPContractsManager.solinterfaceDevFeatures.OPCM_V2flag,Constants.OPCM_V2_MIN_VERSION,Config.devFeatureOpcmV2()AddGameType.s.sol,opcm-upgrade-checks/directory, 3 test files, 12 snapshot filesV2 contracts in
src/L1/opcm/are completely untouched — they have zero V1 dependencies.56 files changed, +212 / -13,404 lines (net deletion of ~13,200 lines)
This is PR 1 of the OPCMv1 removal series. Breaks out the Solidity-side changes from #19385. Go code (
op-deployer) and CI matrix changes follow in subsequent PRs.Test plan
mise exec -- just build-devpasses (zero compilation errors)mise exec -- just prpasses (17/17 checks: lint, semgrep, snapshots, semver-diff, interfaces, size-check, etc.)IOPContractsManagerorOPContractsManager(non-V2)DevFeatures.OPCM_V2orConstants.OPCM_V2_MIN_VERSIONisOPCMv2/isOPCMV2variablessrc/L1/opcm/verified untouchedmise exec -- just test-devpasses (not yet run — long-running)🤖 Generated with Claude Code