Skip to content
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

feat(fw): add pretty printing of vm traces #433

Open
danceratopz opened this issue Feb 9, 2024 · 5 comments
Open

feat(fw): add pretty printing of vm traces #433

danceratopz opened this issue Feb 9, 2024 · 5 comments
Labels
good first issue Good for newcomers scope:fw Scope: Framework (evm|tools|forks|pytest) type:feat type: Feature

Comments

@danceratopz
Copy link
Member

Currently, fill --traces -s does print vm traces to the terminal if a test fails (note -s to prevent pytest from capturing stdout), but they're rather ugly. It'd be nice to have a more compact pretty print of these traces.

For example (assuming the test has been modified to fail upon filling):

fill tests/berlin/eip2930_access_list/ --fork Berlin --evm-dump-dir=/tmp/evm-dump --traces -s

Screenshot:
image

Here's an example of a clean trace representation from retesteth:
image

@danceratopz danceratopz added good first issue Good for newcomers type:feat type: Feature scope:fw Scope: Framework (evm|tools|forks|pytest) labels Feb 9, 2024
@winsvega
Copy link
Collaborator

I think can even optimise it better.

I have 2 options --vmtraceraw is always available. (Unformatted)

@raxhvl
Copy link
Contributor

raxhvl commented Mar 14, 2024

Can we use this package for formatting the debug trace?

@danceratopz
Copy link
Member Author

Can we use this package for formatting the debug trace?

Hi @raxhvl, looks like a nice package. Would you like to pick this up? You may want to wait until #474 is merged, or base your work on that.

@raxhvl
Copy link
Contributor

raxhvl commented Mar 17, 2024

Hi there - I'm picking this up. I'm in touch with @marioevz on #474 progress. Thanks for reviewing the package.

@marioevz
Copy link
Member

Hi @raxhvl thanks! If you check the branch on #474, compile the required geth branch, then inject an error in any test (I've been dropping the gas limit in this test to produce an Out-of-gas error for example), you can see the current output of the relevant traces for the test, which are very bland. If you'd like to give it a go to use rich package to print this a bit better it would be very nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers scope:fw Scope: Framework (evm|tools|forks|pytest) type:feat type: Feature
Projects
None yet
Development

No branches or pull requests

4 participants