diff --git a/Cargo.toml b/Cargo.toml index fdac468..4b35776 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trevm" -version = "0.29.0" +version = "0.30.0" rust-version = "1.83.0" edition = "2021" authors = ["init4"] @@ -44,8 +44,8 @@ alloy = { version = "1.0.35", default-features = false, features = [ "sol-types", ] } -revm = { version = "29.0.1", default-features = false } -revm-inspectors = { version = "0.30", optional = true } +revm = { version = "30.1.2", default-features = false } +revm-inspectors = { version = "0.31", optional = true } dashmap = { version = "6.1.0", optional = true } tracing = { version = "0.1.41", optional = true } @@ -54,7 +54,7 @@ thiserror = "2.0.11" tokio = { version = "1.44", optional = true } [dev-dependencies] -revm = { version = "29.0.1", features = ["serde-json", "std", "alloydb"] } +revm = { version = "30.1.1", features = ["serde-json", "std", "alloydb"] } trevm = { path = ".", features = ["test-utils"] } alloy = { version = "1.0.35", features = ["providers", "transports"] } diff --git a/src/db/sync/mod.rs b/src/db/sync/mod.rs index 8820900..803adaa 100644 --- a/src/db/sync/mod.rs +++ b/src/db/sync/mod.rs @@ -11,9 +11,9 @@ mod state; pub use state::{Child, ConcurrentState, ConcurrentStateInfo}; use crate::db::StateAcc; +use alloy::primitives::B256; use revm::{ database::{states::bundle_state::BundleRetention, BundleState}, - primitives::B256, DatabaseRef, }; use std::collections::BTreeMap; diff --git a/src/est.rs b/src/est.rs index ac0ec59..f76fa5e 100644 --- a/src/est.rs +++ b/src/est.rs @@ -158,7 +158,7 @@ impl EstimationResult { Self::Revert { limit, reason: output.clone(), gas_used: *gas_used } } ExecutionResult::Halt { reason, gas_used } => { - Self::Halt { limit, reason: *reason, gas_used: *gas_used } + Self::Halt { limit, reason: reason.clone(), gas_used: *gas_used } } } } @@ -245,14 +245,11 @@ impl EstimationResult { } /// Adjust the binary search range based on the estimation outcome. - pub(crate) const fn adjust_binary_search_range( - &self, - range: &mut SearchRange, - ) -> Result<(), Self> { + pub(crate) fn adjust_binary_search_range(&self, range: &mut SearchRange) -> Result<(), Self> { match self { Self::Success { limit, .. } => range.set_max(*limit), Self::Revert { limit, .. } => range.set_min(*limit), - Self::Halt { limit, reason, gas_used } => { + Self::Halt { limit, reason, .. } => { // Both `OutOfGas` and `InvalidEFOpcode` can occur dynamically // if the gas left is too low. Treat this as an out of gas // condition, knowing that the call succeeds with a @@ -263,8 +260,7 @@ impl EstimationResult { if matches!(reason, HaltReason::OutOfGas(_) | HaltReason::InvalidFEOpcode) { range.set_min(*limit); } else { - // NB: can't clone here as this is a const fn. - return Err(Self::Halt { limit: *limit, reason: *reason, gas_used: *gas_used }); + return Err(self.clone()); } } }