Skip to content

opgeth-decoupling: swap call-sites to op-core/* across op-node, op-service, op-batcher #20263

Closed
3 of 3 issues completed

Description

@sebastianst

Part of #20257. See plan §1, §2, §3, §4, §5 in the op-geth decoupling doc.

Goal

Once the op-core/* packages exist, swap all relevant call-sites in the Go services so they stop reaching into op-geth internals. No behaviour change — just imports and types.

Scope

DepositTx construction / decoding

Replace the types.NewTx(&types.DepositTx{...}).MarshalBinary() pattern throughout op-node with optypes.DepositTx{...}.MarshalBinary() — the *types.Transaction wrapper is eliminated, we go straight from struct to []byte. Files to edit:

  • op-node/rollup/derive/deposits.go, deposit_log.go, parse_upgrade_transactions.go
  • op-node/rollup/derive/*_upgrade_transactions.go (Ecotone, Fjord, Holocene, Isthmus, Jovian, Interop, Karst)
  • op-node/rollup/interop/indexing/attributes.go

UnmarshalDepositLogEvent returns *optypes.DepositTx.

Transaction methods → helpers

PostExecTx call sites

  • op-node/rollup/derive/span_batch_tx.go, span_batch_txs.go, span_batch.go, batches.go: types.PostExecTxType → optypes.PostExecTxType.
  • op-node/rollup/derive/span_batch_tx.go (convertToFullTx): the types.NewTx(&types.PostExecTx{...}) construction goes straight from optypes.PostExecTx{...} to bytes via MarshalBinary.
  • op-chain-ops/pkg/sdm/ and op-service/sources/flashblock_client.go handle post-exec payloads as raw bytes only — no change needed.

Receipt (*optypes.Receipt) in op-service/txinclude

  • op-service/txinclude/interfaces.go EL.TransactionReceipt return type → *optypes.Receipt.
  • op-service/txinclude/persistent.go, monitor.go, txbudget.go: update references.
  • Replace inline operator-fee math in txbudget.go and isthmus_cost_oracle.go with opfees.OperatorCost(gasUsed, scalar, constant).
  • Replace types.NewL1CostFuncFjord with opfees.NewL1CostFuncFjord.

OptimismConfig and ChainConfig

  • rollup.Config.ChainOpConfig *params.OptimismConfig → *opparams.OptimismConfig.
  • rollup.Config gets any missing hardfork timestamp fields (KarstTime, InteropTime if not already present).
  • op-service/eth/BlockAsPayload and BlockAsPayloadEnv: replace config *params.ChainConfig parameter with a local HardforkConfig interface (IsCanyon(uint64) bool, IsIsthmus(uint64) bool). Callers pass rollup.Config directly.

EIP-1559 helpers

  • op-node/rollup/derive/payload_util.go, rollup/interop/indexing/attributes.go, rollup/attributes/engine_consolidate.go: switch imports from github.com/ethereum/go-ethereum/consensus/misc/eip1559 to github.com/ethereum-optimism/optimism/op-core/eip1559.

Superchain loader

Dependencies

Blocked on: #20260 (op-core/params), #20261 (op-core/fees), #20262 (op-core/types), #20259 (op-core/superchain + op-core/eip1559).

🤖 Generated by Claude Code


Misc fork symbol swaps (added 2026-07)

One-off op-geth additions to general types/APIs, found by the upstream-build spike (doc §15). Derive current call sites by grepping the symbol — file lists go stale:

  • Transaction.SetBlobTxSidecar (op-service/signer): rebuild/attach the sidecar without the fork helper.
  • types.NewIsthmusSigner (testutils, derive test utils): verify it matches upstream NewPragueSigner for user txs; swap or add an op-core signer helper.
  • types.NewBlock(…, *BlockConfig) / types.DefaultBlockConfig (testutils): fork-changed signature; the upstream call drops the config arg.
  • types.LogForStorage (op-chain-ops/crossdomain): upstream deleted it; inline the legacy RLP struct locally.

Note (2026-07): the per-file lists above in this issue predate Karst/Lagoon and are stale — treat them as historical hints and re-derive current sites by grepping the symbols (types\.(DepositTx|PostExecTx), \.(IsDepositTx|IsSystemTx|SourceHash|Mint|RollupCostData)\(). See §§1–5 and §15 of the decoupling doc.

Activity

  1. sebastianst commented on Jun 15, 2026

    @sebastianst
    MemberAuthor

    🤖 Claude says: Note on the deposit/post-exec helper swaps in this issue's scope.

    The optypes helpers you'll swap to (IsDepositTx(tx), SourceHash(tx), Mint(tx), IsSystemTx(tx), IsPostExecTx(tx)) are transition scaffolding — they operate on a go-ethereum *types.Transaction, which only holds a 0x7E/0x7D tx while the build still resolves to op-geth. They exist so call sites can drop their dependency on op-geth's Transaction methods before the L2 transaction representation changes in #20264. They are removed at the final cutover (#20266), so treat them as a stepping stone, not the destination — don't build new long-lived APIs on top of them.

    Where a call site can move directly to the durable shape in one step (it already has, or can cheaply get, the raw tx bytes), prefer decoding to optypes.DepositTx via UnmarshalDepositTx and reading struct fields, over routing through the *types.Transaction helper.

    🤖 Generated by Claude Code

  2. self-assigned this
    on Jul 20, 2026
  3. sebastianst commented on Jul 20, 2026

    @sebastianst
    MemberAuthor

    🤖 Claude Fable 5 says: All three sub-issues are closed; what remains of this issue's own scope is tracked in #21901 (PostExecTx span-batch swap + the one-off fork symbols; the check-* NewIsthmusSigner uses re-homed to #21746). This issue closes when #21901 lands.

  4. sebastianst commented on Jul 21, 2026

    @sebastianst
    MemberAuthor

    🤖 Claude Fable 5 says: Done — all sub-issues closed and the remaining scope landed via #21791 (DepositTx + Transaction-method helpers) and #21904 (PostExecTx span-batch sites + the one-off fork symbols, closing #21901). The check-* NewIsthmusSigner uses live on in #21746's scope. op-node/op-service/op-batcher no longer reference op-geth-fork transaction/params symbols outside the op-core differential tests.

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