-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: collect push bytes from test setup in fuzzer #2929
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.
smol nit
unsure if this is related but this now results in Failing tests:
Encountered 2 failing tests in src/test/StdAssertions.t.sol:StdAssertionsTest
[FAIL. Reason: Too many global rejects] testAssertEq_BytesErr_Pass(bytes,bytes) (runs: 31, μ: 20023, ~: 21439)
[FAIL. Reason: Too many global rejects] testAssertEq_Bytes_Pass(bytes,bytes) (runs: 24, μ: 19965, ~: 20697) when running |
We had this discussion here: #2724 (comment) We decided to revert the |
The Forge Std |
Just merged foundry-rs/forge-std#160 which should prevent foundry CI from failing on those now |
51f034b
to
54c6c04
Compare
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.
Rebased, merging per the forge-std fixes. Flagging for us to keep this PR in mind if people come to us with complaints about the fuzzer error'ing too much.
* fix: collect push bytes from test setup in fuzzer * Update evm/src/fuzz/strategies/state.rs * chore: rustfmt Co-authored-by: Matthias Seitz <[email protected]>
Motivation
There's an old report that immutables were not collected in the fuzzer. Immutables are sections in the bytecode of contracts that are replaced by constant values, so we should be collecting them (since we collect push bytes), but it turns out that we were not collecting push bytes in the initial fuzzer DB (i.e. from the state right after
setUp
).See #1168
Solution
Also collect push bytes after
setUp
. Closes #1168Note: The state dict after
setUp
for the test in #1168 contains about ~120 values. It seems that either one of the tests fail every time (which is what we want), but not super reliably. Increasing the fuzzer runs to 512 makes them both fail reliably, though.