Skip to content

op-reth-test-engine: serve the debug_ methods kona-host needs #23344

Closed

Description

@sebastianst

Part of #21905. Stack on #21787's tip. This needs the OpEthApi module from #23198, and #21787 also edits that file.

Serve the debug_ methods kona-host super calls on its L2 node. These are what production op-reth serves to kona-host: eth_getProof, eth_getBlockBy* and eth_chainId are served already, and IPC is enough (no HTTP listener).

  • debug_getRawHeader, debug_getRawReceipts, debug_dbGet (code form): mount reth's DebugApi over the existing OpEthApi. It needs a reth_tasks::Runtime on the current tokio handle.
  • debug_executePayload: mount op-reth's OpDebugWitnessApi with an OpPayloadBuilder over a no-op pool, as the production node does.
  • optest_dumpAccounts(blockHash, addresses): full account and storage state for the pre-fork state generator. reth's debug_dumpBlock and debug_storageRangeAt are stubs. Implement it by merging genesis plain state with the canonical in-memory blocks' bundle states, honoring storage wipes.
  • Socket-path accessor for kona-host: ipc.Proc.Path → testengine.Client.SocketPath → L2Engine.RPCEndpoint. The socket path is already owned by Proc.
  • Tests:
    • Raw header and receipts round-trip.
    • Witness check: debug_executePayload for a built block's parent and attributes returns the parent state-root node and the code of touched contracts.
    • Dump of a predeploy after a storage change.

Risks:

  • A witness gap hangs instead of failing. reth's debug_dbGet serves code only. So a node outside the witness is unservable, and kona-host retries forever. Production op-reth would hit the same gap.
  • Witness cost grows with chain length. The witness is computed over the in-memory overlay, which is the production path for unpersisted blocks. Each call merges every in-memory block, so a from-genesis proof sweep is quadratic in chain length. That is fine at action-test sizes.
  • A parent on a reorged-out fork is invisible to the provider. Side chains live in the engine's tree state. The tests only prove the final canonical chain.

Size: S–M.

🤖 Co-created with Claude Opus 5.5

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