Skip to content

Commit c03272a

Browse files
authored
Add new debug RPCs to display the block trace. (#606)
* Rename whitelist to allowlist. Signed-off-by: Byron Gravenorst <[email protected]> * Additional updates. Signed-off-by: Byron Gravenorst <[email protected]> * Whitelist renaming. Signed-off-by: Byron Gravenorst <[email protected]> * Address reviewer feedback. Signed-off-by: Byron Gravenorst <[email protected]> * Fix typos. Signed-off-by: Byron Gravenorst <[email protected]> * Add new debug RPCs to display the block trace. Signed-off-by: Byron Gravenorst <[email protected]> * Fix markdown issues. Signed-off-by: Byron Gravenorst <[email protected]>
1 parent e45b88d commit c03272a

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

docs/Reference/API-Methods.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4046,6 +4046,100 @@ Returns the accounts for a specified block.
40464046
}
40474047
```
40484048

4049+
### `debug_standardTraceBlockToFile`
4050+
4051+
Generates files containing the block trace. A separate file is generated for each
4052+
transaction in the block.
4053+
4054+
You can also specify a trace file for a specific transaction in a block.
4055+
4056+
Use [`debug_standardTraceBadBlockToFile`](#debug_standardtracebadblocktofile) to view the trace for
4057+
an invalid block.
4058+
4059+
#### Parameters
4060+
4061+
`blockHash` : `data` - Block hash.
4062+
4063+
`txHash` : `data` - The transaction hash. Optional. If omitted, then a trace file is generated for each
4064+
transaction in the block.
4065+
4066+
`disableMemory` : `boolean` - Specify whether to capture EVM memory during the trace.
4067+
Defaults to `true`.
4068+
4069+
#### Returns
4070+
4071+
`result` : `data` - Location of the generated trace files.
4072+
4073+
!!! example
4074+
4075+
=== "curl HTTP request"
4076+
4077+
```bash
4078+
curl -X POST --data '{"jsonrpc":"2.0","method":"debug_standardTraceBlockToFile","params":["0x2dc0b6c43144e314a86777b4bd4f987c0790a6a0b21560671d221ed81a23f2dc", {
4079+
"txHash": "0x4ff04c4aec9517721179c8dd435f47fbbfc2ed26cd4926845ab687420d5580a6", "disableMemory": false}], "id":1}' http://127.0.0.1:8545
4080+
```
4081+
4082+
=== "wscat WS request"
4083+
4084+
```bash
4085+
{"jsonrpc":"2.0","method":"debug_standardTraceBlockToFile","params":["0x2dc0b6c43144e314a86777b4bd4f987c0790a6a0b21560671d221ed81a23f2dc", {
4086+
"txHash": "0x4ff04c4aec9517721179c8dd435f47fbbfc2ed26cd4926845ab687420d5580a6", "disableMemory": false}], "id":1}
4087+
```
4088+
4089+
=== "JSON result"
4090+
4091+
```json
4092+
{
4093+
"jsonrpc": "2.0",
4094+
"id": 1,
4095+
"result": [
4096+
"/Users/me/mynode/goerli/data/traces/block_0x2dc0b6c4-4-0x4ff04c4a-1612820117332"
4097+
]
4098+
}
4099+
```
4100+
4101+
### `debug_standardTraceBadBlockToFile`
4102+
4103+
Generates files containing the block trace of invalid blocks. A separate file is generated for each
4104+
transaction in the block.
4105+
4106+
Use [`debug_standardTraceBlockToFile`](#debug_standardtraceblocktofile) to view the trace for a
4107+
valid block.
4108+
4109+
#### Parameters
4110+
4111+
`blockHash` : `data` - Block hash.
4112+
4113+
#### Returns
4114+
4115+
`result` : `data` - Location of the generated trace files.
4116+
4117+
!!! example
4118+
4119+
=== "curl HTTP request"
4120+
4121+
```bash
4122+
curl -X POST --data '{"jsonrpc":"2.0","method":"debug_standardTraceBadBlockToFile","params":["0x53741e9e94791466d117c5f9e41a2ed1de3f73d39920c621dfc2f294e7779baa"], "id":1}' http://127.0.0.1:8545
4123+
```
4124+
4125+
=== "wscat WS request"
4126+
4127+
```bash
4128+
{"jsonrpc":"2.0","method":"debug_standardTraceBadBlockToFile","params":["0x53741e9e94791466d117c5f9e41a2ed1de3f73d39920c621dfc2f294e7779baa"], "id":1}
4129+
```
4130+
4131+
=== "JSON result"
4132+
4133+
```json
4134+
{
4135+
"jsonrpc": "2.0",
4136+
"id": 1,
4137+
"result": [
4138+
"/Users/me/mynode/goerli/data/traces/block_0x53741e9e-0-0x407ec43d-1600951088172"
4139+
]
4140+
}
4141+
```
4142+
40494143
### `debug_storageRangeAt`
40504144

40514145
[Remix](https://remix.ethereum.org/) uses `debug_storageRangeAt` to implement debugging. Use the

0 commit comments

Comments
 (0)