Skip to content

opgeth-decoupling: create op-core/params (OptimismConfig, ChainConfig, LoadChainConfig) #20260

Closed

Description

@sebastianst

Part of #20257. See plan §5, §6 in the op-geth decoupling doc.

Goal

Create op-core/params containing OP-specific chain config types that wrap upstream params.ChainConfig. Consumers import as opparams.

Scope

OptimismConfig struct

Mirrors op-geth's params.OptimismConfig verbatim. JSON field names must be preserved for wire compatibility (rollup.Config.ChainOpConfig is serialised).

type OptimismConfig struct {
    EIP1559Elasticity        uint64  `json:"eip1559Elasticity"`
    EIP1559Denominator       uint64  `json:"eip1559Denominator"`
    EIP1559DenominatorCanyon *uint64 `json:"eip1559DenominatorCanyon,omitempty"`
}

Keep the Optimism prefix (exception to the naming rule) — the field is ChainConfig.Optimism *OptimismConfig and the type pairs with the field name.

ChainConfig struct

Embeds upstream params.ChainConfig, adds OP hardfork fields + methods:

  • Fields: Optimism *OptimismConfig, BedrockBlock *big.Int, RegolithTime, CanyonTime, EcotoneTime, FjordTime, GraniteTime, HoloceneTime, IsthmusTime, JovianTime, KarstTime, InteropTime (all *uint64).
  • Methods: IsOptimism(), IsCanyon(t uint64), IsEcotone(t), IsFjord(t), IsGranite(t), IsHolocene(t), IsIsthmus(t), IsJovian(t), IsKarst(t), IsBedrock(num *big.Int), plus IsOptimism* convenience variants where used.

Mirror op-geth's semantics for each method.

LoadChainConfig

Replaces op-geth's params.LoadOPStackChainConfig. Takes a *superchain.ChainConfig (from op-core/superchain) and returns *opparams.ChainConfig with all OP fields populated.

Wire / migration details

  • rollup.Config.ChainOpConfig changes type from *params.OptimismConfig to *opparams.OptimismConfig in a follow-up sub-issue — but only the type change; JSON output must be identical.
  • No removal of upstream params imports — consumers use both params and opparams via import aliases.

Dependencies

🤖 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