Skip to content

Commit c2de140

Browse files
authored
chore: bump revm (#5698)
* chore: bump revm * chore: fix breaking changes * feat: add coverage test * chore: clippy * chore: switch revm to latest main * Revert "Revert "feat(evm): Use latest revm main commit (#5669)" (#5695)" This reverts commit f8a07c3. * re-add coverage test * fmt * chore: clippy * chore: fix test * chore: fix test * chore: remove unused/unnecessary stuff
1 parent 5816d52 commit c2de140

File tree

25 files changed

+139
-149
lines changed

25 files changed

+139
-149
lines changed

Cargo.lock

Lines changed: 60 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ solang-parser = "=0.3.1"
154154
#ethers-solc = { path = "../ethers-rs/ethers-solc" }
155155

156156
[patch.crates-io]
157-
revm = { git = "https://github.com/bluealloy/revm/", branch = "release/v25" }
157+
revm = { git = "https://github.com/bluealloy/revm/", rev = "6b55b9c0ab264c000e087c2f54f2d8dc24b869aa" }

crates/anvil/src/config.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -781,18 +781,19 @@ impl NodeConfig {
781781
/// *Note*: only memory based backend for now
782782
pub(crate) async fn setup(&mut self) -> mem::Backend {
783783
// configure the revm environment
784+
785+
let mut cfg = CfgEnv::default();
786+
cfg.spec_id = self.get_hardfork().into();
787+
cfg.chain_id = rU256::from(self.get_chain_id());
788+
cfg.limit_contract_code_size = self.code_size_limit;
789+
// EIP-3607 rejects transactions from senders with deployed code.
790+
// If EIP-3607 is enabled it can cause issues during fuzz/invariant tests if the
791+
// caller is a contract. So we disable the check by default.
792+
cfg.disable_eip3607 = true;
793+
cfg.disable_block_gas_limit = self.disable_block_gas_limit;
794+
784795
let mut env = revm::primitives::Env {
785-
cfg: CfgEnv {
786-
spec_id: self.get_hardfork().into(),
787-
chain_id: rU256::from(self.get_chain_id()),
788-
limit_contract_code_size: self.code_size_limit,
789-
// EIP-3607 rejects transactions from senders with deployed code.
790-
// If EIP-3607 is enabled it can cause issues during fuzz/invariant tests if the
791-
// caller is a contract. So we disable the check by default.
792-
disable_eip3607: true,
793-
disable_block_gas_limit: self.disable_block_gas_limit,
794-
..Default::default()
795-
},
796+
cfg,
796797
block: BlockEnv {
797798
gas_limit: self.gas_limit.into(),
798799
basefee: self.get_base_fee().into(),

crates/anvil/src/eth/backend/mem/inspector.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,17 @@ impl<DB: Database> revm::Inspector<DB> for Inspector {
5353
&mut self,
5454
interp: &mut Interpreter,
5555
data: &mut EVMData<'_, DB>,
56-
is_static: bool,
5756
) -> InstructionResult {
5857
call_inspectors!([&mut self.tracer], |inspector| {
59-
inspector.initialize_interp(interp, data, is_static);
58+
inspector.initialize_interp(interp, data);
6059
});
6160
InstructionResult::Continue
6261
}
6362

6463
#[inline]
65-
fn step(
66-
&mut self,
67-
interp: &mut Interpreter,
68-
data: &mut EVMData<'_, DB>,
69-
is_static: bool,
70-
) -> InstructionResult {
64+
fn step(&mut self, interp: &mut Interpreter, data: &mut EVMData<'_, DB>) -> InstructionResult {
7165
call_inspectors!([&mut self.tracer], |inspector| {
72-
inspector.step(interp, data, is_static);
66+
inspector.step(interp, data);
7367
});
7468
InstructionResult::Continue
7569
}
@@ -92,11 +86,10 @@ impl<DB: Database> revm::Inspector<DB> for Inspector {
9286
&mut self,
9387
interp: &mut Interpreter,
9488
data: &mut EVMData<'_, DB>,
95-
is_static: bool,
9689
eval: InstructionResult,
9790
) -> InstructionResult {
9891
call_inspectors!([&mut self.tracer], |inspector| {
99-
inspector.step_end(interp, data, is_static, eval);
92+
inspector.step_end(interp, data, eval);
10093
});
10194
eval
10295
}
@@ -106,10 +99,9 @@ impl<DB: Database> revm::Inspector<DB> for Inspector {
10699
&mut self,
107100
data: &mut EVMData<'_, DB>,
108101
call: &mut CallInputs,
109-
is_static: bool,
110102
) -> (InstructionResult, Gas, Bytes) {
111103
call_inspectors!([&mut self.tracer, Some(&mut self.log_collector)], |inspector| {
112-
inspector.call(data, call, is_static);
104+
inspector.call(data, call);
113105
});
114106

115107
(InstructionResult::Continue, Gas::new(call.gas_limit), Bytes::new())
@@ -123,10 +115,9 @@ impl<DB: Database> revm::Inspector<DB> for Inspector {
123115
remaining_gas: Gas,
124116
ret: InstructionResult,
125117
out: Bytes,
126-
is_static: bool,
127118
) -> (InstructionResult, Gas, Bytes) {
128119
call_inspectors!([&mut self.tracer], |inspector| {
129-
inspector.call_end(data, inputs, remaining_gas, ret, out.clone(), is_static);
120+
inspector.call_end(data, inputs, remaining_gas, ret, out.clone());
130121
});
131122
(ret, remaining_gas, out)
132123
}

0 commit comments

Comments
 (0)