You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opgeth-decoupling: migrate L2 genesis readers and carriers to op-core/genesis.Genesis #23217
Part of #20257. #23194 adds op-core/genesis.Genesis, the OP genesis JSON encoding whose config is an op-core/params.ChainConfig, and #21281 moves the writer (op-chain-ops/genesis) onto it. The readers and carriers of the L2 genesis are not covered yet. They hold the L2 genesis as go-ethereum's core.Genesis; after the cutover (#20266) its Config is upstream's params.ChainConfig, so a decoded genesis.json silently loses the OP fork fields and anything re-serialising it for an execution layer hands out a genesis without the OP schedule.
Consumers to migrate to genesis.Genesis
op-deployer: inspect/genesis.go (GenesisAndRollup), pipeline/env.go (RenderGenesisAndRollup), state/state.go (L1DevGenesis; the L1 genesis can stay upstream), and the integration-test CLI readers.
op-devstack/sysgo: deployer.go keeps map[eth.ChainID]*core.Genesis for the L2s and hands them to the ELs; shared/challenger passes genesis to the proof programs.
op-e2e: e2eutils.Setup, system/e2esys, the dispute-game and challenger helpers, e2eutils/reth and the actions helpers (l2_engine_reth.go marshals the *core.Genesis from Setup for op-reth-test-engine).
op-wheel: commands.go decodes the EL's debug_chainConfig into a geth ChainConfig and builds a rollup config from its OP fork times (an upstream decode drops them silently), and engine/engine.go sets CanyonTime on a geth ChainConfig to pick the payload's withdrawals encoding. They need the op-core config: decode into opparams.ChainConfig, and pass eth.BlockAsPayloadEnv a local eth.HardforkConfig.
For each: decode genesis.json into genesis.Genesis, read OP forks from its Config (opparams.ChainConfig), and use GethGenesis() only where upstream go-ethereum types are needed (state root, ToBlock, an upstream EL).
op-core/superchain
Chain.GenesisData() returns the registry's genesis JSON as raw bytes (today only byte-compared by check-prestate), and LoadOpChainConfig builds an opparams.ChainConfig from the registry TOML. A typed Chain.Genesis() (*genesis.Genesis, error) would give consumers the registry genesis with its OP config, and a test that every embedded registry genesis decodes with the strict codec is a cheap conformance check for the encoding. Dependency note: op-core/genesis imports go-ethereum/core for GethGenesis(), and op-core/superchain sits under op-node, so check what that adds to op-node's dependency closure before wiring it in.
🤖 Opus 5.5 says: Scope note from the opgeth-ratchet audit (#21748). The L1 dev genesis can stay upstream, but not as-is: it sets the fork-only core.Genesis.StateHash field, in op-deployer's seal_l1_dev_genesis.go (plus its test) and sysgo's deployer.go. Upstream core.Genesis has no precomputed-root field, so the sealed L1 genesis needs another carrier for its state root. sysgo also reads the fork-only LagoonTime off the L2 genesis config (interop_helpers.go), which goes with the op-core genesis migration here.
Activity
sebastianst commentedon Oct 14, 2026
🤖 Opus 5.5 says: Scope note from the
opgeth-ratchetaudit (#21748). The L1 dev genesis can stay upstream, but not as-is: it sets the fork-onlycore.Genesis.StateHashfield, in op-deployer'sseal_l1_dev_genesis.go(plus its test) and sysgo'sdeployer.go. Upstreamcore.Genesishas no precomputed-root field, so the sealed L1 genesis needs another carrier for its state root. sysgo also reads the fork-onlyLagoonTimeoff the L2 genesis config (interop_helpers.go), which goes with the op-core genesis migration here.