execution-spec-tests icon indicating copy to clipboard operation
execution-spec-tests copied to clipboard

feat(fw): add pretty printing of vm traces

Open danceratopz opened this issue 1 year ago • 5 comments

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 avatar Feb 09 '24 13:02 danceratopz

I think can even optimise it better.

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

winsvega avatar Feb 10 '24 09:02 winsvega

Can we use this package for formatting the debug trace?

raxhvl avatar Mar 14 '24 11:03 raxhvl

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.

danceratopz avatar Mar 15 '24 12:03 danceratopz

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

raxhvl avatar Mar 17 '24 11:03 raxhvl

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.

marioevz avatar Mar 18 '24 14:03 marioevz