Skip to content

Commit

Permalink
chore: bump revm v12.0.0 (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita authored Jul 16, 2024
1 parent 4a827df commit 4d7def9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ clippy.lint_groups_priority = "allow"
# eth
alloy-sol-types = "0.7"
alloy-primitives = "0.7"
alloy-rpc-types = { version = "0.1", features = ["eth", "trace"] }
revm = { version = "11.0", default-features = false, features = ["std"] }
alloy-rpc-types = { version = "0.2", features = ["eth", "trace"] }
revm = { version = "12.0", default-features = false, features = ["std"] }

anstyle = "1.0"
colorchoice = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ where
}
}

fn log(&mut self, _context: &mut EvmContext<DB>, _log: &Log) {}
fn log(&mut self, _interp: &mut Interpreter, _context: &mut EvmContext<DB>, _log: &Log) {}

fn call(
&mut self,
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ where
}
}

fn log(&mut self, _context: &mut EvmContext<DB>, log: &Log) {
fn log(&mut self, _interp: &mut Interpreter, _context: &mut EvmContext<DB>, log: &Log) {
if self.config.record_logs {
let trace = self.last_trace();
trace.ordering.push(TraceMemberOrder::Log(trace.logs.len()));
Expand Down
19 changes: 12 additions & 7 deletions src/tracing/mux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ where
}

#[inline]
fn log(&mut self, context: &mut EvmContext<DB>, log: &Log) {
fn log(&mut self, interp: &mut Interpreter, context: &mut EvmContext<DB>, log: &Log) {
for (_, inspector) in &mut self.0 {
inspector.log(context, log);
inspector.log(interp, context, log);
}
}

Expand Down Expand Up @@ -300,13 +300,18 @@ impl DelegatingInspector {
}

#[inline]
fn log<DB: Database>(&mut self, context: &mut EvmContext<DB>, log: &Log) {
fn log<DB: Database>(
&mut self,
interp: &mut Interpreter,
context: &mut EvmContext<DB>,
log: &Log,
) {
match self {
DelegatingInspector::FourByte(inspector) => inspector.log(context, log),
DelegatingInspector::Call(_, inspector) => inspector.log(context, log),
DelegatingInspector::Prestate(_, inspector) => inspector.log(context, log),
DelegatingInspector::FourByte(inspector) => inspector.log(interp, context, log),
DelegatingInspector::Call(_, inspector) => inspector.log(interp, context, log),
DelegatingInspector::Prestate(_, inspector) => inspector.log(interp, context, log),
DelegatingInspector::Noop => {}
DelegatingInspector::Mux(inspector) => inspector.log(context, log),
DelegatingInspector::Mux(inspector) => inspector.log(interp, context, log),
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/tracing/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::tracing::{config::TraceStyle, utils, utils::convert_memory};
pub use alloy_primitives::Log;
use alloy_primitives::{Address, Bytes, LogData, U256, U64};
use alloy_primitives::{Address, Bytes, LogData, U256};
use alloy_rpc_types::trace::{
geth::{CallFrame, CallLogFrame, GethDefaultTracingOptions, StructLog},
parity::{
Expand Down Expand Up @@ -282,12 +282,12 @@ impl CallTraceNode {
| CallKind::CallCode
| CallKind::DelegateCall
| CallKind::AuthCall => TraceOutput::Call(CallOutput {
gas_used: U64::from(self.trace.gas_used),
gas_used: self.trace.gas_used,
output: self.trace.output.clone(),
}),
CallKind::Create | CallKind::Create2 | CallKind::EOFCreate => {
TraceOutput::Create(CreateOutput {
gas_used: U64::from(self.trace.gas_used),
gas_used: self.trace.gas_used,
code: self.trace.output.clone(),
address: self.trace.address,
})
Expand Down Expand Up @@ -349,15 +349,15 @@ impl CallTraceNode {
from: self.trace.caller,
to: self.trace.address,
value: self.trace.value,
gas: U64::from(self.trace.gas_limit),
gas: self.trace.gas_limit,
input: self.trace.data.clone(),
call_type: self.kind().into(),
}),
CallKind::Create | CallKind::Create2 | CallKind::EOFCreate => {
Action::Create(CreateAction {
from: self.trace.caller,
value: self.trace.value,
gas: U64::from(self.trace.gas_limit),
gas: self.trace.gas_limit,
init: self.trace.data.clone(),
})
}
Expand Down
4 changes: 2 additions & 2 deletions tests/it/parity.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Parity tests

use crate::utils::{inspect, print_traces};
use alloy_primitives::{address, hex, Address, U256, U64};
use alloy_primitives::{address, hex, Address, U256};
use alloy_rpc_types::{
trace::parity::{Action, CallAction, CallType, SelfdestructAction, TraceType},
TransactionInfo,
Expand Down Expand Up @@ -277,7 +277,7 @@ fn test_parity_call_selfdestruct() {
Action::Call(CallAction {
from: caller,
call_type: CallType::Call,
gas: U64::from(100000000),
gas: 100000000,
input: input.into(),
to,
value: U256::ZERO,
Expand Down

0 comments on commit 4d7def9

Please sign in to comment.