Skip to content
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(invariant): do not commit state if assume returns #9062

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Oct 8, 2024

Motivation

Closes #9054

  • atm in invariant tests we're committing the state of fuzzed selector, regardless it is a magic assume result
  • assume rejections should discard the current fuzzed input and increment rejection counter but without modifying state (similar with a call that doesn't happen). Further more the assume input is popped from call sequence, so won't be available in a failed call sequence (still could change state)

Solution

  • do not commit state if call result is MAGIC_ASSUME

@grandizzy grandizzy marked this pull request as ready for review October 8, 2024 09:47
@grandizzy grandizzy merged commit a17869a into foundry-rs:master Oct 8, 2024
21 checks passed
@grandizzy grandizzy deleted the issue-9054 branch October 8, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

bug(invariant): state is committed when vm.assume reverts
2 participants