Skip to content

Commit 4251265

Browse files
authored
chore: bump revm to 30 (#128)
1 parent 3033df3 commit 4251265

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trevm"
3-
version = "0.29.0"
3+
version = "0.30.0"
44
rust-version = "1.83.0"
55
edition = "2021"
66
authors = ["init4"]
@@ -44,8 +44,8 @@ alloy = { version = "1.0.35", default-features = false, features = [
4444
"sol-types",
4545
] }
4646

47-
revm = { version = "29.0.1", default-features = false }
48-
revm-inspectors = { version = "0.30", optional = true }
47+
revm = { version = "30.1.2", default-features = false }
48+
revm-inspectors = { version = "0.31", optional = true }
4949

5050
dashmap = { version = "6.1.0", optional = true }
5151
tracing = { version = "0.1.41", optional = true }
@@ -54,7 +54,7 @@ thiserror = "2.0.11"
5454
tokio = { version = "1.44", optional = true }
5555

5656
[dev-dependencies]
57-
revm = { version = "29.0.1", features = ["serde-json", "std", "alloydb"] }
57+
revm = { version = "30.1.1", features = ["serde-json", "std", "alloydb"] }
5858
trevm = { path = ".", features = ["test-utils"] }
5959

6060
alloy = { version = "1.0.35", features = ["providers", "transports"] }

src/db/sync/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ mod state;
1111
pub use state::{Child, ConcurrentState, ConcurrentStateInfo};
1212

1313
use crate::db::StateAcc;
14+
use alloy::primitives::B256;
1415
use revm::{
1516
database::{states::bundle_state::BundleRetention, BundleState},
16-
primitives::B256,
1717
DatabaseRef,
1818
};
1919
use std::collections::BTreeMap;

src/est.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl EstimationResult {
158158
Self::Revert { limit, reason: output.clone(), gas_used: *gas_used }
159159
}
160160
ExecutionResult::Halt { reason, gas_used } => {
161-
Self::Halt { limit, reason: *reason, gas_used: *gas_used }
161+
Self::Halt { limit, reason: reason.clone(), gas_used: *gas_used }
162162
}
163163
}
164164
}
@@ -245,14 +245,11 @@ impl EstimationResult {
245245
}
246246

247247
/// Adjust the binary search range based on the estimation outcome.
248-
pub(crate) const fn adjust_binary_search_range(
249-
&self,
250-
range: &mut SearchRange,
251-
) -> Result<(), Self> {
248+
pub(crate) fn adjust_binary_search_range(&self, range: &mut SearchRange) -> Result<(), Self> {
252249
match self {
253250
Self::Success { limit, .. } => range.set_max(*limit),
254251
Self::Revert { limit, .. } => range.set_min(*limit),
255-
Self::Halt { limit, reason, gas_used } => {
252+
Self::Halt { limit, reason, .. } => {
256253
// Both `OutOfGas` and `InvalidEFOpcode` can occur dynamically
257254
// if the gas left is too low. Treat this as an out of gas
258255
// condition, knowing that the call succeeds with a
@@ -263,8 +260,7 @@ impl EstimationResult {
263260
if matches!(reason, HaltReason::OutOfGas(_) | HaltReason::InvalidFEOpcode) {
264261
range.set_min(*limit);
265262
} else {
266-
// NB: can't clone here as this is a const fn.
267-
return Err(Self::Halt { limit: *limit, reason: *reason, gas_used: *gas_used });
263+
return Err(self.clone());
268264
}
269265
}
270266
}

0 commit comments

Comments
 (0)