debug_traceBlockByNumber
The debug_traceBlockByNumber method returns the full trace of all transactions in a block identified by its number. This method provides comprehensive debugging information for every transaction in the block, including all internal calls, opcode execution, gas consumption, and storage modifications.
This method is particularly useful when analyzing blocks at specific heights on the Kaia network, tracking historical execution patterns, debugging transactions at known block numbers, and building sequential analysis tools. Developers can use it to trace execution at specific blockchain milestones, analyze transaction patterns during specific time periods, debug issues reported at particular block heights, and perform temporal analysis of smart contract behavior. The block number parameter makes it more convenient than using block hashes when working with sequential block analysis.
This method is available only on the full archive node.
Parameters
parameter | type | description |
|---|---|---|
blockNumber | string (required) | Block number in hexadecimal 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 |
traceConfig | object (optional) | Configuration object to customize the trace output for all transactions in the block |
Trace Config Properties:
property | type | description |
|---|---|---|
tracer | string (optional) | The type of tracer: 'callTracer' for call tree, 'prestateTracer' for state diff, '4byteTracer' for method signatures, or custom JavaScript tracer code |
timeout | string (optional) | Maximum time allowed for the trace operation (e.g., '10s'). Defaults to '5s' |
disableStorage | boolean (optional) | Set to true to disable storage capture, significantly reducing trace size and improving performance |
disableMemory | boolean (optional) | Set to true to disable memory capture in the trace |
disableStack | boolean (optional) | Set to true to disable stack capture in the trace |
Return Object
The method returns an array of trace objects, one for each transaction in the block. The structure of each trace depends on the tracer used and follows the same format as debug_traceTransaction.
Request Example
Response Example