trace_block
The trace_block method returns traces for all transactions in a block using the Parity/OpenEthereum tracing format. This method provides detailed execution traces for every transaction in the specified block, including internal calls, value transfers, contract creations, and state changes.
This method is particularly useful for blockchain analytics, transaction tracking, and understanding complex multi-contract interactions. It offers a different trace format compared to the debug methods, using the Parity trace format which provides a flattened view of all actions in the block. Developers building block explorers, MEV tools, or analytics platforms can use this to analyze all value flows, internal contract calls, and state changes within a block in a consistent format.
This method is available only on the full archive node.
Parameters
parameter | type | description |
|---|---|---|
blockParameter | string (required) | Block number in hex format (e.g., '0x10d4f') or one of the string tags: 'latest' for the most recent block, 'earliest' for the genesis block, or 'pending' for pending state/transactions |
Return Object
The method returns an array of trace objects for all transactions and internal calls in the block:
result - array: An array of trace objects, where each trace represents a single action (call, create, selfdestruct, or reward). Each trace object contains:
action - object: The action being performed with fields depending on the action type:
For calls: callType (call/delegatecall/staticcall), from, to, gas, input, value
For creates: from, gas, init, value
For selfdestructs: address, refundAddress, balance
result - object: The result of the action (null for failed actions) containing:
For calls: gasUsed, output
For creates: gasUsed, code, address
subtraces - number: The number of child traces (internal calls) this action spawned
traceAddress - array: Array of integers indicating the position of this trace in the call tree
type - string: The type of action (call, create, suicide, reward)
blockHash - string: Hash of the block containing this trace
blockNumber - number: Number of the block containing this trace
transactionHash - string: Hash of the transaction that generated this trace
transactionPosition - number: Position of the transaction in the block
error - string: Error message if the action failed
Request Example
Response Example