Docs

trace_block - Optimism RPC Method

Get traces for all transactions in a block on Optimism. Requires archive node for cross-chain DeFi, Superchain-interoperable dApps, and public goods funding recipients.

Returns traces for all transactions in a block on Optimism.

Archive Node Required

This method requires an archive node. It is not available on full nodes.

When to Use This Method

  • Trace all transactions in a block by block number - Get the full trace of every transaction in a block on Optimism
  • Block-level execution analysis - Inspect all internal calls, transfers, and contract interactions within a block for cross-chain DeFi, Superchain-interoperable dApps, and public goods funding recipients
  • MEV research - Analyze transaction ordering, sandwich patterns, and arbitrage across a full block
  • Historical block replay - Replay and trace blocks at any point in Optimism chain history

Best Practices

  • Similar to trace_replayBlockTransactions but without explicit replay configuration
  • Use block hash variant (debug_traceBlockByHash) for reorg-safe queries
  • Traces from dense blocks can be very large; process results in batches
  • Requires archive node access; not available on standard full nodes

Response Body

Response

Code Examples