-
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: state appears to be shared between tests when linked libraries are used #8639
Comments
@grandizzy I wonder if the dictionary is unique per test contract and not |
@mattsse I don't think so because It seems likely the issue is actually related to library deployments and linking: ethereum-optimism/optimism#11426 (comment). Once I remove all public lib methods in ethereum-optimism/optimism#11426, the test passes |
@mattsse I actually think there's a bug introduced with #8497 Le: actually |
@mattsse I updated my above comment, but have confirmed the cause of the bug was library linking: once we remove all public methods from libs the issue goes away |
Since #8034 when running test suites requiring library linking, forge predeploys all libraries which are required by at least one test contract and reuses resulted state. This likely causes some of those libraries being used as fuzz dictionary values, which could've resulted in this failure |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (1197fbe 2024-08-09T00:25:08.996768000Z)
What command(s) is the bug in?
forge test
Operating System
None
Describe the bug
just test
, and you'll noticetestDebug
fails. That is hardcoded data from a failed CI runforge test --mt testDebug -vvv
. It will pass. If you run the full file containing that test it will also still pass.ForgeArtifacts
. Based on the hardcoded calldata intestDebug
, we can see that address is0x5F65cD7D792E9746EF82929D60de9a1C526f93A5
.So what appears to be happening here is that when the full suite is run, contracts deployed from another test (1) leak into the fuzzer dictionary of this test, and (2) the state leaks into this test as well.
The text was updated successfully, but these errors were encountered: