-
Notifications
You must be signed in to change notification settings - Fork 51
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
Two simplifications that will be needed to deal with @zoep's issues regarding initcode equivalence #655
base: main
Are you sure you want to change the base?
Conversation
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.
The simplification is sound, but only if writing to a buffer does not overflow.
In that case we have a conflict between the SMT semantics and EVM semantics.
I guess we have agreed to ignore this weird edge case, right?
Also, there seem to be some test failures on windows:
|
Co-authored-by: Martin Blicha <[email protected]>
Co-authored-by: Martin Blicha <[email protected]>
b035e6e
to
bcab59e
Compare
The windows build issue is unrelated, unfortunately. It's occurring here too: https://github.com/ethereum/hevm/actions/runs/13283178489/job/37085893025 which is also unrelated. I'll merge this even if Windows is broken, and I have already asked the Echidna folks to look into the Windows issue. I think it's something small, or at least I'm hoping :) Probably some shell script thing. But I do wanna make sure the other things are OK :) |
Yep, we did :) |
@blishko beware -- I added the same simplification to |
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.
Maybe you should also add a test for the ReadWord
simplification?
Co-authored-by: Martin Blicha <[email protected]>
Co-authored-by: Martin Blicha <[email protected]>
Yes.. sorry. I just added two :) |
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.
LGTM!
Description
One more simplification of
readByte
. This one works ALSO whenCopySlice
is not called with aLit
as asrcOffset
. So it's more general, but cannot simplify some of the things that the more specific one can. It definitely helps in some cases, as per Zoe's issueNote that the SMT overflow vs how the EVM actually works is slightly different on CopySlice. We need this rewrite rule, but it means that in some cases, the SMT will differ from the simplification system, when writing to extremely large offsets -- which always leads to over-gas-limit, so it's not a relevant case. However, the rewrite rule actually triggers, in real-world scenarios, and is useful.
NOTE: this is a cherry-pick from Zoe's changeset so it will apply perfectly when this is merged, appearing as less of a changeset for Zoe's PR.
Checklist