-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eth/tracers: move tracing APIs into eth/tracers #22161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, trace_traceTransaction
sounds weird to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can rename to trace_transaction
as we have their own namespace now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.