eth/tracers: move tracing APIs into eth/tracers#22161
Conversation
fjl
left a comment
There was a problem hiding this comment.
I think we should use the existing EthAPIBackend as the backend object for TracerAPI.
It's almost compatible, just need to add the StateAtBlock and StateAtTransaction methods to it.
The TracerAPI should be renamed to API because it's now in the package "tracers".
cmd, eth: rename eth: remove blank lines eth: fix empty block cmd, eth, internal, les: update for tracers eth/tracers: polish eth, les: update tests eth/tracers: fix rpc namespace and visibility eth/tracers: retrieve the txlookup from the backend eth: updates eth/tracers: updates eth: remove state.Reset
1b4cf42 to
a563f39
Compare
| // Append all the local APIs and return | ||
| return []rpc.API{ | ||
| { | ||
| Namespace: "debug", |
There was a problem hiding this comment.
Will it make sense to rename the namespace to trace?
Though we can't drop existing namespace support for debug_trace* methods easily as some users might use it in their scripts.
There was a problem hiding this comment.
Not sure, trace_traceTransaction sounds weird to me.
There was a problem hiding this comment.
Maybe we can rename to trace_transaction as we have their own namespace now.
There was a problem hiding this comment.
We can't rename these methods without keeping the original ones alive, since they have been around for quite a while.
There was a problem hiding this comment.
I was thinking of having proxy methods of the old ones to the new ones for a while (until next major release?) with a deprecated warning.
There was a problem hiding this comment.
I'm generally in favor of renaming because the debug namespace is quite messy and also includes some dangerous functionality that should never be exposed, such as debug_traceBlockToFile. If we can make a 'safe' subset of tracing APIs, it would be great to have them available in a dedicated namespace.
|
@fjl It's updated. |
fjl
left a comment
There was a problem hiding this comment.
Thanks, this looks great. I'm especially happy to see the added test for tracing.
This moves the tracing RPC API implementation to package eth/tracers. By doing so, package eth no longer depends on tracing and the duktape JS engine. The change also enables tracing using the light client. All tracing methods work with the light client, but it's a lot slower compared to using a full node.
This PR moves the tracing RPC API implementation to package eth/tracers.
By doing so, package eth no longer depends on tracing and the go-duktape JS engine.
The change also enables tracing using the light client. All tracing methods work with the
light client, but it's a lot slower compared to using a full node.