Skip to content

opgeth-decoupling: make op-core/types and op-core/params build against upstream go-ethereum before the cutover #23525

Closed as not planned

Description

@sebastianst

Part of #20257.

Downstream Go modules (superchain-registry ops, infra, monitorism, …) can't drop their op-geth replace before the final cutover (#20266): anything importing op-service/eth (and so op-service/{rpc,metrics,sources,txmgr,signer,client}), op-node/rollup or op-chain-ops/genesis reaches op-core/types and op-core/params, which use op-geth-only fields. docs/ai/opgeth-decoupling.md §20 records this as by design. This issue changes that: make those two packages compile against upstream go-ethereum now, and move the op-geth bridging into a transitional package that only the code still driving op-geth imports.

The fork uses are small:

Removing just those lines makes op-core/{types,params,genesis,fees,eip1559,predeploys}, op-service/{eth,rpc,metrics,sources,txmgr,signer,client}, op-node/rollup and op-chain-ops/genesis build against upstream go-ethereum (verified 2026-10-20 on develop@056afb5): against v1.17.2, except op-service/sources, which needs the v1.17.7 backport of Header.BlockAccessListHash; against v1.17.7+ after the API-drift fixes in #23526.

Design

  • opparams.ChainConfig.GethChainConfig() returns only the Ethereum fork schedule — what opgeth-decoupling: final cutover (flip go.mod to upstream go-ethereum) #20266 already plans for it. The JSON codec is unaffected: its direct OP fields dominate the embedded go-ethereum config (chain_config_json.go).
  • optypes.Receipt stops syncing the embedded receipt's shadow fields. DeriveFields derives deposit contract addresses from the outer DepositNonce itself (its post-cutover form).
  • New transitional package, e.g. op-core/opgeth, holding only op-geth-only bridging, deleted at the cutover:
    • ChainConfig(*opparams.ChainConfig) *gethparams.ChainConfig — GethChainConfig() plus the OP fields.
    • Genesis(*opgenesis.Genesis) *core.Genesis — the same for genesis.
    • FromGethReceipt(s) (moved), plus a reverse helper if a caller hands op-core receipts to op-geth.
  • Callers that drive op-geth or read fork fields switch to it; they are already ratchet-allowlisted: the in-process op-geth L2 EL (sysgo, l2_network, op-e2e/opgeth, e2eutils/setup.go, e2eutils/el/factory.go), op-service/txplan, check-karst.
  • The op-core/{types,params} ratchet entries move to the new package's entries (opgeth-decoupling: final cutover (flip go.mod to upstream go-ethereum) #20266 reason).
  • A deps test (as in op-core/superchain/deps_test.go) keeps the new package out of op-core/* and op-service/*'s downstream-facing packages.
  • Update §20 of docs/ai/opgeth-decoupling.md: downstream modules no longer wait for the cutover on the op-core/types edge.

Risk

The failure mode is silent: under op-geth, a go-ethereum config without the Optimism struct has IsOptimism() == false, so op-geth treats the chain as L1. The ratchet only checks compilation. Audit every GethChainConfig(), GethGenesis() and embedded-receipt (Receipt.Receipt) reader, and keep TestToBlockMatchesOpGeth with the op-geth side built from the new package's Genesis until the cutover.

Done when

  • op-core/types and op-core/params have no ratchet allowlist entries for non-test code.
  • op-service/eth, op-node/rollup and op-chain-ops/genesis type-check against upstream go-ethereum at op-geth's base version.

🤖 Co-created with Claude Opus 5.5

Activity

  1. self-assigned this
    on Oct 21, 2026
  2. sebastianst commented on Oct 22, 2026

    @sebastianst
    MemberAuthor

    🤖 Claude Opus 5.5 says: Not planned. Downstream repos (superchain-registry first) will drop the op-geth replace after the go.mod cutover (#20266), not before. At the cutover no in-process op-geth user remains, so the op-geth bridging in op-core/types and op-core/params is simply deleted there, with no transitional package (#23553, closed).

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