Skip to content

Commit 658bb14

Browse files
committed
chore: bump revm to 29.0.1
1 parent d2f2443 commit 658bb14

File tree

5 files changed

+30
-12
lines changed

5 files changed

+30
-12
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trevm"
3-
version = "0.27.9"
3+
version = "0.29.0"
44
rust-version = "1.83.0"
55
edition = "2021"
66
authors = ["init4"]
@@ -34,7 +34,7 @@ name = "fork_ref_transact"
3434
required-features = ["alloy-db"]
3535

3636
[dependencies]
37-
alloy = { version = "1.0.25", default-features = false, features = [
37+
alloy = { version = "1.0.35", default-features = false, features = [
3838
"consensus",
3939
"rpc-types-mev",
4040
"eips",
@@ -44,8 +44,8 @@ alloy = { version = "1.0.25", default-features = false, features = [
4444
"sol-types",
4545
] }
4646

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

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

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

60-
alloy = { version = "1.0.13", features = ["providers", "transports"] }
60+
alloy = { version = "1.0.35", features = ["providers", "transports"] }
6161

6262
# misc
6363
eyre = "0.6"

src/evm/all_states.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ where
247247
/// Disable an opcode by replacing it with unknown opcode behavior. This is
248248
/// a shortcut for [`Self::override_opcode`] with [`crate::helpers::forbidden`].
249249
pub fn disable_opcode(&mut self, opcode: u8) -> Instruction<Db> {
250-
self.override_opcode(opcode, crate::helpers::forbidden)
250+
self.override_opcode(opcode, Instruction::new(crate::helpers::forbidden, 0))
251251
}
252252

253253
/// Run some closure with an opcode override, then restore the previous
@@ -278,7 +278,7 @@ where
278278
/// Enable the prevrandao opcode. If the prevrandao opcode was not
279279
/// previously disabled or replaced, this will have no effect on behavior.
280280
pub fn enable_prevrandao(&mut self) -> Instruction<Db> {
281-
self.override_opcode(DIFFICULTY, block_info::difficulty)
281+
self.override_opcode(DIFFICULTY, Instruction::new(block_info::difficulty, 2))
282282
}
283283

284284
/// Run some code with the prevrandao opcode disabled, then restore the
@@ -288,7 +288,7 @@ where
288288
where
289289
F: FnOnce(Self) -> Trevm<Db, Insp, NewState>,
290290
{
291-
self.with_opcode_override(DIFFICULTY, crate::helpers::forbidden, f)
291+
self.with_opcode_override(DIFFICULTY, Instruction::new(crate::helpers::forbidden, 0), f)
292292
}
293293

294294
/// Set the precompiles for the EVM. This will replace the current

src/evm/has_tx.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ where
219219
#[cfg(test)]
220220
mod tests {
221221
use crate::{
222+
fillers::DisableChainIdCheck,
222223
test_utils::{test_trevm_with_funds, ALICE, BOB, LOG_DEPLOYED_BYTECODE},
223224
NoopBlock, NoopCfg, TrevmBuilder,
224225
};
@@ -285,8 +286,12 @@ mod tests {
285286
.with_authorization_list(vec![signed_authorization])
286287
.with_input(bytes!("0x7b3ab2d0")); // emitHello()
287288

288-
let (estimation, trevm) =
289-
trevm.fill_cfg(&NoopCfg).fill_block(&NoopBlock).fill_tx(&tx).estimate_gas().unwrap();
289+
let (estimation, trevm) = trevm
290+
.fill_cfg(&DisableChainIdCheck)
291+
.fill_block(&NoopBlock)
292+
.fill_tx(&tx)
293+
.estimate_gas()
294+
.unwrap();
290295

291296
assert!(estimation.is_success());
292297

src/fill/fillers.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ impl Cfg for DisableGasChecks {
3131
}
3232
}
3333

34+
/// A [`Cfg`] that disables the chain ID check, while leaving other [`CfgEnv`]
35+
/// attributes untouched.
36+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
37+
pub struct DisableChainIdCheck;
38+
39+
impl Cfg for DisableChainIdCheck {
40+
fn fill_cfg_env(&self, cfg_env: &mut CfgEnv) {
41+
{
42+
cfg_env.tx_chain_id_check = false;
43+
}
44+
}
45+
}
46+
3447
/// A [`Cfg`] that disables the nonce check, while leaving other [`CfgEnv`]
3548
/// attributes untouched.
3649
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]

src/fill/noop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ impl Block for NoopBlock {
1515
pub struct NoopCfg;
1616

1717
impl Cfg for NoopCfg {
18-
fn fill_cfg_env(&self, _: &mut CfgEnv) {}
18+
fn fill_cfg_env(&self, _env: &mut CfgEnv) {}
1919
}

0 commit comments

Comments
 (0)