Skip to content

Commit f543e6e

Browse files
chore(deps): bump to revm 28 (#11217)
* bump revm to 24.0.0 * fix clippy * bump to alloy 1.0.7 * update revm, attempt to fix #11213 * bump incl fix for build issue: bluealloy/revm#2852 * add test to assert segfault no longer occurs * note ticket * bump revm to 28 * bump revm related deps * bump rev alloy-evm clippy * start fixing clippy, quite a few changes :( * fix breaking changes introduced in revm 28 * fix merge conflict * bump foundry-fork-db to 0.17 * fix expected test serialization result change * remove workaround, nulled instruction pointer is now handled gracefully in revm --------- Co-authored-by: grandizzy <[email protected]>
1 parent 2347fc4 commit f543e6e

File tree

14 files changed

+97
-99
lines changed

14 files changed

+97
-99
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ foundry-linking = { path = "crates/linking" }
205205
# solc & compilation utilities
206206
foundry-block-explorers = { version = "0.20.0", default-features = false }
207207
foundry-compilers = { version = "0.18.2", default-features = false }
208-
foundry-fork-db = "0.16"
208+
foundry-fork-db = "0.17"
209209
solang-parser = { version = "=0.3.9", package = "foundry-solang-parser" }
210210
solar-ast = { version = "=0.1.5", default-features = false }
211211
solar-parse = { version = "=0.1.5", default-features = false }
@@ -262,13 +262,13 @@ op-alloy-rpc-types = "0.18.13"
262262
op-alloy-flz = "0.13.1"
263263

264264
## revm
265-
revm = { version = "27.1.0", default-features = false }
266-
revm-inspectors = { version = "0.27.1", features = ["serde"] }
267-
op-revm = { version = "8.1.0", default-features = false }
265+
revm = { version = "28.0.0", default-features = false }
266+
revm-inspectors = { version = "0.28.0", features = ["serde"] }
267+
op-revm = { version = "9.0.1", default-features = false }
268268

269269
## alloy-evm
270-
alloy-evm = "0.16.0"
271-
alloy-op-evm = "0.16.0"
270+
alloy-evm = "0.18.3"
271+
alloy-op-evm = "0.18.3"
272272

273273
## cli
274274
anstream = "0.6"
@@ -401,14 +401,14 @@ idna_adapter = "=1.1.0"
401401
# alloy-op-evm = { git = "https://github.com/alloy-rs/evm.git", rev = "7762adc" }
402402

403403
## revm
404-
revm = { git = "https://github.com/bluealloy/revm.git", rev = "d9cda3a" }
405-
op-revm = { git = "https://github.com/bluealloy/revm.git", rev = "d9cda3a" }
404+
# revm = { git = "https://github.com/bluealloy/revm.git", rev = "d9cda3a" }
405+
# op-revm = { git = "https://github.com/bluealloy/revm.git", rev = "d9cda3a" }
406406
# revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors.git", rev = "956bc98" }
407407

408408
## foundry
409409
# foundry-block-explorers = { git = "https://github.com/foundry-rs/block-explorers.git", rev = "e09cb89" }
410410
# foundry-compilers = { git = "https://github.com/foundry-rs/compilers.git", rev = "e4a9b04" }
411-
# foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db", rev = "4ed9afb" }
411+
# foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db", rev = "50683eb" }
412412

413413
## solar
414414
# solar-ast = { git = "https://github.com/paradigmxyz/solar.git", branch = "main" }

crates/anvil/tests/it/state.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,7 @@ async fn test_backward_compatibility_state_dump_deserialization_v1_2() {
669669
"gas_limit": 143385,
670670
"status": "Return",
671671
"steps": [],
672-
"decoded": {
673-
"label": null,
674-
"return_data": null,
675-
"call_data": null
676-
}
672+
"decoded": null
677673
},
678674
"logs": [],
679675
"ordering": []

crates/cheatcodes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl CheatsCtxt<'_, '_, '_, '_> {
171171

172172
#[inline]
173173
pub(crate) fn is_precompile(&self, address: &Address) -> bool {
174-
self.ecx.journaled_state.inner.precompiles.contains(address)
174+
self.ecx.journaled_state.warm_addresses.precompiles().contains(address)
175175
}
176176
}
177177

crates/evm/core/src/backend/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,9 @@ impl BackendInner {
18331833
journal_inner.set_spec_id(self.spec_id);
18341834
journal_inner
18351835
};
1836-
journal.precompiles.extend(self.precompiles().addresses().copied());
1836+
journal
1837+
.warm_addresses
1838+
.set_precompile_addresses(self.precompiles().addresses().copied().collect());
18371839
journal
18381840
}
18391841
}

crates/evm/coverage/src/inspector.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ impl LineCoverageCollector {
8989
/// tx) then the hash is calculated from the bytecode.
9090
#[inline]
9191
fn get_or_insert_contract_hash(interpreter: &mut Interpreter) -> B256 {
92-
// TODO: use just `get_or_calculate_hash`
9392
interpreter
9493
.bytecode
9594
.hash()
9695
.filter(|h| !h.is_zero())
97-
.unwrap_or_else(|| interpreter.bytecode.regenerate_hash())
96+
.unwrap_or_else(|| interpreter.bytecode.get_or_calculate_hash())
9897
}

crates/evm/evm/src/inspectors/revert_diagnostic.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ where
208208

209209
/// Handles `REVERT` and `EXTCODESIZE` opcodes for diagnostics.
210210
fn step(&mut self, interp: &mut Interpreter, ctx: &mut CTX) {
211-
// Check if an action has already been set (which would null the instruction pointer)
212-
if interp.bytecode.action.is_some() {
213-
return;
214-
}
215-
216211
match interp.bytecode.opcode() {
217212
opcode::REVERT => self.handle_revert(interp, ctx),
218213
opcode::EXTCODESIZE => self.handle_extcodesize(interp, ctx),

crates/evm/evm/src/inspectors/stack.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ impl InspectorStackRefMut<'_> {
652652

653653
for (addr, acc_mut) in &mut state {
654654
// mark all accounts cold, besides preloaded addresses
655-
if !journal.warm_preloaded_addresses.contains(addr) {
655+
if journal.warm_addresses.is_cold(addr) {
656656
acc_mut.mark_cold();
657657
}
658658

@@ -958,7 +958,7 @@ impl Inspector<EthEvmContext<&mut dyn DatabaseExt>> for InspectorStackRefMut<'_>
958958
}
959959
// Mark accounts and storage cold before STATICCALLs
960960
CallScheme::StaticCall => {
961-
let JournaledState { state, warm_preloaded_addresses, .. } =
961+
let JournaledState { state, warm_addresses, .. } =
962962
&mut ecx.journaled_state.inner;
963963
for (addr, acc_mut) in state {
964964
// Do not mark accounts and storage cold accounts with arbitrary storage.
@@ -968,7 +968,7 @@ impl Inspector<EthEvmContext<&mut dyn DatabaseExt>> for InspectorStackRefMut<'_>
968968
continue;
969969
}
970970

971-
if !warm_preloaded_addresses.contains(addr) {
971+
if warm_addresses.is_cold(addr) {
972972
acc_mut.mark_cold();
973973
}
974974

crates/evm/traces/src/debug/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ impl<'a> DebugStepsWalker<'a> {
158158
})
159159
.unwrap_or_default();
160160

161-
self.node.trace.steps[start_idx].decoded = Some(DecodedTraceStep::InternalCall(
161+
self.node.trace.steps[start_idx].decoded = Some(Box::new(DecodedTraceStep::InternalCall(
162162
DecodedInternalCall { func_name, args: inputs, return_data: outputs },
163163
self.current_step,
164-
));
164+
)));
165165
}
166166

167167
fn process(&mut self) {

crates/evm/traces/src/decoder/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ impl CallTraceDecoder {
340340
/// [CallTraceDecoder::decode_event] for more details.
341341
pub async fn populate_traces(&self, traces: &mut Vec<CallTraceNode>) {
342342
for node in traces {
343-
node.trace.decoded = self.decode_function(&node.trace).await;
343+
node.trace.decoded = Some(Box::new(self.decode_function(&node.trace).await));
344344
for log in &mut node.logs {
345-
log.decoded = self.decode_event(&log.raw_log).await;
345+
log.decoded = Some(Box::new(self.decode_event(&log.raw_log).await));
346346
}
347347

348348
if let Some(debug) = self.debug_identifier.as_ref()

0 commit comments

Comments
 (0)