rpc, evm: debug_traceTransaction endpoint (#506)

* fix typo

* Added tracers package to debug API

* Add GetTransactionByHash function to backend package

* first version

* traceTransaction first version

* clean PR

* revert debug changes

* Update proto/ethermint/evm/v1/query.proto

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* remove unnecesary panic

* remove internal debug api

* trace transaction javascript tracer

* add support for custom logConfig

* added comment

* traceTransactions tests

* fix linter

* remove unused

* add comments to traceConfig

* update dependencies

* updated endpoints md

* Apply suggestions from code review

* Update x/evm/keeper/grpc_query.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update x/evm/keeper/grpc_query.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
crypto-facs
2021-09-04 20:33:06 +00:00
committed by GitHub
co-authored by Federico Kunze Küllmer
parent 6794daf014
commit c7554e96aa
22 changed files with 2198 additions and 285 deletions
+30
View File
@@ -196,4 +196,34 @@ message AccessTuple {
string address = 1;
// hex formatted hashes of the storage keys
repeated string storage_keys = 2 [ (gogoproto.jsontag) = "storageKeys" ];
}
// TraceConfig holds extra parameters to trace functions.
message TraceConfig {
// custom javascript tracer
string tracer = 1;
// overrides the default timeout of 5 seconds for JavaScript-based tracing calls
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" ];
// disable storage capture
bool disable_storage = 3 [ (gogoproto.jsontag) = "disableStorage" ];
// disable return data capture
bool disable_return_data = 4 [ (gogoproto.jsontag) = "disableReturnData" ];
// print output during capture end
bool debug = 5;
// maximum length of output, but zero means unlimited
int32 limit = 6;
// Chain overrides, can be used to execute a trace using future fork rules
ChainConfig overrides = 7;
}
+21
View File
@@ -77,6 +77,11 @@ service Query {
rpc EstimateGas(EthCallRequest) returns (EstimateGasResponse) {
option (google.api.http).get = "/ethermint/evm/v1/estimate_gas";
}
// TraceTx implements the `debug_traceTransaction` rpc api
rpc TraceTx(QueryTraceTxRequest) returns (QueryTraceTxResponse) {
option (google.api.http).get = "/ethermint/evm/v1/trace_tx";
}
}
// QueryAccountRequest is the request type for the Query/Account RPC method.
@@ -278,3 +283,19 @@ message EstimateGasResponse {
// the estimated gas
uint64 gas = 1;
}
// QueryTraceTxRequest defines TraceTx request
message QueryTraceTxRequest {
// msgEthereumTx for the requested transaction
MsgEthereumTx msg = 1;
// transaction index
uint32 tx_index = 2;
// TraceConfig holds extra parameters to trace functions.
TraceConfig trace_config = 3;
}
// QueryTraceTxResponse defines TraceTx response
message QueryTraceTxResponse {
// response serialized in bytes
bytes data = 1;
}