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): call override strategy panic #7469

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Mar 22, 2024

Motivation

Closes #4245

The application panicked (crashed).
Message:  no entry found for key
Location: crates/evm/fuzz/src/strategies/invariants.rs:29

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 7 frames hidden ⋮                               
   8: core::option::expect_failed::hc85eb6037a3050f7
      at <unknown source file>:<unknown line>
   9: <proptest::strategy::map::Map<S,F> as proptest::strategy::traits::ValueTree>::current::h5c49d6f755e96fbf
      at <unknown source file>:<unknown line>
  10: <proptest::strategy::flatten::Flatten<S> as proptest::strategy::traits::Strategy>::new_tree::hd1899ce2fdb532df
      at <unknown source file>:<unknown line>
  11: <proptest::strategy::traits::BoxedStrategyWrapper<T> as proptest::strategy::traits::Strategy>::new_tree::h21d88ddf93eea8c3

Solution

  • check if target address is in list of fuzzed run identified contracts, if it is not then choose a random one
  • updated InvariantReentrancy test to cover panic scenario

@grandizzy grandizzy marked this pull request as ready for review March 22, 2024 10:52
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

that makes sense, thanks!

@mattsse mattsse merged commit 9d2125b into foundry-rs:master Mar 22, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(forge): call_override to have same size as the number of (unsafe) external calls of the sequence
2 participants