debug_traceBlockByNumber - Optimistic Ethereum
Summary
Returns the tracing result by executing all transactions in the block specified by number with a tracer.Parameters
1. Block Number Quantity or Tag
The RLP encoded block. Hex block number, or the tag
latest
, earliest
or pending
Example:
latest or pending
2. Tracer Object
Tracer String
Type of tracer, either
callTracer
or prestateTracer
Example:
{"tracer": "callTracer"}
Only Top Call Boolean
When true, only top level call will be traced and no sub-calls.
Example:
{"tracer": "callTracer", "tracerConfig": {"onlyTopCall": true}}
Code Examples
debug_traceBlockByNumber request
curl https://optimism.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY \ -X POST \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 0, "method": "debug_traceBlockByNumber", "params": [ "0xccde12", { "tracer": "callTracer" } ] }'
debug_traceBlockByNumber response
{ "id": 0, "jsonrpc": "2.0", "result": [ { "result": { "type": "CALL", "from": "0xf131e268ea9dbd9a9892d1f8ee0141cb2e6cfd30", "to": "0x7d9d3659dcfbea08a87777c52020bc672deece13", "value": "0x0", "gas": "0x1edae", "gasUsed": "0x12509", "input": "0x52b104a70000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000fda0000000000000000000000000000000000000000000000000000000000000f08" }, "txHash": "0xacdf36be77d31922c19d982c5d0f9c78a614df221043a9925d92c9526a3744fa" }, { "result": { "type": "CALL", "from": "0xcd20e9e461d614d4213d44d1d9099a9a3e889883", "to": "0x9e3382ca57f4404ac7bf435475eae37e87d1c453", "value": "0x0", "gas": "0x219b4", "gasUsed": "0x20952", "input": "0x458a1d6e00000000000000000000000000000000000000000000000ad78ebc5ac6200000", "calls": [ { "type": "DELEGATECALL", "from": "0x9e3382ca57f4404ac7bf435475eae37e87d1c453", "to": "0x3a5e31517902ba2f77052357937a66b5a19e1961", "gas": "0x1f61c", "gasUsed": "0x1ed8c", "input": "0x458a1d6e00000000000000000000000000000000000000000000000ad78ebc5ac6200000", "calls": [ { "type": "CALL", "from": "0x9e3382ca57f4404ac7bf435475eae37e87d1c453", "to": "0xdce455355c2993c18ab5a34dfee4525d66eadaf5", "value": "0x0", "gas": "0x1ad82", "gasUsed": "0x10e8a", "input": "0xbc3e1b7a000000000000000000000000cd20e9e461d614d4213d44d1d9099a9a3e8898830000000000000000000000001559fa1b8f28238fd5d76d9f434ad86fd20d155900000000000000000000000000000000000000000000000ad78ebc5ac6200000", "output": "0x00000000000000000000000000000000000000000000000ad78ebc5ac6200000", "calls": [ { "type": "CALL", "from": "0xdce455355c2993c18ab5a34dfee4525d66eadaf5", "to": "0xc779a854047a06244ae6bdb648290d364cd971e8", "value": "0x0", "gas": "0x16540", "gasUsed": "0xc2e6", "input": "0x9cc7a367000000000000000000000000cd20e9e461d614d4213d44d1d9099a9a3e88988300000000000000000000000000000000000000000000000ad78ebc5ac6200000", "calls": [ { "type": "DELEGATECALL", "from": "0xc779a854047a06244ae6bdb648290d364cd971e8", "to": "0x0cd5a287923101188c7879edd3f3d0ec2fa28bd3", "gas": "0x14c40", "gasUsed": "0xaecb", "input": "0x9cc7a367000000000000000000000000cd20e9e461d614d4213d44d1d9099a9a3e88988300000000000000000000000000000000000000000000000ad78ebc5ac6200000" } ] } ] }, { "type": "CALL", "from": "0x9e3382ca57f4404ac7bf435475eae37e87d1c453", "to": "0x1559fa1b8f28238fd5d76d9f434ad86fd20d1559", "value": "0x0", "gas": "0x8a5e", "gasUsed": "0x74e9", "input": "0xa9059cbb000000000000000000000000cd20e9e461d614d4213d44d1d9099a9a3e88988300000000000000000000000000000000000000000000000ad78ebc5ac6200000", "output": "0x0000000000000000000000000000000000000000000000000000000000000001" } ] } ] }, "txHash": "0x240a99ae458ff8114dc8957949f19f5478b39d5cdeb22f4d4280f18aac64d09f" } ] }