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
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | rlpBlock | string | Yes | RLP-encoded block data. The block must be a valid, known block; the node re-executes it against the parent state. |
| 2 | options | object | No | Same tracer configuration object as debug_traceTransaction. |
Response
| Type | Description |
|---|---|
| array | Array of per-transaction trace results in block order, identical in shape to debug_traceBlockByHash output. |
Example request
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32601 | Method not found | debug namespace not enabled on the node. |
-32602 | Invalid params | RLP data is malformed, empty, or does not decode to a valid block structure. |
-32000 | block not found | Parent 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_getBlockByHashwith 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 foundeven though your RLP decodes fine. - Performance matches
debug_traceBlockByHashexactly — 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.