-
Notifications
You must be signed in to change notification settings - Fork 55
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
hevm equivalence
reports no discrepancies on two bytecodes that compute different values
#688
Comments
Thanks! Definitely reproducible on
Also reports equivalent. But:
Reports fail. There reason for this is that we compare what would happen when the contract is called. The contract you put forth doesn't return a value. If I add an MSTORE&RETURN to your bytecodes, we get:
The two bytecodes are now:
And
Where all I did was add:
to both. Note that we also distinguish when the return is empty but there is a difference in success/fail:
Where these are respectively:
And:
To be honest, we probably should explain this better in our documentation at hevm.dev. Let me know if the above explains the rationale why we consider the two equivalent. And let me keep this issue open so (1) you can respond, I'm curious what you think, and (2) so I can improve our documentation. |
@msooseth your explanation definitely makes sense to me! Having read it, I am not sure what kind of equivalence I had in mind. It would definitely be great to see an explanation of what it means for two contracts to be equivalent. In addition to the return value or revert cause, I would probably expect equal storage contents on successful return, but it's probably not so easy to verify. |
Actually, storage is also checked, sorry, that's good point I forgot! I'll add that to the docs, too. Sorry about that. |
I am closing, and following through #690 -- I would be very grateful if you could take a peek at that PR and give me your opinion! I wanna make this tool more accessible :) |
Hi! Perhaps I am expecting too much of hevm. I feed it two bytecodes: One computes a value via
SAR
, and another one computes a value viaSDIV
. They do compute slightly different values, buthevm
reports no discrepancies.When I run the two bytecodes on evm.codes, they compute two different values. This behavior seems to be consistent with
bitwise_sar
andsdiv
of EELS.The text was updated successfully, but these errors were encountered: