-
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
bug: fuzzer dict does not contain immutables #1168
Comments
Here is a gist with the outputs from running I'm assuming rows with
In the 1000 run example:
I have not repeated this analysis multiple times to confirm how consistent these fuzzer state/calldata values are |
I don't think we handle immutables. How is the value of
I'm not sure how we would handle immutables tbh Edit: Took the liberty of editing the issue title to reflect that this is (most likely) an issue with immutables not being in the fuzz dict, not that the fuzz dict is broken in general |
So from the debugger I've confirmed
The above results in that gist are actually showing the opposite. With 1000 fuzz runs we successfully found the failure in I just ran the tests using the default 256 runs 10 times. Because the state space is so small here I'd expect both to tests to fail almost always (to clarify, we are looking for failures here). However, in practice |
That's really weird and should not be the case at all. I'll have to investigate, but if you want to debug further using For building the initial state from DB (slots, push bytes etc.): For lifting state from calls: Edit: Looking over your trace again, we select |
Great, thanks! I'll try to take a look this weekend / early next week if you don't beat me to it 🙂 Am I interpreting that trace correctly in that |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (233ab70 2022-04-01T00:51:18.292928+00:00)
What command(s) is the bug in?
forge test
Operating System
macOS (amd)
Describe the bug
Below is a contract and test that have very little state, so you'd expect both tests to fail relatively quickly because the fuzzer should try using each owner address as input. However, this does not happen, and most of the time these tests pass, whether I use 100 or 100k fuzz runs. I have not yet investigated this, but potential causes:
The text was updated successfully, but these errors were encountered: