From 40f7acf4f3d4095f3f3d4c0db2790833f1cfc9a3 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Mon, 1 Apr 2024 23:47:15 +0800 Subject: [PATCH] docs/trace: move opcode related config into builtin tracer Signed-off-by: jsvisa --- docs/developers/evm-tracing/built-in-tracers.md | 15 ++++++++++++++- docs/interacting-with-geth/rpc/ns-debug.md | 4 ---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/developers/evm-tracing/built-in-tracers.md b/docs/developers/evm-tracing/built-in-tracers.md index 2eb7e098c5..8a2cf84a10 100644 --- a/docs/developers/evm-tracing/built-in-tracers.md +++ b/docs/developers/evm-tracing/built-in-tracers.md @@ -26,6 +26,15 @@ The struct logger (aka opcode logger) is a native Go tracer which executes a tra Note that the fields `memory`, `stack`, `returnData`, and `storage` have dynamic size and depending on the exact transaction they could grow large in size. This is specially true for `memory` which could blow up the trace size. It is recommended to keep them disabled unless they are explicitly required for a given use case. +### opcode config{#struct-opcode-config} + +- `enableMemory`: `BOOL`. Setting this to true will enable memory capture (default = false). +- `disableStack`: `BOOL`. Setting this to true will disable stack capture (default = false). +- `disableStorage`: `BOOL`. Setting this to true will disable storage capture (default = false). +- `enableReturnData`: `BOOL`. Setting this to true will enable return data capture (default = false). +- `debug`: `BOOL`. Setting this to true will print output during capture end (default = false). +- `limit`: `INTEGER`. Setting this to a positive integer will limit the number of steps captured (default = 0, no limit). + It is also possible to configure the trace by passing Boolean (true/false) values for four parameters that tweak the verbosity of the trace. By default, the _EVM memory_ and _Return data_ are not reported but the _EVM stack_ and _EVM storage_ are. To report the maximum amount of data: ```sh @@ -180,7 +189,7 @@ Things to note about the call tracer: - In case the top level frame reverts, its `revertReason` field will contain the parsed reason of revert as returned by the Solidity contract -#### Config +#### callTracer config{#call-tracer-config} `callTracer` accepts two options: @@ -204,6 +213,10 @@ The prestate tracer has two modes: `prestate` and `diff`. The `prestate` mode re | code | string | hex-encoded bytecode | | storage | map[string]string | storage slots of the contract | +#### prestateTracer config {#prestate-tracer-config} + +- `diffMode`: `BOOL`. Setting this to true will enable diff mode (default = false). + In `diff` mode the result object will contain a `pre` and a `post` object: 1. Any read-only access is omitted completely from the result. This mode is only concerned with state modifications. diff --git a/docs/interacting-with-geth/rpc/ns-debug.md b/docs/interacting-with-geth/rpc/ns-debug.md index 6b1fd024de..9363231f40 100644 --- a/docs/interacting-with-geth/rpc/ns-debug.md +++ b/docs/interacting-with-geth/rpc/ns-debug.md @@ -687,10 +687,6 @@ hash. In addition to the hash of the transaction you may give it a secondary _optional_ argument, which specifies the options for this specific call. The possible options are: -- `disableStorage`: `BOOL`. Setting this to true will disable storage capture (default = false). -- `disableStack`: `BOOL`. Setting this to true will disable stack capture (default = false). -- `enableMemory`: `BOOL`. Setting this to true will enable memory capture (default = false). -- `enableReturnData`: `BOOL`. Setting this to true will enable return data capture (default = false). - `tracer`: `STRING`. Name for built-in tracer or Javascript expression. See below for more details. If set, the previous four arguments will be ignored.