Skip to content

Remove ProtocolVersions Solidity contract and OPCM remnants (PR 2 of #20309) #20451

Closed

Description

@sebastianst

Sibling of #20441 under parent #20309. Deletes the on-chain ProtocolVersions contract end-to-end and removes the corresponding storage slot from OPContractsManagerContainer.Implementations, plus all deploy-script and test wiring.

Functional payload (op-node halting on protocol mismatch) gone since #20258. Go-side wiring landed in #20441, with placeholder values for ABI fields the Solidity script still asserts non-zero on. PR 2 deletes the contract atomically with those Solidity asserts and then strips the Go placeholders.

Why this needs contracts-team review

Breaking ABI change to OPCM:

Scope

Solidity (delete)

  • src/L1/ProtocolVersions.sol
  • interfaces/L1/IProtocolVersions.sol
  • test/L1/ProtocolVersions.t.sol
  • snapshots/abi/ProtocolVersions.json
  • snapshots/storageLayout/ProtocolVersions.json

OPCM (edit + major version bumps)

  • src/L1/opcm/OPContractsManagerContainer.sol + interface — drop protocolVersionsImpl from Implementations. Major bump.
  • src/L1/opcm/OPContractsManagerV2.sol — drop the field from setImplementations callers and getImplementations consumers. Major bump.
  • src/L1/opcm/OPContractsManagerUtils.sol — drop the field. Major bump.
  • src/L1/OPContractsManagerStandardValidator.sol — drop validation checks. Minor bump.
  • src/L1/opcm/OPContractsManagerMigrator.sol — drop migration code if present. Minor bump.

Deploy scripts

  • scripts/deploy/DeploySuperchain.s.sol — drop protocolVersionsOwner/required/recommended from input; drop protocolVersionsProxy/Impl from output; drop the contract deploy + initialization; drop asserts at L199, L201, L205, L234, L236, L267, L274.
  • scripts/deploy/DeployImplementations.s.sol — drop protocolVersionsProxy input field + L723 assertion + the field flowed into the Container.
  • scripts/deploy/Deploy.s.sol — drop protocolVersionsOwner: cfg.finalSystemOwner() and any other PV deployment steps.
  • scripts/deploy/ChainAssertions.sol — drop PV assertions.
  • scripts/deploy/DeployOPChain.s.sol, ReadSuperchainDeployment.s.sol, VerifyOPCM.s.sol, DeployConfig.s.sol, libraries/Types.sol, getting-started/config.sh — drop refs.

Tests

  • test/opcm/{DeploySuperchain,DeployImplementations,DeployOPChain}.t.sol
  • test/L1/opcm/{OPContractsManagerContainer,OPContractsManagerUtils}.t.sol
  • test/setup/{Setup.sol,ForkL1Live.s.sol}
  • test/vendor/Initializable.t.sol

Snapshots

After Solidity compiles cleanly: mise x -- just snapshots regenerates ABI / storage-layout / semver-lock for OPCMv2, Container, Utils, StandardValidator, Migrator, MigrationValidator.

Go-side placeholder removal (cleanup of #20441's fixup commit)

Strip every "PR 2 of #20309" TODO/comment introduced by 38c451e98e:

  • op-deployer/pkg/deployer/opcm/{superchain,implementations}.go — drop the restored ProtocolVersions* fields and the common.Hash version field types.
  • op-chain-ops/addresses/contracts.go — drop ProtocolVersionsProxy and ProtocolVersionsImpl from SuperchainContracts.
  • op-chain-ops/interopgen/{deployments,deploy}.go — drop ProtocolVersionsImpl field, common.Hash{0x01} placeholders, ProtocolVersionsProxy passthrough.
  • op-deployer/pkg/deployer/pipeline/{superchain,implementations}.go — drop the deprecatedProtocolVersionsPlaceholder var and all placeholder field assignments.
  • op-deployer/pkg/deployer/bootstrap/{superchain,implementations}.go — drop placeholder field assignments.
  • op-deployer/pkg/deployer/opcm/{superchain_test,implementations_test}.go, op-deployer/pkg/deployer/pipeline/superchain_test.go — drop placeholder fields from struct literals.

Docs / misc

book/src/contributing/opcm.md, docs/public-docs/..., anywhere rg -i protocolversion still lights up.

Definition of Done

  • rg -i 'protocolversion' packages/contracts-bedrock/ → empty.
  • rg -i 'protocolversion' from repo root → only the four documented exclusions:
    • op-service/apis/p2p.go and op-node/p2p/rpc_server.go (libp2p peer protocol version, unrelated).
    • rust/kona/tests/node/common/rpc_test.go (consumes the libp2p field).
    • op-core/superchain/superchain_test.go (regression test added in PR 1 — proves BurntSushi/toml ignores the legacy protocol_versions_addr key).
  • mise x -- just pr passes (full pre-PR suite).
  • mise exec -- go build ./... and mise exec -- just lint-go clean.
  • All affected OPCM contracts have bumped @custom:semver (OPCMv2, Container, Utils → major; StandardValidator, Migrator → minor).
  • PR description summarises regenerated snapshots and version bumps.

Coordination

Needs sign-off from contracts-bedrock owners on:

  1. The OPCM Implementations struct shape change (storage layout, ABI).
  2. Major version bumps on OPCMv2 / Container / Utils.
  3. Whether OPCMv1 (if any artifacts remain) needs a deprecation path or can be dropped outright.

Dependencies

Stacks on #20441. Cannot merge until #20441 lands on develop.

Plan

Full plan with phased acceptance gates: plans/2026-04-29-refactor-protocol-versions-solidity-removal-plan.md in the op-claude repo (8 phases: leaves → OPCM struct → deploy scripts → tests → snapshots → version bumps → Go cleanup → docs sweep).

🤖 Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions