Repository navigation
Description
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:
op-core/params:GethChainConfigsetsBedrockBlock…LagoonTimeandOptimismon the go-ethereum config.op-core/types:FromGethReceipt,DeriveFieldsandUnmarshalBinaryread or sync the op-geth receipt'sDepositNonce/DepositReceiptVersionshadow fields.
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.Receiptstops syncing the embedded receipt's shadow fields.DeriveFieldsderives deposit contract addresses from the outerDepositNonceitself (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 ofop-core/*andop-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/typesedge.
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/typesandop-core/paramshave no ratchet allowlist entries for non-test code.op-service/eth,op-node/rollupandop-chain-ops/genesistype-check against upstream go-ethereum at op-geth's base version.
🤖 Co-created with Claude Opus 5.5
Activity
sebastianst commentedon Oct 22, 2026
🤖 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/typesandop-core/paramsis simply deleted there, with no transitional package (#23553, closed).