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
Bytecode difference caused by SSA transform #14968
Conversation
Are there any tests for non-determinism like running in a loop and checking that each compilation of the same source unit results in the same bytecode? |
What you're describing is fully deterministic already - i.e. the same sources will always compile to the same bytecode - the issue here is of a different sort; we use a ton of associative containers (e.g. a These inconsistencies don't actually change the behavior of contracts - the code will semantically remain the same, but the bytecode in such cases should none the less be identical, especially when it comes to source verification. |
11b27e3
to
b423c2a
Compare
Given how easy it is to inadvertently run into this problem when using |
b423c2a
to
a031490
Compare
a031490
to
972c464
Compare
5148ff3
to
7b86576
Compare
843b813
to
6822901
Compare
test/cmdlineTests/~bytecode_equivalence_with_unused_contracts/test.py
Outdated
Show resolved
Hide resolved
test/cmdlineTests/~bytecode_equivalence_with_unused_contracts/test.py
Outdated
Show resolved
Hide resolved
scripts/common/cmdline_helpers.py
Outdated
via_ir: bool, | ||
optimize: bool = False, | ||
yul_optimizations: Optional[str] = None) -> FileReport: |
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.
Just as a note, so we can remember to eventually refactor this. We could pass a dictionary here like what was done in
def compiler_settings(evm_version: str, via_ir: bool = False, optimizer: bool = False, yul: bool = False) -> dict: |
b4a8906
to
df5229e
Compare
@cameel this should be ready now. |
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.
Looks good in terms of correctness, just needs two style tweaks.
test/cmdlineTests/~bytecode_equivalence_with_unused_contracts/test.py
Outdated
Show resolved
Hide resolved
Changelog Review comments Unique vector Repro test
df5229e
to
7f882ef
Compare
Fixes #14829