-
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
eth/tracers: native prestate tracer #24268
Conversation
I came across a difference between the native and JS tracers when it comes to recipient, as in https://goerli.etherscan.io/tx/0x330ed9ccffff3530ed4148bf8ff017d6ac04891d7df17c677a3d2d95cf2150e7. JS tracer says |
Co-authored-by: Martin Holst Swende <martin@swende.se>
Yep, makes sense. Should be a fairly common occurrence, e.g. if someone swaps a token to |
Still marked as draft -- is that correct? |
I was just waiting to be able to test it on some mainnet blocks. By now I've compared the native output against JS for 100+ mainnet blocks and they match. Taking it out of draft now. Here's a comparison of time (tracing done on a live node):
Also this PR has now fixes for 2 issues in the JS prestate tracer:
|
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.
Awesome, LGTM!
I noticed I could improve the benchmark's accuracy by changing up the order of calling the tracers. So what I did this time is first trace native, then JS, then native again just to make sure caching is not at play. It's a live node so there are some jitters. Seems like mostly the gains are there, maybe in a few cases a bit less:
|
* eth/tracers: add initial native prestate tracer * fix balance hex * handle prestate for tx from and to * drop created contract from prestate * fix sender balance * use switch instead Co-authored-by: Martin Holst Swende <martin@swende.se> * minor fix * lookup create2 account * mv code around a bit * check stackLen for create2 * fix transfer tx for js prestate tracer * fix create2 addr * track extcodehash in js prestate tracer Co-authored-by: Martin Holst Swende <martin@swende.se>
* eth/tracers: add initial native prestate tracer * fix balance hex * handle prestate for tx from and to * drop created contract from prestate * fix sender balance * use switch instead Co-authored-by: Martin Holst Swende <martin@swende.se> * minor fix * lookup create2 account * mv code around a bit * check stackLen for create2 * fix transfer tx for js prestate tracer * fix create2 addr * track extcodehash in js prestate tracer Co-authored-by: Martin Holst Swende <martin@swende.se>
Some data points from a live node. One native measurement, then JS, then native again to rule out caching etc.