Skip to content

opgeth-decoupling: migrate tests (op-e2e L2 call sites, wait.go split, delete op-e2e/opgeth, audit op-devstack/sysgo) #20265

Closed
8 of 8 issues completed

Description

@sebastianst

Part of #20257. See plan §11 and §13 in the op-geth decoupling doc.

Goal

Make op-e2e, the op-devstack DSL and op-acceptance-tests read L2 chain data in a way that still works after the go.mod flip (#20266). These call sites compile against upstream go-ethereum. At runtime they fail to decode L2 blocks, or they silently lose the OP receipt fields. The opgeth-ratchet type-check (#23407) cannot catch these failures. Fork-only symbol uses are tracked in #23405.

This issue is the index; the sub-issues hold the detail.

Rules for L2 reads

#23417 (kona proof harness) is the worked example.

  1. Bodies, txs and receipts go through op-service/sources. Upstream ethclient cannot decode deposit (0x7E) or post-exec (0x7D) txs, and upstream types.Receipt drops the OP fields. So L2 reads use the class-partitioned accessors on sources.EthClient / apis.EthClient: InfoAndUserTxsBy*, InfoAndDepositsBy* and InfoAndFirstDepositBy*. Receipts come from FetchReceipts or TransactionReceipt, which return *optypes.Receipt. Headers via ethclient are fine. InfoAndTxsBy* is for L1 only.
  2. Filter receipts in lockstep. The partitioned lists drop the synthetic txs, so txs[i] no longer lines up with receipts[i]. Drop the 0x7E/0x7D receipts by type before you pair them.
  3. No accessor returns post-exec (0x7D) txs. This is deliberate (§11). Tests that count a block's txs, or that assume the only synthetic tx is the leading deposit, need care on Lagoon+ presets. The first test that must read the 0x7D tx is the trigger to add InfoAndPostExecTx.
  4. A helper owns its clients. Test helpers create one ethclient.Client and one sources.EthClient per engine or node, together with it, and close them in its Close. Call sites don't dial, attach or build their own.
  5. Swap op-geth-only tx helpers to op-core when you touch a site. For example: types.Transaction.UnmarshalBinary/DepositTxType on deposits → optypes.UnmarshalDepositTx/optypes.DepositTxType; tx.RollupCostData()/NewRollupCostData → fees.TxRollupCostData/fees.NewRollupCostData; NewL1CostFuncFjord → fees.L1CostFjord. The op-core predicates that take a *types.Transaction are transition scaffolding and are deleted at the cutover (§2). Prefer decoding from the deposits accessor over asking a generic tx whether it is a deposit. The inventory of these symbol uses is in opgeth-decoupling: swap fork-only symbols in test, test-support and DSL code to op-core #23405.

Missing partitioned accessors, such as *ByLabel variants or a paired user-tx/receipt fetch, are added to op-service/sources by the swap PR that first needs them, not up front.

Remaining work

Area Tracked in State
op-devstack DSL and op-acceptance-tests L2 InfoAndTxsBy* reads #23425 #23863 in review
Port the FastLZ/Fjord-cost fuzzers from op-e2e/opgeth #23424 #23864 (draft, merges after #23863)
Delete op-e2e/opgeth #20275 #23864
Fork-only symbol swaps in tests and the DSL #23405 #23863 and #23864 together
op-devstack's L2 ChainConfig() returns opparams.ChainConfig #23655 in progress

Rule 1 is enforced by a forbidigo lint rule: ethclient body, tx and receipt reads are rejected in the test trees unless annotated as an L1 or L2-user-tx read.

Tracked elsewhere

Done

Acceptance criteria

  • No test, helper or DSL code reads L2 block bodies or txs through ethclient or InfoAndTxsBy*.
  • L2 receipts whose OP fields are read come from sources as *optypes.Receipt.
  • Shared helpers own their sources client, so no call site builds its own.
  • op-e2e/opgeth is deleted, and its fuzzers run against op-core/fees.
  • The §13 grep recipe finds only L1 or header-equivalent uses.

🤖 Co-created with Claude Opus 5.5

Activity

  1. sebastianst commented on Jun 15, 2026

    @sebastianst
    MemberAuthor

    🤖 Claude says: Two things to fold into the test migration (from the #21356 discussion).

    1. Receipt index-correlation breaks under the class-partitioned accessors. Some L2-block iterators correlate txs[i] with receipts[i] by position across the full list — e.g. op-acceptance-tests/tests/jovian/da_footprint.go does for i, tx := range txs { if tx.IsDepositTx() { continue }; …receipts[i]… }. Once these migrate to InfoAndUserTxs (#20264), which drops the synthetic 0x7E/0x7D txs, the indices shift relative to a full receipts list and the correlation silently misaligns. These tests must filter receipts in lockstep (or use a paired (userTx, receipt) accessor). Audit every InfoAndTxsBy* L2 iterator for positional receipt access during the migration.

    2. Lagoon adds a trailing 0x7D post-exec tx to L2 blocks. PostExecTx (sequencer rebates) is a canonical block tx in Lagoon, so L2 block tx lists on Lagoon+ chains contain a 0x7D entry in addition to the leading 0x7E deposit. Tests that fetch full L2 blocks on Lagoon+ presets need the same routing treatment as deposits — covered by migrating to the partitioned accessors, but flag any test that assumes the only synthetic tx is the first-position deposit.

    🤖 Generated by Claude Code

  2. self-assigned this
    on Aug 6, 2026
  3. sebastianst commented on Oct 14, 2026

    @sebastianst
    MemberAuthor

    🤖 Fable says: Two more op-e2e action-helper L2 call sites that fail under upstream go-ethereum (ethclient.BlockByNumber on L2 blocks, same deposit-tx decoding failure as the user.go sites above), found while porting the kona proof harness in #23417:

    • op-e2e/actions/helpers/l2_batcher.go#L257 (ActL2BatchBuffer) and #L291 (ActAddBlockByNumber): the action-test batcher fetches every block it batches as a full ethclient block and hands it to the channel out after the BlockModifier hooks. Every action test that batches goes through here, so this is the largest single L2 ethclient consumer in the action helpers. Fix shape: fetch through op-service/sources (raw payload or InfoAndTxs*) and build what ChannelOut.AddBlock needs from that.

    The proofs harness itself (rust/kona/tests/proofs) is covered by #23417 / #21905.

  4. geoknee commented on Nov 3, 2026

    @geoknee
    Contributor

    Work in flight:
    #23862
    #23863
    #23864

  5. sebastianst commented on Nov 13, 2026

    @sebastianst
    MemberAuthor

    🤖 Fable says: All sub-issues are closed; #23864 landed the last three (#20275, #23424, #23405). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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