Skip to content

Commit 2223296

Browse files
authored
documents debug file traces (#1909)
* documents debug file traces Signed-off-by: m4sterbunny <[email protected]> * documents opcodes and standardizes style Signed-off-by: m4sterbunny <[email protected]> * cursor-revert of line length edits Signed-off-by: m4sterbunny <[email protected]> * cursor-revert of line length edits Signed-off-by: m4sterbunny <[email protected]> * cursor-revert of line length edits Signed-off-by: m4sterbunny <[email protected]> cherry pick sign * documents cli options (#1908) Signed-off-by: m4sterbunny <[email protected]> * updates additional booleans Signed-off-by: m4sterbunny <[email protected]> --------- Signed-off-by: m4sterbunny <[email protected]>
1 parent d3f2749 commit 2223296

2 files changed

Lines changed: 81 additions & 43 deletions

File tree

docs/public-networks/how-to/troubleshoot/trace-transactions.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,18 @@ The transaction-trace filtering APIs are:
4646
- [`trace_filter`](../../reference/api/index.md#trace_filter)
4747
- [`trace_get`](../../reference/api/index.md#trace_get)
4848
- [`trace_transaction`](../../reference/api/index.md#trace_transaction)
49+
50+
## Dumping traces to file
51+
52+
For large blocks or when you prefer file output over a JSON response, use the debug API methods:
53+
54+
- [`debug_standardTraceBlockToFile`](../../reference/api/index.md#debug_standardtraceblocktofile)
55+
- [`debug_standardTraceBadBlockToFile`](../../reference/api/index.md#debug_standardtracebadblocktofile)
56+
57+
Enable or disable trace fields (txHash, stack, memory, storage, and opcodes) via the optional options parameter on both methods. For example, set `disableStack`, `disableMemory`, and/or `disableStorage` to reduce output size or focus on specific data.
58+
59+
:::note
60+
61+
Trace files are written under the node data directory in the `traces` subdirectory; the data directory is set by the [`--data-path`](../../reference/cli/options.md#data-path) option.
62+
63+
:::

docs/public-networks/reference/api/index.md

Lines changed: 66 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,12 @@ Removes cache files for the specified range of blocks.
273273
You can skip a parameter by using an empty string, `""`. If you specify:
274274
275275
- No parameters, the call removes cache files for all blocks.
276-
277276
- Only `fromBlock`, the call removes cache files for the specified block.
278-
279277
- Only `toBlock`, the call removes cache files from the genesis block to the specified block.
280278
281279
#### Returns
282280
283-
`result`: _object_ - `Cache Removed` status or `error`.
281+
`result`: _object_ - `Cache Removed` status or `error`
284282
285283
<Tabs>
286284
@@ -1454,7 +1452,7 @@ the RPC call might time out even though Besu continues the operation in the back
14541452
14551453
- `blockNumber`: _string_ - hexadecimal integer representing a block number, or one of the
14561454
string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in
1457-
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter).
1455+
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter)
14581456
14591457
:::note
14601458
`pending` returns the same value as `latest`.
@@ -1511,9 +1509,17 @@ Use [`debug_standardTraceBadBlockToFile`](#debug_standardtracebadblocktofile) to
15111509
15121510
- `blockHash`: _string_ - block hash
15131511
1514-
- `txHash`: _string_ - (optional) transaction hash; if omitted, a trace file is generated for each transaction in the block.
1512+
- Optional second parameter _object_ (all keys optional):
1513+
1514+
- `txHash`: _string_ - transaction hash; if omitted, a trace file is generated for each transaction in the block
1515+
1516+
- `disableMemory`: _boolean_ - omit EVM memory from the trace; defaults to `false`
1517+
1518+
- `disableStack`: _boolean_ - omit stack from the trace; defaults to `false`
15151519
1516-
- `disableMemory`: _boolean_ - (optional) specifies whether to capture EVM memory during the trace; defaults to `true`
1520+
- `disableStorage`: _boolean_ - omit storage from the trace; defaults to `false`
1521+
1522+
- `opcodes`: _array_ of _strings_ - list of opcode names to trace; if omitted or empty, all opcodes are traced
15171523
15181524
#### Returns
15191525
@@ -1573,7 +1579,19 @@ Use [`debug_standardTraceBlockToFile`](#debug_standardtraceblocktofile) to view
15731579
15741580
#### Parameters
15751581
1576-
`blockHash`: _string_ - block hash
1582+
- `blockHash`: _string_ - block hash
1583+
1584+
- Optional second parameter _object_ (all keys optional):
1585+
1586+
- `txHash`: _string_ - transaction hash; if omitted, a trace file is generated for each transaction in the block
1587+
1588+
- `disableMemory`: _boolean_ - omit EVM memory from the trace; defaults to `true`
1589+
1590+
- `disableStack`: _boolean_ - omit stack from the trace; defaults to `false`
1591+
1592+
- `disableStorage`: _boolean_ - omit storage from the trace; defaults to `true`
1593+
1594+
- `opcodes`: _array_ of _strings_ - list of opcode names to trace; if omitted or empty, all opcodes are traced
15771595
15781596
#### Returns
15791597
@@ -1701,15 +1719,17 @@ Reruns the transaction with the same state as when the transaction executed.
17011719
17021720
#### Parameters
17031721
1704-
- `transactionHash`: _string_ - transaction hash
1722+
- `transactionHash`: _string_ - transaction hash.
1723+
1724+
- `options`: _object_ - request options object with the following fields (all optional):
17051725
1706-
- `options`: _object_ - request options object with the following fields (all optional and default to `false`):
1726+
- `disableStorage`: _boolean_ - `true` disables storage capture; defaults to `false`
17071727
1708-
- `disableStorage`: _boolean_ - `true` disables storage capture.
1728+
- `disableMemory`: _boolean_ - `true` disables memory capture; defaults to `true`
17091729
1710-
- `disableMemory`: _boolean_ - `true` disables memory capture.
1730+
- `disableStack` : _boolean_ - `true` disables stack capture; defaults to `false`
17111731
1712-
- `disableStack` : _boolean_ - `true` disables stack capture.
1732+
- `opcodes`: _array_ of _strings_ - list of opcode names to trace; if omitted or empty, all opcodes are traced
17131733
17141734
#### Returns
17151735
@@ -1781,14 +1801,13 @@ Returns full trace of all invoked opcodes of all transactions included in the bl
17811801
17821802
- `options`: _object_ - (optional) request options object with the following fields:
17831803
1784-
- `disableStorage`: _boolean_ - `true` disables storage capture.
1785-
The default is `false`.
1804+
- `disableStorage`: _boolean_ - `true` disables storage capture. The default is `false`.
17861805
1787-
- `disableMemory`: _boolean_ - `true` disables memory capture.
1788-
The default is `true`.
1806+
- `disableMemory`: _boolean_ - `true` disables memory capture. The default is `true`.
17891807
1790-
- `disableStack` : _boolean_ - `true` disables stack capture.
1791-
The default is `false`.
1808+
- `disableStack` : _boolean_ - `true` disables stack capture. The default is `false`.
1809+
1810+
- `opcodes`: _array_ of _strings_ - list of opcode names to trace; if omitted or empty, all opcodes are traced
17921811
17931812
#### Returns
17941813
@@ -1857,14 +1876,13 @@ Returns full trace of all invoked opcodes of all transactions included in the bl
18571876
18581877
- `options`: _object_ - (optional) request options object with the following fields:
18591878
1860-
- `disableStorage`: _boolean_ - `true` disables storage capture.
1861-
The default is `false`.
1879+
- `disableStorage`: _boolean_ - `true` disables storage capture. The default is `false`.
18621880
1863-
- `disableMemory`: _boolean_ - `true` disables memory capture.
1864-
The default is `true`.
1881+
- `disableMemory`: _boolean_ - `true` disables memory capture. The default is `true`.
18651882
1866-
- `disableStack` : _boolean_ - `true` disables stack capture.
1867-
The default is `false`.
1883+
- `disableStack` : _boolean_ - `true` disables stack capture. The default is `false`.
1884+
1885+
- `opcodes`: _array_ of _strings_ - list of opcode names to trace; if omitted or empty, all opcodes are traced
18681886
18691887
#### Returns
18701888
@@ -1941,14 +1959,13 @@ Returns full trace of all invoked opcodes of all transactions included in the bl
19411959
19421960
- `options`: _object_ - (optional) request options object with the following fields:
19431961
1944-
- `disableStorage`: _boolean_ - `true` disables storage capture.
1945-
The default is `false`.
1962+
- `disableStorage`: _boolean_ - `true` disables storage capture. The default is `false`.
19461963
1947-
- `disableMemory`: _boolean_ - `true` disables memory capture.
1948-
The default is `true`.
1964+
- `disableMemory`: _boolean_ - `true` disables memory capture. The default is `true`.
19491965
1950-
- `disableStack` : _boolean_ - `true` disables stack capture.
1951-
The default is `false`.
1966+
- `disableStack` : _boolean_ - `true` disables stack capture. The default is `false`.
1967+
1968+
- `opcodes`: _array_ of _strings_ - list of opcode names to trace; if omitted or empty, all opcodes are traced
19521969
19531970
#### Returns
19541971
@@ -2016,7 +2033,7 @@ temporary state changes without affecting the actual blockchain state.
20162033
20172034
#### Parameters
20182035
2019-
- `call`: _object_ - [transaction call object](objects.md#transaction-call-object)
2036+
- `call`: _object_ - [transaction call object](objects.md#transaction-call-object).
20202037
20212038
- `blockNumber`: _string_ - hexadecimal integer representing a block number, or one of the
20222039
string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in
@@ -2026,11 +2043,17 @@ temporary state changes without affecting the actual blockchain state.
20262043
`pending` returns the same value as `latest`.
20272044
:::
20282045
2029-
- `options`: _object_ - request options object with the following fields (all booleans default to `false`):
2030-
- `disableStorage`: _boolean_ - (optional) `true` disables storage capture.
2031-
- `disableMemory`: _boolean_ - (optional) `true` disables memory capture.
2032-
- `disableStack` : _boolean_ - (optional) `true` disables stack capture.
2033-
- `stateOverrides`: _object_ - (optional) [address-to-state mapping](./objects.md#state-override-object).
2046+
- `options`: _object_ - request options object with the following fields:
2047+
2048+
- `disableStorage`: _boolean_ - (optional) `true` disables storage capture; defaults to `false`
2049+
2050+
- `disableMemory`: _boolean_ - (optional) `true` disables memory capture; defaults to `true`
2051+
2052+
- `disableStack` : _boolean_ - (optional) `true` disables stack capture; defaults to `false`
2053+
2054+
- `opcodes`: _array_ of _strings_ - (optional) list of opcode names to trace; if omitted or empty, all opcodes are traced
2055+
2056+
- `stateOverrides`: _object_ - (optional) [address-to-state mapping](./objects.md#state-override-object)
20342057
20352058
#### Returns
20362059
@@ -2613,7 +2636,7 @@ Creates an [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) access list that
26132636
26142637
- `blockNumber`: _string_ - hexadecimal integer representing a block number, or one of
26152638
the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in
2616-
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter).
2639+
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter)
26172640
26182641
#### Returns
26192642
@@ -2693,7 +2716,7 @@ By default, the `eth_estimateGas` error response includes the [revert reason](..
26932716
26942717
- `blockNumber`: _string_ - (optional) hexadecimal integer representing a block number, or one of
26952718
the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in
2696-
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter).
2719+
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter)
26972720
The default is `pending`.
26982721
26992722
- `stateOverride`: _object_ - The [address-to-state mapping](./objects.md#state-override-object).
@@ -2850,7 +2873,7 @@ As of [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844), this method tracks tr
28502873
28512874
- `newestBlock`: _string_ - hexadecimal integer representing the highest number block of
28522875
the requested range, or one of the string tags `latest`, `earliest`, `pending`, `finalized`, or
2853-
`safe`, as described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter).
2876+
`safe`, as described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter)
28542877
28552878
:::note
28562879
`pending` returns the same value as `latest`.
@@ -3280,7 +3303,7 @@ Returns information about the block matching the specified block number.
32803303
32813304
- `blockNumber`: _string_ - hexadecimal integer representing a block number, or one of
32823305
the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in
3283-
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter).
3306+
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter)
32843307
32853308
:::note
32863309
`pending` returns the same value as `latest`.
@@ -3455,7 +3478,7 @@ gas used and any event logs that might have been produced by a smart contract du
34553478
34563479
`blockNumber`: _string_ - hexadecimal integer representing a block number, or one of
34573480
the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in
3458-
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter).
3481+
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter)
34593482
34603483
:::note
34613484
`pending` returns the same value as `latest`.
@@ -3736,7 +3759,7 @@ Returns the number of transactions in a block matching the specified block numbe
37363759
37373760
`blockNumber`: _string_ - hexadecimal integer representing a block number, or one of
37383761
the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in
3739-
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter).
3762+
[block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter)
37403763
37413764
:::note
37423765
`pending` returns the same value as `latest`.
@@ -5933,7 +5956,7 @@ block parameters without submitting them to the network.
59335956
59345957
- `blockNumber` or `blockHash`: _string_ - hexadecimal integer representing a block number,
59355958
block hash, or one of the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as
5936-
described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter).
5959+
described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter)
59375960
59385961
#### Returns
59395962

0 commit comments

Comments
 (0)