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: avoid returning None for library addresses during fuzzing #9771

Merged
merged 8 commits into from
Jan 29, 2025

Conversation

nbaztec
Copy link
Contributor

@nbaztec nbaztec commented Jan 28, 2025

Motivation

Fixes #9764

Solution

Invoke internal fuzzer instead of stateful fuzzer to obtain a random address in lieu of library address.
Map library address to a random non-library deterministic address.

@grandizzy grandizzy marked this pull request as draft January 29, 2025 09:51
@nbaztec nbaztec marked this pull request as ready for review January 29, 2025 10:36
Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thank you! have one nit re early return if not a deployed lib. @DaniPopes @klkvr do you have any concern re this approach?

crates/evm/fuzz/src/strategies/param.rs Show resolved Hide resolved
@grandizzy grandizzy self-requested a review January 29, 2025 12:15
@grandizzy grandizzy enabled auto-merge (squash) January 29, 2025 12:15
@grandizzy grandizzy merged commit 9f11e6d into foundry-rs:master Jan 29, 2025
22 checks passed
@nbaztec nbaztec deleted the fix-fuzz-panic branch January 29, 2025 12:33
@grandizzy grandizzy added T-bug Type: bug C-forge Command: forge labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge T-bug Type: bug
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

invariant tests can panic or return incorrect information due to state change during test execution
3 participants