debug_trace... endpoints improved #1068
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR improves the way of interacting with
debug_trace...
API endpoints of the Geth node. It provides built-in tracers support (https://geth.ethereum.org/docs/developers/evm-tracing/built-in-tracers) which configs and responses can be deserialised now into the C#'s language structures and more advanced tracing configs (blockOverrides and stateOverrides). Also, corresponding integration tests were addedMore specifically, changes introduced by the PR:
BlockOverridesDto
andStateOverrideDto
(representsBlock overrides
andState overrides
(https://geth.ethereum.org/docs/interacting-with-geth/rpc/objects#block-override-set),TraceCallConfigDto
andTraceConfigDto
(representsTraceCallConfig
andTraceConfig
objects https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#tracecallconfig) and other DTOs for block responses and struct logs. So for example user can specify the block and state overrides for simulation using language structuresSendRequestAsync<TOutput>()
method overload with generics forDebugTraceBlock
,DebugTraceBlockByHash
,DebugTraceBlockByNumber
,DebugTraceBlockFromFile
,DebugTraceTransaction
andDebugTraceCall
services. Calling this function will return tracer response deserialised into the specified C# classdebug_traceBadBlock
endpoint supportopcodeTracer (default)
,4byteTracer
,callTracer
,prestateTracer
,noopTracer
,bigram
,evmdis
,opcount
,trigram
,unigram
. Corresponding DTOs for configs and responses for all of them were added. It's also possible to specify a custom code for tracerUsage example:
Running
debug_traceTransaction
withcallTracer
(only top calls, with logs):This will return tracer response deserialised into
CallTracerResponse
objectMore examples you can find in the integration tests