Skip to content

Commit b066295

Browse files
authored
Add debug_traceCall (#709)
1 parent 5ecdf2c commit b066295

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

docs/build/EVM/evm-debug-api.md

+31-25
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 10
33
---
44

5-
# Debug EVM Transactions
5+
# Debug EVM Transactions
66

77
Geth's debug APIs and OpenEthereum's trace module provide non-standard RPC methods for getting a deeper insight into transaction processing.
88

@@ -12,17 +12,32 @@ Geth's debug APIs and OpenEthereum's trace module provide non-standard RPC metho
1212

1313
The following RPC methods are available:
1414

15-
* debug_traceTransaction - requires the hash of the transaction to be traced, optional parameters:
16-
- `disableStorage(boolean)` - (default: false) setting this to true disables storage capture
17-
- `disableMemory(boolean)` - (default: false) setting this to true disables memory capture
18-
- `disableStack(boolean)` - (default: false) setting this to true disables stack capture
19-
* [trace_filter](https://openethereum.github.io/JSONRPC-trace-module#trace_filter) - optional parameters:
20-
- `fromBlock(uint blockNumber)` - either block number (hex), earliest which is the genesis block or latest (default) best block available. Trace starting block
21-
- `toBlock(uint blockNumber)` - either block number (hex), earliest which is the genesis block or latest best block available. Trace ending block
22-
- `fromAddress(array addresses)` - filter transactions done from these addresses only. If an empty array is provided, no filtering is done with this field
23-
- `toAddress(array addresses)` - filter transactions done from these addresses only. If an empty array is provided, no filtering is done with this field
24-
- `after(uint offset)` - default offset is 0. Trace offset (or starting) number
25-
- `count(uint numberOfTraces)` - number of traces to display in a batch
15+
### [debug_traceTransaction](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugtracetransaction)
16+
17+
* This call will attempt to run the transaction in the exact same manner as it was executed on the network. It will replay any transaction that may have been executed prior to this one before it will finally attempt to execute the transaction that corresponds to the given hash.
18+
* Optional params:
19+
* `disableStorage(boolean)` - (default: false) setting this to true disables storage capture
20+
* `disableMemory(boolean)` - (default: false) setting this to true disables memory capture
21+
* `disableStack(boolean)` - (default: false) setting this to true disables stack capture
22+
23+
### [debug_traceBlock](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugtraceblock)
24+
25+
* This call will return a full stack trace of all invoked opcodes of all transaction that were included in this block.
26+
* variants to `debug_traceBlockByHash` and `debug_traceBlockByNumber` are also available
27+
28+
### [debug_traceCall](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugtracecall)
29+
30+
* This call will run an _eth-call-like_ execution within the context of the given block execution using the final state of parent block as the base.
31+
32+
### [trace_filter](https://openethereum.github.io/JSONRPC-trace-module#trace_filter)
33+
34+
* Optional params:
35+
* `fromBlock(uint blockNumber)` - either block number (hex), earliest which is the genesis block or latest (default) best block available. Trace starting block
36+
* `toBlock(uint blockNumber)` - either block number (hex), earliest which is the genesis block or latest best block available. Trace ending block
37+
* `fromAddress(array addresses)` - filter transactions done from these addresses only. If an empty array is provided, no filtering is done with this field
38+
* `toAddress(array addresses)` - filter transactions done from these addresses only. If an empty array is provided, no filtering is done with this field
39+
* `after(uint offset)` - default offset is 0. Trace offset (or starting) number
40+
* `count(uint numberOfTraces)` - number of traces to display in a batch
2641

2742
There are some default values that you should be aware of:
2843

@@ -34,9 +49,7 @@ To change the default values you can add CLI flags when spinning up your tracing
3449
## Run a Debugging Node
3550

3651
:::caution
37-
3852
EVM tracing features available from Astar 5.1 release.
39-
4053
:::
4154

4255
To use the supported RPC methods, you need to run a node in debug mode, which is slightly different than running a full node. Additional flags will also need to be used to tell the node which of the non-standard features to support.
@@ -52,25 +65,20 @@ Spinning up a debug or tracing node is similar to running a full node. However,
5265
* `--ethapi-trace-cache-duration <uint>` - sets the duration (in seconds) after which the cache of `trace_filter`, for a given block, is discarded. _The default amount of time blocks are stored in the cache is **300** seconds_
5366

5467
:::info
55-
56-
EVM tracing node installation manual available on [this page](/docs/build/nodes/evm-tracing-node).
57-
68+
EVM tracing node installation manual available on [this page](/docs/build/nodes/evm-tracing-node).
5869
:::
5970

60-
6171
### Using the Debug/Tracing API
6272

6373
Once you have a running tracing node, you can open your terminal to run curl commands and start to call any of the available JSON RPC methods.
6474

6575
For example, for the `debug_traceTransaction` method, you can make the following JSON RPC request in your terminal:
6676

6777
:::caution
68-
6978
`--ethapi=debug` flag as tracing node argument required to expose this API.
70-
7179
:::
7280

73-
```
81+
```Bash
7482
curl http://127.0.0.1:9944 -H "Content-Type:application/json;charset=utf-8" -d \
7583
'{
7684
"jsonrpc":"2.0",
@@ -84,7 +92,7 @@ The node responds with the step-by-step replayed transaction information.
8492

8593
For the `trace_filter` call, you can make the following JSON RPC request in your terminal (in this case, the filter is from block 20000 to 25000, only for transactions where the recipient is 0x4E0078423a39EfBC1F8B5104540aC2650a756577, it will start with a zero offset and provide the first 20 traces):
8694

87-
```
95+
```Bash
8896
curl http://127.0.0.1:9944 -H "Content-Type:application/json;charset=utf-8" -d '{
8997
"jsonrpc":"2.0",
9098
"id":1,
@@ -99,12 +107,10 @@ The node responds with the trace information corresponding to the filter.
99107
Let's get pool status using `curl` HTTP POST request.
100108

101109
:::caution
102-
103110
`--ethapi=txpool` flag as tracing node argument required to expose this API.
104-
105111
:::
106112

107-
```
113+
```Bash
108114
curl http://127.0.0.1:9944 -H "Content-Type:application/json;charset=utf-8" -d \
109115
'{
110116
"jsonrpc":"2.0",

0 commit comments

Comments
 (0)