Ethereum

Ethereum

debug_traceBlock

debug_traceBlock is the raw-bytes variant of block tracing on Ethereum mainnet (chain ID 1, native coin ETH). Instead of naming a block by hash or number, you hand the node the block itself as RLP-encoded bytes; it decodes them, re-runs every transaction against the parent state, and returns an opcode-level trace for each one in block order. This is the method to reach for when you already hold the serialized block — say, captured off the devp2p wire — rather than asking the node to look one up. Requests go to https://ethereum.therpc.io/YOUR_API_KEY. Like its siblings, it replays the whole block through the EVM, so a debug-enabled archive node is needed for the parent state of older blocks.

Use cases

  • Trace a hand-built or modified block that has not been imported yet — useful in a simulation or fork-testing setup where you assemble candidate blocks and want to see how the EVM would execute them.
  • Reproduce a block's execution straight from RLP bytes you already have, such as a frame captured from a devp2p session or pulled out of a client's database, without round-tripping through a hash lookup.

Parameters

#NameTypeRequiredDescription
1rlpBlockstringYesRLP-encoded block data. The block must be a valid, known block; the node re-executes it against the parent state.
2optionsobjectNoSame tracer configuration object as debug_traceTransaction.

Response

TypeDescription
arrayArray of per-transaction trace results in block order, identical in shape to debug_traceBlockByHash output.

Example request

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceBlock",
"params": [
"0xf9...",
{}
],
"id": 1
}'

Try it live in the Ethereum playground.

Errors & troubleshooting

CodeMessageCause
-32601Method not founddebug namespace not enabled on the node.
-32602Invalid paramsRLP data is malformed, empty, or does not decode to a valid block structure.
-32000block not foundParent state for the provided block is not available (archive state missing).

Common pitfalls

  • Producing a valid RLP block is the hard part. Most workflows fetch the block via eth_getBlockByHash with full transactions, then re-encode header and body to RLP — get a single field wrong and the node throws -32602.
  • The parent state still has to exist on the node. For a historical block that means archive state; without it you get block not found even though your RLP decodes fine.
  • Performance matches debug_traceBlockByHash exactly — both replay every transaction in the block, so a busy mainnet block is just as heavy whichever entry point you use.

Supported networks

  • Mainnet — Chain ID: 1
  • Sepolia — Chain ID: 11155111

See also

Parameters

0x-prefixed RLP-encoded block

Same tracer configuration object as debug_traceTransaction.

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"debug_traceBlock","params":["",{}]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.