-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
core/tracing: register live tracer APIs #30308
Open
jsvisa
wants to merge
24
commits into
ethereum:master
Choose a base branch
from
jsvisa:lazy-init-tracer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
3a9b93e
core: bc.logger is duplicate with bc.vmconfig.tracer, use function in…
jsvisa 770ac7e
core: set logger after inited
jsvisa 5c88fb1
cmd: set tracing logger after blockchain inited
jsvisa a2360d6
eth: set live tracer after inited
jsvisa d75c962
cmd,eth: register live tracer with Backend interface
jsvisa f76f25f
fix test
jsvisa 4881b88
eth/tracers: live tracer return apis
jsvisa ecc2a37
cmd: register live tracer apis
jsvisa e819b13
Revert "cmd: register live tracer apis"
jsvisa efe8364
Revert "eth/tracers: live tracer return apis"
jsvisa 560f2dc
Revert "fix test"
jsvisa 61ac985
Revert "cmd,eth: register live tracer with Backend interface"
jsvisa 0daacd3
Revert "eth: set live tracer after inited"
jsvisa 7eec558
Revert "cmd: set tracing logger after blockchain inited"
jsvisa 0f9fe5f
Revert "core: set logger after inited"
jsvisa efbdfbb
eth,cmd: set tracer's backend after eth initalized
jsvisa 561c43d
eth/tracers: pass stack into live tracer
jsvisa 9ae1444
pass eth.Backend into live tracer
jsvisa 2f621cb
rm tracing.Backend
jsvisa 2cdead6
Allow adding console extensions
s1na 5be4b07
Merge branch 'lazy-init-tracer' of github.com:jsvisa/go-ethereum into…
s1na 8a92d5a
resolve merge conflict
s1na b54e788
move live constructor to core/tracing
s1na 3738a2f
update changelog
s1na File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
This
GetTransaction
method is not great for several reasons. First, it requires us to have an index of txhash -> tx, which is strictly optional. The index we have is not complete, we only keep a limited horizon worth of blocks in it. The indexing is also async with block execution and so it may not lead to a repeatable tracing result.Another problem is the amount of return values. A signature with this number of return values implies there may be more values returned in the future. If we wanted to change this, it would break the interface. So we need to either define a new struct which is to be returned by this method, or break it up into multiple methods.
I also wonder why a tracer would need to query transactions by hash. I think it's a niche use case and we might be better off not allowing it.
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.
This method will be used for the
trace_transaction
RPC, ref https://github.com/ethereum/go-ethereum/blob/c8dfa31422/eth/tracers/live/live_api_trace.go#L93-L116There 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 a tracer will almost never need this in and out of itself. Only in the case where the tracer is exposing an API. Which makes me think if live tracers exposing an API is a good abstraction. It is easy to abuse the live tracing interface to expose an API that doesn't need tracing hooks at all. I wonder if we should introduce plugins that can also register live tracers and/or APIs instead.
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.
agree with it, plugins will be more flexible and useful for different use cases.