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

Regression: zero-root output when running statetest #1265

Closed
holiman opened this issue Apr 6, 2024 · 3 comments · Fixed by #1347
Closed

Regression: zero-root output when running statetest #1265

holiman opened this issue Apr 6, 2024 · 3 comments · Fixed by #1347
Labels
bug Something isn't working

Comments

@holiman
Copy link

holiman commented Apr 6, 2024

There seems to be a regression, the bug holiman/goevmlab#126 (comment) which was fixed in #1169.

When running a statetest, the stateroot is output twice, but the first is all zeroes:

root@b0da57b9f571:/# /revme statetest --json /fuzztmp/00000000-mixed-0.json 1>/dev/null
{"pc":0,"op":96,"gas":"0x79bcd8","gasCost":"0x3","stack":[],"depth":1,"returnData":"0x","refund":"0x0","memSize":"0","opName":"PUSH1"}
{"pc":2,"op":96,"gas":"0x79bcd5","gasCost":"0x3","stack":["0xa6"],"depth":1,"returnData":"0x","refund":"0x0","memSize":"0","opName":"PUSH1"}
{"pc":4,"op":96,"gas":"0x79bcd2","gasCost":"0x3","stack":["0xa6","0x19"],"depth":1,"returnData":"0x","refund":"0x0","memSize":"0","opName":"PUSH1"}
{"pc":6,"op":96,"gas":"0x79bccf","gasCost":"0x3","stack":["0xa6","0x19","0x7e"],"depth":1,"returnData":"0x","refund":"0x0","memSize":"0","opName":"PUSH1"}
{"pc":8,"op":96,"gas":"0x79bccc","gasCost":"0x3","stack":["0xa6","0x19","0x7e","0x78"],"depth":1,"returnData":"0x","refund":"0x0","memSize":"0","opName":"PUSH1"}
{"pc":10,"op":96,"gas":"0x79bcc9","gasCost":"0x3","stack":["0xa6","0x19","0x7e","0x78","0xa3"],"depth":1,"returnData":"0x","refund":"0x0","memSize":"0","opName":"PUSH1"}
{"pc":12,"op":96,"gas":"0x79bcc6","gasCost":"0x3","stack":["0xa6","0x19","0x7e","0x78","0xa3","0x24"],"depth":1,"returnData":"0x","refund":"0x0","memSize":"0","opName":"PUSH1"}
{"pc":14,"op":162,"gas":"0x79bcc3","gasCost":"0x58e","stack":["0xa6","0x19","0x7e","0x78","0xa3","0x24","0x2f"],"depth":1,"returnData":"0x","refund":"0x0","memSize":"0","opName":"LOG2"}
{"pc":15,"op":143,"gas":"0x79b735","gasCost":"0x3","stack":["0xa6","0x19","0x7e"],"depth":1,"returnData":"0x","refund":"0x0","memSize":"96","opName":"DUP16","error":"StackUnderflow"}
{"stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","output":"0x","gasUsed":"0x7a1200","pass":false,"fork":"Cancun"}
{"stateRoot":"0x867aa4fc1b93afe97a14837ab60a460bc512983a07dc77dcce44ff6c69ce263f","logsRoot":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","output":"0x","gasUsed":8000000,"pass":false,"errorMsg":"logs root mismatch: expected 0x0000000000000000000000000000000000000000000000000000000000000000, got 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","evmResult":"Ok","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","fork":"CANCUN","test":"00000000-mixed-0","d":0,"g":0,"v":0}

I don't know the exact git-commit it was built on, but it was built around 8 hours ago, so presumably af5665176271c87c9ff0600f6d8432d117012345

@rakita rakita added the bug Something isn't working label Apr 6, 2024
@holiman
Copy link
Author

holiman commented Apr 19, 2024

Tested just now, seems to be fixed?

@holiman
Copy link
Author

holiman commented Apr 19, 2024

Tested just now, seems to be fixed?

Nah, my bad, it's still broken. I did, however, git bisect it for you, and a201a2d is the culprit:

user@debian-work:~/workspace/revm$ git bisect good
a201a2d92c4a41f6530fe2b84ec23467255c0636 is the first bad commit
commit a201a2d92c4a41f6530fe2b84ec23467255c0636
Author: A_A <21040751+Otto-AA@users.noreply.github.com>
Date:   Fri Mar 29 20:32:35 2024 +0100

    feat: TracerEip3155 optionally traces memory (#1234)
    
    * feat: TracerEip3155 optionally traces memory
    
    BREAKING CHANGE: the TracerEIP3155 constructor takes an additional
    "include_memory" flag
    
    * perf: use hex::encode_prefixed for TracerEip3155
    
    * refactor: use builder pattern for TracerEip3155
    
    BREAKING CHANGE: update constructor syntax for TracerEip3155
    
    * refactor: use String for TracerEip3155 memory

 bins/revme/src/cmd/statetest/runner.rs |  7 ++-----
 crates/revm/src/inspector/eip3155.rs   | 29 +++++++++++++++++++++++++----
 examples/db_by_ref.rs                  |  2 +-
 examples/generate_block_traces.rs      |  2 +-

Please fix it, it's annoying not being able to fuzz with revm

@rakita
Copy link
Member

rakita commented Apr 21, 2024

@holiman It is now fixed, thank you for finding the bug commit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants