Skip to content
Open
319 changes: 319 additions & 0 deletions src/debug/trace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,319 @@
- name: debug_traceBlockByNumber
Comment thread
MysticRyuujin marked this conversation as resolved.
summary: Replays a block and returns traces for all transactions.
description: >-
Replays the block identified by the given number and returns a trace for
every transaction in the block. The parent block must be present in the
client's database. The genesis block (block 0) cannot be traced because
it has no parent state to replay from; clients MUST return an error for
this input.

When no tracer is specified (or the tracer field is absent), the opcode
(struct) logger is used and each entry conforms to
OpcodeBlockTransactionTrace, whose result field conforms to
OpcodeTransactionTrace.

When a named tracer is specified via the tracer field in TraceConfig (e.g.
"callTracer", "prestateTracer"), the result field of each entry contains
tracer-specific output. Defining the output schemas of named tracers is
outside the scope of this specification.

The response is an array ordered by transaction index within the block.
Each entry includes the transaction hash paired with its trace result.
Comment thread
MysticRyuujin marked this conversation as resolved.
If a timeout is configured and reached before tracing completes, the
client MUST return an error; no partial results are returned. Clients
that do not support execution timeouts MAY ignore the timeout field.
params:
- name: Block
required: true
schema:
$ref: '#/components/schemas/BlockNumberOrTag'
- name: TraceConfig
required: false
schema:
$ref: '#/components/schemas/TraceConfig'
errors:
- code: 4444
message: Pruned history unavailable
Comment thread
MysticRyuujin marked this conversation as resolved.
Copy link
Copy Markdown
Contributor

@s1na s1na Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably also an error for "block not found" and parent not found

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as here

result:
name: Block trace
schema:
title: Array of per-transaction traces
description: >-
An array of trace entries ordered by transaction index within the block.
When no named tracer is set, each entry conforms to
OpcodeBlockTransactionTrace. When a named tracer is set, the result
field of each entry contains tracer-specific output not defined by this
specification, but the txHash field is always present.
type: array
items:
anyOf:
- title: Opcode tracer entry
description: Returned when no named tracer is specified.
$ref: '#/components/schemas/OpcodeBlockTransactionTrace'
- title: Named tracer entry
description: >-
Returned when a named tracer is specified. The result field
contains tracer-specific output not defined by this specification.
type: object
required:
- txHash
- result
properties:
txHash:
$ref: '#/components/schemas/hash32'
result:
description: >-
Named tracer output. The schema is unspecified and may be
any valid JSON value.
examples:
- name: debug_traceBlockByNumber example (opcode tracer)
params:
- name: Block
value: '0x3'
- name: TraceConfig
value:
disableStack: false
disableStorage: false
enableMemory: false
enableReturnData: false
result:
name: Block trace
value:
- txHash: '0xdd8cf045113754c306ba9ac8ac8786235e33bc5c087678084ef260a2a583f127'
result:
structLogs:
- pc: 0
op: PUSH1
gas: 68612
gasCost: 3
depth: 1
stack:
- '0x60'
- pc: 2
op: PUSH1
gas: 68609
gasCost: 3
depth: 1
stack:
- '0x60'
- '0x40'
- pc: 4
op: MSTORE
gas: 68606
gasCost: 12
depth: 1
stack: []
gas: 26916
failed: false
returnValue: '0x'

- name: debug_traceBlockByHash
summary: Replays a block and returns traces for all transactions.
description: >-
Replays the block identified by the given hash and returns a trace for
every transaction in the block. The parent block must be present in the
client's database. The genesis block (block 0) cannot be traced because
it has no parent state to replay from; clients MUST return an error for
this input.

When no tracer is specified (or the tracer field is absent), the opcode
(struct) logger is used and each entry conforms to
OpcodeBlockTransactionTrace, whose result field conforms to
OpcodeTransactionTrace.

When a named tracer is specified via the tracer field in TraceConfig (e.g.
"callTracer", "prestateTracer"), the result field of each entry contains
tracer-specific output. Defining the output schemas of named tracers is
outside the scope of this specification.

The response is an array ordered by transaction index within the block.
Each entry includes the transaction hash paired with its trace result.
If a timeout is configured and reached before tracing completes, the
client MUST return an error; no partial results are returned. Clients
that do not support execution timeouts MAY ignore the timeout field.

Clients MUST return an error if no block with the given hash is found.
params:
- name: Block hash
required: true
schema:
$ref: '#/components/schemas/hash32'
- name: TraceConfig
required: false
schema:
$ref: '#/components/schemas/TraceConfig'
errors:
- code: 4444
message: Pruned history unavailable
result:
name: Block trace
schema:
title: Array of per-transaction traces
description: >-
An array of trace entries ordered by transaction index within the block.
When no named tracer is set, each entry conforms to
OpcodeBlockTransactionTrace. When a named tracer is set, the result
field of each entry contains tracer-specific output not defined by this
specification, but the txHash field is always present.
type: array
items:
anyOf:
- title: Opcode tracer entry
description: Returned when no named tracer is specified.
$ref: '#/components/schemas/OpcodeBlockTransactionTrace'
- title: Named tracer entry
description: >-
Returned when a named tracer is specified. The result field
contains tracer-specific output not defined by this specification.
type: object
required:
- txHash
- result
properties:
txHash:
$ref: '#/components/schemas/hash32'
result:
description: >-
Named tracer output. The schema is unspecified and may be
any valid JSON value.
examples:
- name: debug_traceBlockByHash example (opcode tracer)
params:
- name: Block hash
value: '0x79ba0368c2c6563a7d263695b583dcc6d1c25d4988daa0105804d38bdd987f2f'
- name: TraceConfig
value:
disableStack: false
disableStorage: false
enableMemory: false
enableReturnData: false
result:
name: Block trace
value:
- txHash: '0xdd8cf045113754c306ba9ac8ac8786235e33bc5c087678084ef260a2a583f127'
result:
structLogs:
- pc: 0
op: PUSH1
gas: 68612
gasCost: 3
depth: 1
stack:
- '0x60'
- pc: 2
op: PUSH1
gas: 68609
gasCost: 3
depth: 1
stack:
- '0x60'
- '0x40'
- pc: 4
op: MSTORE
gas: 68606
gasCost: 12
depth: 1
stack: []
gas: 26916
failed: false
returnValue: '0x'

- name: debug_traceTransaction
summary: Replays a transaction and returns its trace.
description: >-
Executes the transaction identified by the given hash in the exact manner it
was executed on the network, replaying all prior transactions in the same
block as necessary to reconstruct the correct pre-execution state.

When no tracer is specified (or the tracer field is absent), the opcode
(struct) logger is used and the result conforms to OpcodeTransactionTrace.

When a named tracer is specified via the tracer field in TraceConfig (e.g.
"callTracer", "prestateTracer"), the result contains tracer-specific output.
Defining the output schemas of named tracers is outside the scope of this
specification.
params:
- name: Transaction hash
required: true
schema:
$ref: '#/components/schemas/hash32'
- name: TraceConfig
required: false
schema:
$ref: '#/components/schemas/TraceConfig'
errors:
- code: 4444
message: Pruned history unavailable
result:
name: Transaction trace
schema:
title: Transaction trace result
anyOf:
- title: Opcode tracer result
description: Returned when no named tracer is specified.
$ref: '#/components/schemas/OpcodeTransactionTrace'
- title: Named tracer result
description: >-
Returned when a named tracer is specified via the tracer field.
The format is tracer-specific and not defined by this specification.
Named tracers may return any JSON value (object, array, integer, etc.).
examples:
- name: debug_traceTransaction example (opcode tracer)
params:
- name: Transaction hash
value: '0xdd8cf045113754c306ba9ac8ac8786235e33bc5c087678084ef260a2a583f127'
- name: TraceConfig
value:
disableStack: false
disableStorage: false
enableMemory: false
enableReturnData: false
result:
name: Transaction trace
value:
structLogs:
- pc: 0
op: PUSH1
gas: 68612
gasCost: 3
depth: 1
stack:
- '0x60'
- pc: 2
op: PUSH1
gas: 68609
gasCost: 3
depth: 1
stack:
- '0x60'
- '0x40'
- pc: 4
op: MSTORE
gas: 68606
gasCost: 12
depth: 1
stack: []
gas: 26916
failed: false
returnValue: '0x'
- name: debug_traceTransaction example (callTracer)
params:
- name: Transaction hash
value: '0xdd8cf045113754c306ba9ac8ac8786235e33bc5c087678084ef260a2a583f127'
- name: TraceConfig
value:
tracer: callTracer
tracerConfig:
onlyTopCall: false
withLog: true
result:
name: Transaction trace (callTracer)
value:
type: CALL
from: '0xfe3b557e8fb62b89f4916b721be55ceb828dbd73'
to: '0x0100000000000000000000000000000000000000'
value: '0x0'
gas: '0x1a49e'
gasUsed: '0x1a49e'
input: '0x'
output: '0x'
Loading
Loading