-
Notifications
You must be signed in to change notification settings - Fork 834
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
evmtool
Returns Long Null String in JSON error
Field When Executing REVERT
#7608
Comments
@siladu please assign this issue to me |
Geth is not conforming to https://eips.ethereum.org/EIPS/eip-3155 - which is the spec the standard trace is following. The optional field "error" should contain the revert reason, not text stating a revert occured. Or the field should not be present in Geth as the field is optional. |
Thanks for your reply, @shemnon. $ ./evm --code 7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60005260205ffd --json --nomemory=false run
{"pc":0,"op":127,"gas":"0x2540be400","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH32"}
{"pc":33,"op":96,"gas":"0x2540be3fd","gasCost":"0x3","memSize":0,"stack":["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":35,"op":82,"gas":"0x2540be3fa","gasCost":"0x6","memSize":0,"stack":["0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","0x0"],"depth":1,"refund":0,"opName":"MSTORE"}
{"pc":36,"op":96,"gas":"0x2540be3f4","gasCost":"0x3","memory":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","memSize":32,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":38,"op":95,"gas":"0x2540be3f1","gasCost":"0x2","memory":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","memSize":32,"stack":["0x20"],"depth":1,"refund":0,"opName":"PUSH0"}
{"pc":39,"op":253,"gas":"0x2540be3ef","gasCost":"0x0","memory":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","memSize":32,"stack":["0x20","0x0"],"depth":1,"refund":0,"opName":"REVERT"}
{"pc":39,"op":253,"gas":"0x2540be3ef","gasCost":"0x0","memory":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","memSize":32,"stack":[],"depth":1,"refund":0,"opName":"REVERT","error":"execution reverted"}
{"output":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","gasUsed":"0x11","error":"execution reverted"} However, ./ethereum/evmtool/build/install/evmtool/bin/evmtool --code 3d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60005260205ffd --json
{"pc":0,"op":61,"gas":"0x2540be400","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"RETURNDATASIZE"}
{"pc":1,"op":127,"gas":"0x2540be3fe","gasCost":"0x3","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH32"}
{"pc":34,"op":96,"gas":"0x2540be3fb","gasCost":"0x3","memSize":0,"stack":["0x0","0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":36,"op":82,"gas":"0x2540be3f8","gasCost":"0x6","memSize":0,"stack":["0x0","0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","0x0"],"depth":1,"refund":0,"opName":"MSTORE"}
{"pc":37,"op":96,"gas":"0x2540be3f2","gasCost":"0x3","memSize":32,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":39,"op":95,"gas":"0x2540be3ef","gasCost":"0x2","memSize":32,"stack":["0x0","0x20"],"depth":1,"refund":0,"opName":"PUSH0"}
{"pc":40,"op":253,"gas":"0x2540be3ed","gasCost":"0x0","memSize":32,"stack":["0x0","0x20","0x0"],"depth":1,"refund":0,"opName":"REVERT","error":"��������������������������������"}
��������������������������������
{"stateRoot":"0xd77d59d1544f33b6d97376fcbb5c0f052162dcb00f05d71e383bf68e16f64718","output":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","gasUsed":"0x13","pass":true,"fork":"Cancun","timens":5301517,"time":5301} I checked with 00003f0 5245 2254 222c 7265 6f72 2272 223a bfef
0000400 efbf bfbf bfef efbf bfbf bfef efbf bfbf
0000410 bfef efbf bfbf bfef efbf bfbf bfef efbf
0000420 bfbf bfef efbf bfbf bfef efbf bfbf bfef
0000430 efbf bfbf bfef efbf bfbf bfef efbf bfbf
0000440 bfef efbf bfbf bfef efbf bfbf bfef efbf
0000450 bfbf bfef efbf bfbf bfef efbf bfbf 7d22
0000460 ef0a bdbf bfef efbd bdbf bfef efbd bdbf
0000470 bfef efbd bdbf bfef efbd bdbf bfef efbd
0000480 bdbf bfef efbd bdbf bfef efbd bdbf bfef
0000490 efbd bdbf bfef efbd bdbf bfef efbd bdbf
00004a0 bfef efbd bdbf bfef efbd bdbf bfef efbd
00004b0 bdbf bfef efbd bdbf bfef efbd bdbf bfef
00004c0 0abd 227b 7473 7461 5265 6f6f 2274 223a Thanks for your patience! |
Yea, besu needs to make it's reverts hex encoded. |
Description
Hello developers!
I'm doing fuzzing on EVM implementations, and I'm using
besu/evm-tool
for testing. I found a log error that when executing the opcode REVERT(0XFD), thegetRevertReason()
ofbesu/evm-tool
will return a long null string in theerror
field of json when no revert reason is available, such as\u0000\u0000
.Steps to Reproduce
besu/evm-tool
(6ed1db3). I buildevmtool
with:Expected behavior: If no Revert reason is available, no
error
field is needed.Actual behavior:
evmtool
will output meaningless\u0000
s.Frequency: Always.
Logs (if a bug)
This is a reference result from
geth/evm
:Versions (Add all that apply)
Thanks for your time!
The text was updated successfully, but these errors were encountered: