-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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: trace without passing ctx #30337
base: master
Are you sure you want to change the base?
Conversation
69d4647
to
ad76d8e
Compare
Hm good insight that context is not widely used. I guess what I like about your idea is that we don't have to call OnBlockStart everywhere, only where there is actually a block (e.g. traceBlock*, but not traceCall). |
This is considered to replace the original method of injecting the
This PR is intended for live tracing(reuse the code in the eth/traces), as live tracing is always running and cannot pass in the context like debug_traceXXX. Therefore, it can only start from the few hooks at OnBlockStart. |
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
2614efd
to
7d35160
Compare
Since the
tracers.Context
is only utilized by the JS tracer and flatcall tracer, and we've previously introduced tracing hooks, I think we can eliminate passing the context directly. If the context is needed, it can be retrieved within the hooks.This change will benefit the live tracer, as it is initialized once, whereas the debug tracer is initialized for each transaction.
The changes: in the updated js tracer,
txHash
andtxIndex
have been introduced in theOnTxStart
andOnTxEnd
hooks. Previously, these variables were introduced immediately after the trace was initialized.@s1na ptal.