debug_traceBlockByNumber - Ethereum

debug_traceBlockByNumber. Replays the block that is already present in the database

debug_traceBlockByNumber - ethereum [Value: 90CU]
Replays the block that is already present in the database.
Use cases

Use cases

  • Analyze block's internal transactions for debugging purposes
  • Trace smart contract interactions within a specific block
  • Investigate gas usage for all transactions in block
Constraints

Constraints

  • Requires valid block number as input parameter
  • Node must support the debug_traceBlockByNumber method
  • High computational cost for tracing complex blocks
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://eth.drpc.org \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"debug_traceBlockByNumber","params":["0xccde12", {"tracer": "callTracer"}],"id":1,"jsonrpc":"2.0"}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "type": "CALL",
    "from": "0x0000000000000000000000000000000000000000",
    "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
    "value": "0x0",
    "gas": "0x7fffffffffffadf7",
    "gasUsed": "0x0",
    "input": "0x",
    "output": "0x"
  }
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
blockNumberstring
This describes the block number to fetch the transaction by.
tracerobject
Currently supports callTracer and prestateTracer
array
tracerstring
Default: callTracer.
tracerConfigobject
array
onlyTopCallboolean

Response

200
Array of block traces.

Response params

object
idinteger
jsonrpcstring
resultarray_of_objects
Is different for callTracer and prestateTracer
object
callTracerobject
object
fromstring
The address of the sender.
tostring
The address of the receiver.
valuestring
The value transferred in wei.
gasstring
The gas provided for the call.
inputstring
The data sent along with the call.
gasUsedstring
The amount of gas used by the trace.
outputstring
The output of the call.
errorstring
Error, if any
revertReasonstring
solidity revert reason, if any
callsarray
list of sub-calls
prestateTracerobject
object
balancestring
Balance in wei
nonceuint64
codestring
Hex-encoded bytecode
storagemap[string]string
Storage slots of the contract