-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Invariant test called twice #6024
Comments
Im seeing this exact issue for a project Ive been working on as well. I basically inspect the state consecutively where there should be no change and for some reason the state gets corrupted similar to what your logs show. |
@Evalir I'm sorry to tag you again, but it's been a week and this impacts our invariant testing severely (cannot proceed). It's great to see other people are experiencing the same thing, although it's hard to reproduce. For this reason, and because we are advancing in our development cycle, we will soon open source our repo so this issue will be made public and it will be easier for you guys to verify what's going on. It's a cross-chain protocol, so there's a lot of fork switching going on |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (e0722a1 2023-10-10T00:28:23.851012000Z)
What command(s) is the bug in?
forge test
Operating System
macOS (Apple Silicon)
Describe the bug
A foundry invariant test assertion reverts and is called twice in a row in a setup with multiple runs and multiple depth. From the sequence printed its not useful to decipher what's going on
foundry.toml looks like this:
The test looks like this:
SuperPositionsSum and VaultShares are set at the end of each function call in our handler in a specific store (
vaultSharesStore
).I can't seem to understand this behaviour, but I noticed that instruction [24210] appears multiple times in the different calls that are successful, but only in the last one (where the call sequence reverts) there is a 2nd instruction [37972] (repeated??)
I noticed as well that the values I am asserting change between these two calls even though nothing happens between them. Is foundry doing something under the hood on these values that is not being logged?
Why are two invariant tests called like that in a row?
The text was updated successfully, but these errors were encountered: