Skip to content

Commit

Permalink
closes #7303 - apply invariant preserve_state setting even when fail_…
Browse files Browse the repository at this point in the history
…on_revert is false
  • Loading branch information
grandizzy committed Mar 4, 2024
1 parent c24933d commit d78276d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions crates/config/src/invariant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ pub struct InvariantConfig {
pub shrink_run_limit: usize,
/// If set to true then VM state is committed and available for next call
/// Useful for handlers that use cheatcodes as roll or warp
/// Applies only when `fail_on_revert` set to true. Use it with caution, introduces performance
/// penalty.
/// Use it with caution, introduces performance penalty.
pub preserve_state: bool,
}

Expand Down
2 changes: 1 addition & 1 deletion crates/evm/evm/src/executors/invariant/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl<'a> InvariantExecutor<'a> {
let (sender, (address, calldata)) = inputs.last().expect("no input generated");

// Executes the call from the randomly generated sequence.
let call_result = if self.config.fail_on_revert && self.config.preserve_state {
let call_result = if self.config.preserve_state {
executor
.call_raw_committing(*sender, *address, calldata.clone(), U256::ZERO)
.expect("could not make raw evm call")
Expand Down

0 comments on commit d78276d

Please sign in to comment.