From d78276de74c498c46f48389032ddf9f2e3172e6c Mon Sep 17 00:00:00 2001 From: grandizzy Date: Mon, 4 Mar 2024 15:06:06 +0200 Subject: [PATCH] closes #7303 - apply invariant preserve_state setting even when fail_on_revert is false --- crates/config/src/invariant.rs | 3 +-- crates/evm/evm/src/executors/invariant/mod.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/config/src/invariant.rs b/crates/config/src/invariant.rs index d2594c820aab..17994c3e3b30 100644 --- a/crates/config/src/invariant.rs +++ b/crates/config/src/invariant.rs @@ -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, } diff --git a/crates/evm/evm/src/executors/invariant/mod.rs b/crates/evm/evm/src/executors/invariant/mod.rs index 79d055eab8c2..7b87c0f06600 100644 --- a/crates/evm/evm/src/executors/invariant/mod.rs +++ b/crates/evm/evm/src/executors/invariant/mod.rs @@ -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")