[Trace] debug_traceBlock
The traceBlock method will return a full stack trace of all invoked opcodes of all transactions that were included in this block.
NOTE: the parent of this block must be present or it will fail.
JSONRPC: debug_traceBlock
Request
- application/json
Body
Array [
]
Default value: debug_traceBlock
Method name
Default value: 1
Request ID, Random or Auto incrementation
Default value: 2.0
JSON-RPC Version (2.0)
params
undefined[]
The RLP-encoded block.
TracingOptions
object
Setting this to true will disable storage capture (default = false).
Setting this to true will disable memory capture (default = false).
Setting this to true will disable stack capture (default = false).
Overrides the default timeout of 5 seconds for JavaScript-based tracing calls. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
Possible values: [4byteTracer
, callTracer
, fastCallTracer
, evmdisTracer
, noopTracer
, opcountTracer
, prestateTracer
, revertTracer
, unigramTracer
, bigramTracer
, trigramTracer
]
Setting this will enable JavaScript-based transaction tracing, described in the next section. If set, the previous four arguments will be ignored. The predefined tracers can also be used as the following table. | Tracer Name | Description | |-----|-----| | 4byteTracer | 4byteTracer searches for 4byte-identifiers, and collects them for post-processing. It collects the methods identifiers along with the size of the supplied data, so a reversed signature can be matched against the size of the data. | | callTracer | callTracer is a full-blown transaction tracer that extracts and reports all the internal calls made by a transaction, along with any useful information. | | fastCallTracer | fastCallTracer is a Go-native version of callTracer. Since it is not executed on JavaScript VM, it shows more than 10x speedup compared to callTracer. Please use fastCallTracer instead of callTracer if the performance is the matter of the first importance. | | evmdisTracer | evmdisTracer returns sufficient information from a trace to perform evmdis-style disassembly. | | noopTracer | noopTracer is just the barebone boilerplate code required from a JavaScript object to be usable as a transaction tracer. | | opcountTracer | opcountTracer is a sample tracer that just counts the number of instructions executed by the KLVM before the transaction terminated. | | prestateTracer | prestateTracer outputs sufficient information to create a local execution of the transaction from a custom assembled genesis block. | | revertTracer | revertTracer outputs the error string of REVERT. If the execution is not reverted, it outputs an empty string. | | unigramTracer | unigramTracer returns the number of occurrences of each opcode. | | bigramTracer | bigramTracer returns the number of occurrences of two consecutive opcodes. | | trigramTracer | trigramTracer returns the number of occurrences of three consecutive opcodes. |
Responses
- 200
The structured logs created during the execution of KLVM.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
Default value: 2.0
error
object
A Number that indicates the error type that occurred. This MUST be an integer.
| code | message | description | |-----|-----|-------| | -32700 | Parse error | invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. | |-32602 | Invalid params | Invalid method parameter(s). |
A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.
A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
result
object[]
The structured logs created during the execution of KLVM.
{
"jsonrpc": "2.0",
"id": 0,
"error": {
"code": -32700,
"message": "Parse error",
"data": "string"
},
"result": [
{
"result": {
"failed": false,
"gas": 247922,
"returnValue": "60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806341c0e1b514610051578063cfae321714610068575b600080fd5b34801561005d57600080fd5b506100666100f8565b005b34801561007457600080fd5b5061007d610168565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100bd5780820151818401526020810190506100a2565b50505050905090810190601f1680156100ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610166573373ffffffffffffffffffffffffffffffffffffffff16ff5b565b606060018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102005780601f106101d557610100808354040283529160200191610200565b820191906000526020600020905b8154815290600101906020018083116101e357829003601f168201915b50505050509050905600a165627a7a72305820f4e74ca2266a24aabd6a8ee6c4e54ad49014e2faa152e49e7f9d927c932c72870029",
"structLogs": [
{
"pc": 2,
"op": "PUSH1",
"gas": 891341,
"gasCost": 3,
"depth": 1,
"stack": [
"0000000000000000000000000000000000000000000000000000000000000080"
],
"memory": [],
"storage": {}
},
{
"...": null
}
]
}
}
]
}