Appearance
debug_traceBlockByNumber
served · same as reth
Runs all transactions of a block again and returns a trace for each one.
When to use
Use it to trace a whole block in one request, for example to index the internal calls of each transaction.
Example
bash
curl -s -X POST -H 'Content-Type: application/json' \
--data '{"jsonrpc": "2.0", "id": 1, "method": "debug_traceBlockByNumber", "params": ["0x18facaa", {"tracer": "callTracer"}]}' \
http://127.0.0.1:8547json
{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_traceBlockByNumber",
"params": [
"0x18facaa",
{
"tracer": "callTracer"
}
]
}Response
Live mainnet, block 26193066, 2026-10-14. Checked against reth 2.7: equal.
json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"result": {
"from": "0x8d8d7ea4761e3c0a78652331a844a121a63ac2b3",
"gas": "0x5208",
"gasUsed": "0x5208",
"to": "0x351101b6341abb86b68bd5d18d26d8ddfe13fee1",
"input": "0x",
"value": "0x1db0508fb65ee",
"type": "CALL"
},
"txHash": "0x6aab65ac3b5c83ca28846ab031e5f75d853aa8f496c8f4b83760f35423a0b950"
},
"... 54 more items"
]
}Parameters
| Name | Type | Required | Meaning |
|---|---|---|---|
block | block number in hex, or a tag, see Block parameter | yes | The block to trace. |
options | object, see Tracer options | no | The tracer and its options. |
The main fields of options. The Tracer options page has all of them.
| Field | Type | Meaning |
|---|---|---|
tracer | string | callTracer, flatCallTracer, prestateTracer, 4byteTracer, noopTracer, muxTracer or erc7562Tracer. Default: the struct logger. |
tracerConfig | object | The options of the chosen tracer. The rows below list them. |
Returns
A list with one item per transaction, in block order. Each item has txHash and result, the trace of that transaction.
Notes and limits
- Tracing works for the head and the 127 blocks before it. The node runs the block on the state of its parent.
- Block 0 cannot be traced.
- An answer larger than 160 MiB gives an error.
Errors
| Code | Message | When |
|---|---|---|
| -32000 | block 0x... not found | The block is above the head. A tag that has no block gives its name, for example block finalized not found. |
| 4444 | pruned history unavailable: requested N, earliest available M | The block is below the first block of the node. |
| -32603 | failed to apply blockhash contract call: database error: Database error: insufficient changesets to revert to block #N. Available changeset range: A..=B | The state of the parent block is gone: it is more than 128 blocks below the head. Below the first block of the node, the error is 4444. |
| -32000 | genesis is not traceable | The block is block 0 (a node that keeps it; else the history rules apply). |
| -32008 | Response is too big | The answer is larger than 160 MiB. |
Compared with reth
The live example above gives the same answer on Cinder and on reth 2.7.
Speed against reth
callTracer1.3x faster
Cinder128 ms
reth164 ms
Related methods
debug_traceBlockByHash, debug_traceTransaction, trace_block.
Schema (OpenRPC)
Parameter block: BlockNumberOrTag
json
{
"title": "Block number or tag",
"oneOf": [
{
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
},
{
"title": "Block tag",
"type": "string",
"enum": [
"earliest",
"finalized",
"safe",
"latest",
"pending"
],
"description": "latest is the head of the last forkchoice update, as reth. pending is the block that Cinder builds from its transaction pool after latest, as reth. safe and finalized are the blocks of the last forkchoice update, as reth. Before the first update, they name no block. earliest is the first block that the node stored, as reth."
}
]
}Parameter options: TraceConfig
json
{
"title": "Trace config",
"description": "Options of debug_trace methods. The struct logger reads disableStack, enableMemory and disableStorage. The tracers read tracerConfig. callTracer reads onlyTopCall and withLog. prestateTracer reads diffMode, disableCode and disableStorage. muxTracer reads one key for each tracer to run.",
"type": "object",
"properties": {
"tracer": {
"title": "Tracer name",
"type": "string",
"description": "No tracer gives the struct logger. Cinder runs these built-in tracers. A JavaScript tracer is not supported.",
"enum": [
"callTracer",
"flatCallTracer",
"prestateTracer",
"4byteTracer",
"muxTracer",
"noopTracer"
]
},
"tracerConfig": {
"type": "object"
},
"disableStack": {
"type": "boolean"
},
"enableMemory": {
"type": "boolean"
},
"disableStorage": {
"type": "boolean"
}
}
}Result: TxTraceResult[]
json
{
"type": "array",
"items": {
"title": "Trace of one transaction in a block",
"type": "object",
"properties": {
"txHash": {
"title": "32 byte hex value",
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"result": {
"title": "Tracer result",
"description": "The shape depends on the tracer. No tracer: a struct logger result. callTracer: a call frame. flatCallTracer: an array of Parity-style flat frames. prestateTracer: an object that maps an address to its state, or an object with pre and post in diff mode. 4byteTracer: an object that maps a selector and call data size to a count. muxTracer: an object with one result for each tracer. noopTracer: an empty object.",
"oneOf": [
{
"title": "Struct logger result",
"type": "object",
"properties": {
"gas": {
"type": "integer"
},
"failed": {
"type": "boolean"
},
"returnValue": {
"type": "string"
},
"structLogs": {
"type": "array",
"items": {
"title": "Struct log step",
"type": "object",
"properties": {
"pc": {
"type": "integer"
},
"op": {
"type": "string"
},
"gas": {
"type": "integer"
},
"gasCost": {
"type": "integer"
},
"depth": {
"type": "integer"
},
"error": {
"type": "string"
},
"stack": {
"type": "array",
"items": {
"type": "string"
}
},
"memory": {
"type": "array",
"items": {
"type": "string"
}
},
"storage": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
{
"title": "Call frame",
"description": "The result of callTracer: one frame, with its sub-calls in calls.",
"type": "object",
"properties": {
"type": {
"type": "string"
},
"from": {
"title": "hex encoded address",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
},
"to": {
"title": "hex encoded address",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
},
"value": {
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
},
"gas": {
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
},
"gasUsed": {
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
},
"input": {
"title": "hex encoded bytes",
"type": "string",
"pattern": "^0x[0-9a-f]*$"
},
"output": {
"title": "hex encoded bytes",
"type": "string",
"pattern": "^0x[0-9a-f]*$"
},
"error": {
"type": "string"
},
"revertReason": {
"type": "string"
},
"calls": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CallFrame"
}
},
"logs": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
{
"type": "array",
"items": {
"type": "object"
}
},
{
"type": "object"
}
]
},
"error": {
"type": "string"
}
}
}
}