From ef879007878fb08181e1d8033556f0b65cb78c6a Mon Sep 17 00:00:00 2001 From: julio4 <30329843+julio4@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:38:52 -0500 Subject: [PATCH] chore: remove simulation --- src/payload/checkpoint.rs | 12 --------- src/payload/exec.rs | 53 --------------------------------------- 2 files changed, 65 deletions(-) diff --git a/src/payload/checkpoint.rs b/src/payload/checkpoint.rs index f7430a4..e73278b 100644 --- a/src/payload/checkpoint.rs +++ b/src/payload/checkpoint.rs @@ -195,18 +195,6 @@ impl Checkpoint

{ Ok(self.apply_with(mutation, self.context().clone())) } - /// Executes transaction on top of the current checkpoint. The execution will - /// use the cumulative state of all checkpoints in the current checkpoint - /// history as its state. - pub fn simulate( - &self, - executable: impl IntoExecutable, - ) -> Result, ExecutionError

> { - executable - .try_into_executable()? - .simulate(self.block(), self) - } - /// Creates a new checkpoint on top of the current checkpoint and tags it. /// The execution will use the cumulative state of all checkpoints in the /// current checkpoint history as its state. diff --git a/src/payload/exec.rs b/src/payload/exec.rs index eca3270..f86bb26 100644 --- a/src/payload/exec.rs +++ b/src/payload/exec.rs @@ -262,59 +262,6 @@ impl Executable

{ state, }) } - - /// Executes this executable as a single unit of state transition and returns - /// the outcome of the execution. If the - /// executable is invalid, no execution result will be produced. - /// - /// For details on what makes an executable invalid see the - /// [`simulate_transaction`] and [`simulate_bundle`] methods. - pub fn simulate( - self, - block: &BlockContext

, - db: &DB, - ) -> Result, ExecutionError

> - where - DB: DatabaseRef + Debug, - { - match self { - Self::Bundle(_) => unreachable!("asd"), - Self::Transaction(tx) => Self::simulate_transaction(tx, block, db) - .map_err(ExecutionError::InvalidTransaction), - } - } - - /// Executes a single transaction and returns the outcome of the execution. - /// - /// Notes: - /// - Transactions that are invalid and cause EVM failures will not produce an - /// execution result. - /// - /// - Transactions that fail gracefully (revert or halt) will produce an - /// execution result and state changes. It is up to higher levels of the - /// system to decide what to do with such transactions, e.g., whether to - /// remove them from the payload or not (see [`RevertProtection`]). - fn simulate_transaction( - tx: Recovered>, - block: &BlockContext

, - db: &DB, - ) -> Result, types::EvmError> - where - DB: DatabaseRef + Debug, - { - let mut state = State::builder().with_database(WrapDatabaseRef(db)).build(); - - let result = block - .evm_config() - .evm_with_env(&mut state, block.evm_env().clone()) - .transact(&tx)?; - - Ok(ExecutionResult { - source: Executable::Transaction(tx), - results: vec![result.result], - state: BundleState::default(), - }) - } } impl Executable

{