-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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/vm, eth: add standard json tracing into filesystem dumps #17914
Merged
Conversation
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
Travis only has a spurious swarm failure |
holiman
force-pushed
the
block_analysis
branch
from
November 28, 2018 20:07
9ecb3c8
to
7aa80b2
Compare
Rebased to fix conflicts. PTAL |
karalabe
force-pushed
the
block_analysis
branch
from
December 10, 2018 10:33
7aa80b2
to
74f59bb
Compare
karalabe
force-pushed
the
block_analysis
branch
from
December 10, 2018 10:33
74f59bb
to
0983d02
Compare
karalabe
changed the title
Better block/tx analysis
core/vm, eth: add standard json tracing into filesystem dumps
Dec 10, 2018
holiman
commented
Dec 10, 2018
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.
LGTM
karalabe
approved these changes
Dec 10, 2018
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.
LGTM too
holiman
added
the
todo-pr-into-docs
This tag means that we should take the PR description and write docmentation based on it
label
Feb 8, 2019
This was referenced Sep 12, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
todo-pr-into-docs
This tag means that we should take the PR description and write docmentation based on it
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.
This PR adds
debug
methods to dump out traces from blocks and/or individual transactions.When @karalabe implemented tracing, the intended usecase was to enable long-running tracers that could stream results back via a subscription channel. However, when investigating e..g consensus errors and/or bad blocks, that format is not very good.
The existing generic tracer framework collects all result data (per block) into a big blob in memory, before streaming. For a large trace, such as the
205K
steps in the recent Ropsten-fork, the full output from the tracer was2.4GB
, which can easily crash many nodes.The existing callTracer does not confirm to
std-json
, which isjsonl
notjson
, to allow for streaming outputop
for string-representation of opcode, instead ofop
/opName
for numeric/string, and other simlar small differences.This PR enables dumping a tx from a given block:
Or all txs from a block:
Files are created in a temp-location, with the naming standard
block_<blockhash:4>-<txindex>-<txhash:4>-<random suffix>
. Each opcode immediately streams to file, with no in-geth buffering aside from whatever buffering the os normally does.It also adds some more info when regenerating historical state, namely, the reexec-number if
required historical state is not avaiable
is encountered, so a user can experiment with increasing that setting. It also prints out the remaining block until it reaches target:There are two new methods added:
Where
options
isOne more thing: it also changes the existing
debug_traceBadBlock
to take a block hash instead of index-of-badblocks. A hash is less ambiguous and more natural choice.