Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
rpc: fix TraceConfig param for tracers (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto-facs authored Sep 15, 2021
1 parent 116de54 commit 0463c8b
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 413 deletions.
30 changes: 7 additions & 23 deletions docs/api/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
- [AccessTuple](#ethermint.evm.v1.AccessTuple)
- [ChainConfig](#ethermint.evm.v1.ChainConfig)
- [Log](#ethermint.evm.v1.Log)
- [LogConfig](#ethermint.evm.v1.LogConfig)
- [Params](#ethermint.evm.v1.Params)
- [State](#ethermint.evm.v1.State)
- [TraceConfig](#ethermint.evm.v1.TraceConfig)
Expand Down Expand Up @@ -211,27 +210,6 @@ the node.



<a name="ethermint.evm.v1.LogConfig"></a>

### LogConfig
LogConfig are the configuration options for structured logger the EVM


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `disable_memory` | [bool](#bool) | | disable memory capture |
| `disable_stack` | [bool](#bool) | | disable stack capture |
| `disable_storage` | [bool](#bool) | | disable storage capture |
| `disable_return_data` | [bool](#bool) | | disable return data capture |
| `debug` | [bool](#bool) | | print output during capture end |
| `limit` | [int32](#int32) | | maximum length of output, but zero means unlimited |
| `overrides` | [ChainConfig](#ethermint.evm.v1.ChainConfig) | | Chain overrides, can be used to execute a trace using future fork rules |






<a name="ethermint.evm.v1.Params"></a>

### Params
Expand Down Expand Up @@ -278,7 +256,13 @@ TraceConfig holds extra parameters to trace functions.
| `tracer` | [string](#string) | | custom javascript tracer |
| `timeout` | [string](#string) | | overrides the default timeout of 5 seconds for JavaScript-based tracing calls |
| `reexec` | [uint64](#uint64) | | number of blocks the tracer is willing to go back |
| `log_config` | [LogConfig](#ethermint.evm.v1.LogConfig) | | configuration options for structured logger the EVM |
| `disable_memory` | [bool](#bool) | | disable memory capture |
| `disable_stack` | [bool](#bool) | | disable stack capture |
| `disable_storage` | [bool](#bool) | | disable storage capture |
| `disable_return_data` | [bool](#bool) | | disable return data capture |
| `debug` | [bool](#bool) | | print output during capture end |
| `limit` | [int32](#int32) | | maximum length of output, but zero means unlimited |
| `overrides` | [ChainConfig](#ethermint.evm.v1.ChainConfig) | | Chain overrides, can be used to execute a trace using future fork rules |



Expand Down
22 changes: 8 additions & 14 deletions proto/ethermint/evm/v1/evm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -206,24 +206,18 @@ message TraceConfig {
string timeout = 2;
// number of blocks the tracer is willing to go back
uint64 reexec = 3;
// configuration options for structured logger the EVM
LogConfig log_config = 4 [ (gogoproto.jsontag) = "logConfig" ];
}

// LogConfig are the configuration options for structured logger the EVM
message LogConfig {
// disable memory capture
bool disable_memory = 1 [ (gogoproto.jsontag) = "disableMemory" ];
// disable stack capture
bool disable_stack = 2 [ (gogoproto.jsontag) = "disableStack" ];
bool disable_memory = 4 [ (gogoproto.jsontag) = "disableMemory" ];
// disable stack capture
bool disable_stack = 5 [ (gogoproto.jsontag) = "disableStack" ];
// disable storage capture
bool disable_storage = 3 [ (gogoproto.jsontag) = "disableStorage" ];
bool disable_storage = 6 [ (gogoproto.jsontag) = "disableStorage" ];
// disable return data capture
bool disable_return_data = 4 [ (gogoproto.jsontag) = "disableReturnData" ];
bool disable_return_data = 7 [ (gogoproto.jsontag) = "disableReturnData" ];
// print output during capture end
bool debug = 5;
bool debug = 8;
// maximum length of output, but zero means unlimited
int32 limit = 6;
int32 limit = 9;
// Chain overrides, can be used to execute a trace using future fork rules
ChainConfig overrides = 7;
ChainConfig overrides = 10;
}
10 changes: 5 additions & 5 deletions x/evm/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,12 @@ func (k *Keeper) traceTx(c context.Context, coinbase common.Address, signer etht
}
}()
defer cancel()
case traceConfig != nil && traceConfig.LogConfig != nil:
case traceConfig != nil:
logConfig := vm.LogConfig{
DisableMemory: traceConfig.LogConfig.DisableMemory,
Debug: traceConfig.LogConfig.Debug,
DisableStorage: traceConfig.LogConfig.DisableStorage,
DisableStack: traceConfig.LogConfig.DisableStack,
DisableMemory: traceConfig.DisableMemory,
Debug: traceConfig.Debug,
DisableStorage: traceConfig.DisableStorage,
DisableStack: traceConfig.DisableStack,
}
tracer = vm.NewStructLogger(&logConfig)
default:
Expand Down
Loading

0 comments on commit 0463c8b

Please sign in to comment.