From 7a3e6323c5604c930a643e82ac29e997c09628f7 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 20 Apr 2024 00:11:49 +0200 Subject: [PATCH 01/11] chore: bump revm to latest --- Cargo.toml | 6 ++++++ src/access_list.rs | 2 +- src/opcode.rs | 13 ++----------- src/tracing/builder/parity.rs | 20 ++++++++++---------- src/tracing/js/bindings.rs | 18 ++++++++---------- src/tracing/js/mod.rs | 13 +++++++------ src/tracing/mod.rs | 20 ++++++++++---------- src/tracing/types.rs | 4 ++-- src/transfer.rs | 14 +++++++++----- tests/it/geth.rs | 5 ++--- tests/it/parity.rs | 5 ++--- tests/it/transfer.rs | 3 +-- tests/it/utils.rs | 6 +++--- 13 files changed, 63 insertions(+), 66 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8bf577cc..647ecf37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,3 +45,9 @@ expect-test = "1.4" [features] serde = ["dep:serde", "revm/serde"] js-tracer = ["dep:boa_engine", "dep:boa_gc"] + +[patch.crates-io] +revm = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } +revm-interpreter = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } +revm-precompile = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } +revm-primitives = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } diff --git a/src/access_list.rs b/src/access_list.rs index 52c08da4..a572bcd1 100644 --- a/src/access_list.rs +++ b/src/access_list.rs @@ -66,7 +66,7 @@ where match interp.current_opcode() { opcode::SLOAD | opcode::SSTORE => { if let Ok(slot) = interp.stack().peek(0) { - let cur_contract = interp.contract.address; + let cur_contract = interp.contract.target_address; self.access_list .entry(cur_contract) .or_default() diff --git a/src/opcode.rs b/src/opcode.rs index f9fa03c9..81be1261 100644 --- a/src/opcode.rs +++ b/src/opcode.rs @@ -69,19 +69,10 @@ where } } - fn step_end(&mut self, interp: &mut Interpreter, context: &mut EvmContext) { + fn step_end(&mut self, interp: &mut Interpreter, _context: &mut EvmContext) { // update gas usage for the last opcode if let Some((opcode, gas_remaining)) = self.last_opcode_gas_remaining.take() { - let gas_table = - revm::interpreter::instructions::opcode::spec_opcode_gas(context.spec_id()); - let opcode_gas_info = gas_table[opcode.get() as usize]; - - let mut gas_cost = opcode_gas_info.get_gas() as u64; - // if gas cost is 0 then this is dynamic gas and we need to use the tracked gas - if gas_cost == 0 { - gas_cost = gas_remaining.saturating_sub(interp.gas().remaining()); - } - + let gas_cost = gas_remaining.saturating_sub(interp.gas().remaining()); *self.opcode_gas.entry(opcode).or_default() += gas_cost; } } diff --git a/src/tracing/builder/parity.rs b/src/tracing/builder/parity.rs index 6e07d450..766eed0e 100644 --- a/src/tracing/builder/parity.rs +++ b/src/tracing/builder/parity.rs @@ -9,10 +9,7 @@ use alloy_rpc_types::TransactionInfo; use alloy_rpc_types_trace::parity::*; use revm::{ db::DatabaseRef, - interpreter::{ - opcode::{self, spec_opcode_gas}, - OpCode, - }, + interpreter::{opcode, OpCode}, primitives::{Account, ExecutionResult, ResultAndState, SpecId, KECCAK_EMPTY}, }; use std::collections::{HashSet, VecDeque}; @@ -25,6 +22,7 @@ pub struct ParityTraceBuilder { /// Recorded trace nodes nodes: Vec, /// The spec id of the EVM. + #[allow(dead_code)] // dani: gas maps spec_id: Option, /// How the traces were recorded @@ -396,12 +394,14 @@ impl ParityTraceBuilder { store: maybe_storage, }); - let cost = self - .spec_id - .and_then(|spec_id| { - spec_opcode_gas(spec_id).get(step.op.get() as usize).map(|op| op.get_gas()) - }) - .unwrap_or_default(); + // dani: gas maps + // let cost = self + // .spec_id + // .and_then(|spec_id| { + // spec_opcode_gas(spec_id).get(step.op.get() as usize).map(|op| op.get_gas()) + // }) + // .unwrap_or_default(); + let cost = 0; VmInstruction { pc: step.pc, diff --git a/src/tracing/js/bindings.rs b/src/tracing/js/bindings.rs index 547b9770..94a3b6f2 100644 --- a/src/tracing/js/bindings.rs +++ b/src/tracing/js/bindings.rs @@ -790,21 +790,19 @@ impl EvmDbRef { return JsArrayBuffer::new(0, ctx); } - let res = self + let Some(Ok(code)) = self .inner .db .0 - .with_inner(|db| db.code_by_hash_ref(code_hash).map(|code| code.bytecode)); - let code = match res { - Some(Ok(code)) => code, - _ => { - return Err(JsError::from_native(JsNativeError::error().with_message(format!( - "Failed to read code hash {code_hash:?} from database", - )))) - } + .with_inner(|db| db.code_by_hash_ref(code_hash).map(|code| code.bytecode_bytes())) + else { + return Err(JsError::from_native( + JsNativeError::error() + .with_message(format!("Failed to read code hash {code_hash:?} from database",)), + )); }; - to_buf(code.to_vec(), ctx) + to_buf(code.into(), ctx) } fn read_state( diff --git a/src/tracing/js/mod.rs b/src/tracing/js/mod.rs index 1f3fffbf..69aa26fa 100644 --- a/src/tracing/js/mod.rs +++ b/src/tracing/js/mod.rs @@ -257,7 +257,7 @@ impl JsInspector { to = Some(target); "CALL" } - TransactTo::Create(_) => "CREATE", + TransactTo::Create => "CREATE", } .to_string(), from: env.tx.caller, @@ -446,19 +446,20 @@ where self.register_precompiles(&context.precompiles); // determine correct `from` and `to` based on the call scheme - let (from, to) = match inputs.context.scheme { + let (from, to) = match inputs.scheme { CallScheme::DelegateCall | CallScheme::CallCode => { - (inputs.context.address, inputs.context.code_address) + (inputs.bytecode_address, inputs.target_address) } - _ => (inputs.context.caller, inputs.context.address), + _ => (inputs.caller, inputs.bytecode_address), }; - let value = inputs.transfer.value; + // dani: transfer_value().unwrap_or_default() + let value = inputs.call_value(); self.push_call( to, inputs.input.clone(), value, - inputs.context.scheme.into(), + inputs.scheme.into(), from, inputs.gas_limit, ); diff --git a/src/tracing/mod.rs b/src/tracing/mod.rs index 92da8d83..6fd50ac3 100644 --- a/src/tracing/mod.rs +++ b/src/tracing/mod.rs @@ -186,7 +186,7 @@ impl TracingInspector { &self, context: &EvmContext, to: &Address, - value: U256, + value: &U256, ) -> bool { if context.precompiles.contains_key(to) { // only if this is _not_ the root call @@ -353,7 +353,7 @@ impl TracingInspector { depth: context.journaled_state.depth(), pc: interp.program_counter(), op, - contract: interp.contract.address, + contract: interp.contract.target_address, stack, push_stack: None, memory_size: memory.len(), @@ -476,36 +476,36 @@ where self.gas_inspector.call(context, inputs); // determine correct `from` and `to` based on the call scheme - let (from, to) = match inputs.context.scheme { + let (from, to) = match inputs.scheme { CallScheme::DelegateCall | CallScheme::CallCode => { - (inputs.context.address, inputs.context.code_address) + (inputs.target_address, inputs.bytecode_address) } - _ => (inputs.context.caller, inputs.context.address), + _ => (inputs.caller, inputs.target_address), }; - let value = if matches!(inputs.context.scheme, CallScheme::DelegateCall) { + let value = if matches!(inputs.scheme, CallScheme::DelegateCall) { // for delegate calls we need to use the value of the top trace if let Some(parent) = self.active_trace() { parent.trace.value } else { - inputs.transfer.value + inputs.call_value() } } else { - inputs.transfer.value + inputs.call_value() }; // if calls to precompiles should be excluded, check whether this is a call to a precompile let maybe_precompile = self .config .exclude_precompile_calls - .then(|| self.is_precompile_call(context, &to, value)); + .then(|| self.is_precompile_call(context, &to, &value)); self.start_trace_on_call( context, to, inputs.input.clone(), value, - inputs.context.scheme.into(), + inputs.scheme.into(), from, inputs.gas_limit, maybe_precompile, diff --git a/src/tracing/types.rs b/src/tracing/types.rs index cfc7e24d..08bf5895 100644 --- a/src/tracing/types.rs +++ b/src/tracing/types.rs @@ -10,7 +10,7 @@ use alloy_rpc_types_trace::{ SelfdestructAction, TraceOutput, TransactionTrace, }, }; -use revm::interpreter::{opcode, CallContext, CallScheme, CreateScheme, InstructionResult, OpCode}; +use revm::interpreter::{opcode, CallScheme, CreateScheme, InstructionResult, OpCode}; use std::collections::VecDeque; /// A trace of a call. @@ -55,7 +55,7 @@ pub struct CallTrace { /// The status of the trace's call pub status: InstructionResult, /// call context of the runtime - pub call_context: Option>, + // pub call_context: Option>, /// Opcode-level execution steps pub steps: Vec, } diff --git a/src/transfer.rs b/src/transfer.rs index d0290fee..a71adecd 100644 --- a/src/transfer.rs +++ b/src/transfer.rs @@ -1,6 +1,8 @@ use alloy_primitives::{Address, U256}; use revm::{ - interpreter::{CallInputs, CallOutcome, CreateInputs, CreateOutcome, CreateScheme}, + interpreter::{ + CallInputs, CallOutcome, CreateInputs, CreateOutcome, CreateScheme, TransferValue, + }, Database, EvmContext, Inspector, }; @@ -57,12 +59,14 @@ where return None; } - if !inputs.transfer.value.is_zero() { + let value = inputs.call_value(); + // dani: `inputs.transfers_value()` + if matches!(inputs.value, TransferValue::Value(_)) && !value.is_zero() { self.transfers.push(TransferOperation { kind: TransferKind::Call, - from: inputs.transfer.source, - to: inputs.transfer.target, - value: inputs.transfer.value, + from: inputs.caller, + to: inputs.target_address, + value, }); } diff --git a/tests/it/geth.rs b/tests/it/geth.rs index 3184a3dd..be421550 100644 --- a/tests/it/geth.rs +++ b/tests/it/geth.rs @@ -8,7 +8,6 @@ use alloy_rpc_types_trace::geth::{ }; use revm::{ db::{CacheDB, EmptyDB}, - interpreter::CreateScheme, primitives::{ BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, HandlerCfg, Output, SpecId, TransactTo, TxEnv, @@ -66,7 +65,7 @@ fn test_geth_calltracer_logs() { TxEnv { caller: deployer, gas_limit: 1000000, - transact_to: TransactTo::Create(CreateScheme::Create), + transact_to: TransactTo::Create, data: code.into(), ..Default::default() }, @@ -175,7 +174,7 @@ fn test_geth_mux_tracer() { TxEnv { caller: deployer, gas_limit: 1000000, - transact_to: TransactTo::Create(CreateScheme::Create), + transact_to: TransactTo::Create, data: code.into(), ..Default::default() }, diff --git a/tests/it/parity.rs b/tests/it/parity.rs index aa021f82..73ec5a13 100644 --- a/tests/it/parity.rs +++ b/tests/it/parity.rs @@ -5,7 +5,6 @@ use alloy_primitives::{hex, Address}; use alloy_rpc_types::TransactionInfo; use revm::{ db::{CacheDB, EmptyDB}, - interpreter::CreateScheme, primitives::{ BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, HandlerCfg, Output, SpecId, TransactTo, TxEnv, @@ -39,7 +38,7 @@ fn test_parity_selfdestruct() { TxEnv { caller: deployer, gas_limit: 1000000, - transact_to: TransactTo::Create(CreateScheme::Create), + transact_to: TransactTo::Create, data: code.into(), ..Default::default() }, @@ -115,7 +114,7 @@ fn test_parity_constructor_selfdestruct() { TxEnv { caller: deployer, gas_limit: 1000000, - transact_to: TransactTo::Create(CreateScheme::Create), + transact_to: TransactTo::Create, data: code.into(), ..Default::default() }, diff --git a/tests/it/transfer.rs b/tests/it/transfer.rs index dfb9ac2a..6eed8ffa 100644 --- a/tests/it/transfer.rs +++ b/tests/it/transfer.rs @@ -3,7 +3,6 @@ use alloy_primitives::{hex, Address, U256}; use revm::{ db::{CacheDB, EmptyDB}, - interpreter::CreateScheme, primitives::{ BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ExecutionResult, HandlerCfg, Output, SpecId, TransactTo, TxEnv, @@ -41,7 +40,7 @@ fn test_internal_transfers() { TxEnv { caller: deployer, gas_limit: 1000000, - transact_to: TransactTo::Create(CreateScheme::Create), + transact_to: TransactTo::Create, data: code.into(), ..Default::default() }, diff --git a/tests/it/utils.rs b/tests/it/utils.rs index ca503c72..75bae73c 100644 --- a/tests/it/utils.rs +++ b/tests/it/utils.rs @@ -4,8 +4,8 @@ use revm::{ db::{CacheDB, EmptyDB}, inspector_handle_register, primitives::{ - BlockEnv, CreateScheme, EVMError, Env, EnvWithHandlerCfg, ExecutionResult, HandlerCfg, - Output, ResultAndState, SpecId, TransactTo, TxEnv, + BlockEnv, EVMError, Env, EnvWithHandlerCfg, ExecutionResult, HandlerCfg, Output, + ResultAndState, SpecId, TransactTo, TxEnv, }, Database, DatabaseCommit, GetInspector, }; @@ -46,7 +46,7 @@ impl TestEvm { inspector: I, ) -> Result> { self.env.tx.data = data; - self.env.tx.transact_to = TransactTo::Create(CreateScheme::Create); + self.env.tx.transact_to = TransactTo::Create; let (ResultAndState { result, state }, env) = self.inspect(inspector)?; self.db.commit(state); From e6fb28765ae666ffbbaaac8904e79a22c9853603 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 20 Apr 2024 01:20:49 +0200 Subject: [PATCH 02/11] js --- src/tracing/js/bindings.rs | 55 ++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/src/tracing/js/bindings.rs b/src/tracing/js/bindings.rs index 94a3b6f2..68dbfd54 100644 --- a/src/tracing/js/bindings.rs +++ b/src/tracing/js/bindings.rs @@ -79,15 +79,19 @@ struct GuardedNullableGc { impl GuardedNullableGc { /// Creates a garbage collectible value to the given reference. /// - /// SAFETY; the caller must ensure that the guard is dropped before the value is dropped. - fn r#ref(val: &Val) -> (Self, GcGuard<'_, Val>) { + /// # Safety + /// + /// The caller must ensure that the guard is dropped before the value is dropped. + fn new_ref(val: &Val) -> (Self, GcGuard<'_, Val>) { Self::new(Guarded::Ref(val)) } /// Creates a garbage collectible value to the given reference. /// - /// SAFETY; the caller must ensure that the guard is dropped before the value is dropped. - fn r#owned<'a>(val: Val) -> (Self, GcGuard<'a, Val>) { + /// # Safety + /// + /// The caller must ensure that the guard is dropped before the value is dropped. + fn new_owned<'a>(val: Val) -> (Self, GcGuard<'a, Val>) { Self::new(Guarded::Owned(val)) } @@ -95,13 +99,9 @@ impl GuardedNullableGc { let inner = Rc::new(RefCell::new(Some(val))); let guard = GcGuard { inner: Rc::clone(&inner) }; - // SAFETY: guard enforces that the value is removed from the refcell before it is dropped - let this = Self { - inner: unsafe { - #[allow(clippy::missing_transmute_annotations)] - std::mem::transmute(inner) - }, - }; + // SAFETY: guard enforces that the value is removed from the refcell before it is dropped. + #[allow(clippy::missing_transmute_annotations)] + let this = Self { inner: unsafe { std::mem::transmute(inner) } }; (this, guard) } @@ -111,10 +111,7 @@ impl GuardedNullableGc { where F: FnOnce(&Val) -> R, { - self.inner.borrow().as_ref().map(|val| match val { - Guarded::Ref(val) => f(val), - Guarded::Owned(val) => f(val), - }) + self.inner.borrow().as_ref().map(|guard| f(guard.as_ref())) } } @@ -131,6 +128,16 @@ enum Guarded<'a, T> { Owned(T), } +impl Guarded<'_, T> { + #[inline] + fn as_ref(&self) -> &T { + match self { + Guarded::Ref(val) => val, + Guarded::Owned(val) => val, + } + } +} + /// Guard the inner value, once this value is dropped the inner value is also removed. /// /// This type guarantees that it never outlives the wrapped value. @@ -232,7 +239,7 @@ pub(crate) struct MemoryRef(GuardedNullableGc); impl MemoryRef { /// Creates a new stack reference pub(crate) fn new(mem: &SharedMemory) -> (Self, GcGuard<'_, SharedMemory>) { - let (inner, guard) = GuardedNullableGc::r#ref(mem); + let (inner, guard) = GuardedNullableGc::new_ref(mem); (Self(inner), guard) } @@ -324,7 +331,7 @@ pub(crate) struct StateRef(GuardedNullableGc); impl StateRef { /// Creates a new stack reference pub(crate) fn new(state: &State) -> (Self, GcGuard<'_, State>) { - let (inner, guard) = GuardedNullableGc::r#ref(state); + let (inner, guard) = GuardedNullableGc::new_ref(state); (Self(inner), guard) } @@ -349,7 +356,7 @@ where { /// Creates a new stack reference fn new<'a>(db: DB) -> (Self, GcGuard<'a, DB>) { - let (inner, guard) = GuardedNullableGc::owned(db); + let (inner, guard) = GuardedNullableGc::new_owned(db); (Self(inner), guard) } } @@ -417,7 +424,7 @@ pub(crate) struct StackRef(GuardedNullableGc); impl StackRef { /// Creates a new stack reference pub(crate) fn new(stack: &Stack) -> (Self, GcGuard<'_, Stack>) { - let (inner, guard) = GuardedNullableGc::r#ref(stack); + let (inner, guard) = GuardedNullableGc::new_ref(stack); (Self(inner), guard) } @@ -790,19 +797,15 @@ impl EvmDbRef { return JsArrayBuffer::new(0, ctx); } - let Some(Ok(code)) = self - .inner - .db - .0 - .with_inner(|db| db.code_by_hash_ref(code_hash).map(|code| code.bytecode_bytes())) + let Some(Ok(bytecode)) = self.inner.db.0.with_inner(|db| db.code_by_hash_ref(code_hash)) else { return Err(JsError::from_native( JsNativeError::error() - .with_message(format!("Failed to read code hash {code_hash:?} from database",)), + .with_message(format!("Failed to read code hash {code_hash:?} from database")), )); }; - to_buf(code.into(), ctx) + to_buf(bytecode.bytes().to_vec(), ctx) } fn read_state( From 2aed73ff1cbb4f706c11437a5dd21ccb81297a16 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sun, 21 Apr 2024 23:28:04 +0200 Subject: [PATCH 03/11] update --- src/tracing/builder/parity.rs | 21 +++------------------ src/tracing/js/bindings.rs | 2 +- src/tracing/js/mod.rs | 3 +-- src/transfer.rs | 10 +++------- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/src/tracing/builder/parity.rs b/src/tracing/builder/parity.rs index 766eed0e..87999211 100644 --- a/src/tracing/builder/parity.rs +++ b/src/tracing/builder/parity.rs @@ -21,22 +21,16 @@ use std::collections::{HashSet, VecDeque}; pub struct ParityTraceBuilder { /// Recorded trace nodes nodes: Vec, - /// The spec id of the EVM. - #[allow(dead_code)] // dani: gas maps - spec_id: Option, - - /// How the traces were recorded - _config: TracingInspectorConfig, } impl ParityTraceBuilder { /// Returns a new instance of the builder pub fn new( nodes: Vec, - spec_id: Option, + _spec_id: Option, _config: TracingInspectorConfig, ) -> Self { - Self { nodes, spec_id, _config } + Self { nodes } } /// Returns a list of all addresses that appeared as callers. @@ -394,18 +388,9 @@ impl ParityTraceBuilder { store: maybe_storage, }); - // dani: gas maps - // let cost = self - // .spec_id - // .and_then(|spec_id| { - // spec_opcode_gas(spec_id).get(step.op.get() as usize).map(|op| op.get_gas()) - // }) - // .unwrap_or_default(); - let cost = 0; - VmInstruction { pc: step.pc, - cost: cost as u64, + cost: step.gas_cost, ex: maybe_execution, sub: maybe_sub_call, op: Some(step.op.to_string()), diff --git a/src/tracing/js/bindings.rs b/src/tracing/js/bindings.rs index 68dbfd54..8a918295 100644 --- a/src/tracing/js/bindings.rs +++ b/src/tracing/js/bindings.rs @@ -805,7 +805,7 @@ impl EvmDbRef { )); }; - to_buf(bytecode.bytes().to_vec(), ctx) + to_buf(bytecode.bytecode_bytes().to_vec(), ctx) } fn read_state( diff --git a/src/tracing/js/mod.rs b/src/tracing/js/mod.rs index 69aa26fa..76e5b851 100644 --- a/src/tracing/js/mod.rs +++ b/src/tracing/js/mod.rs @@ -453,8 +453,7 @@ where _ => (inputs.caller, inputs.bytecode_address), }; - // dani: transfer_value().unwrap_or_default() - let value = inputs.call_value(); + let value = inputs.transfer_value().unwrap_or_default(); self.push_call( to, inputs.input.clone(), diff --git a/src/transfer.rs b/src/transfer.rs index a71adecd..65f0545b 100644 --- a/src/transfer.rs +++ b/src/transfer.rs @@ -1,8 +1,6 @@ use alloy_primitives::{Address, U256}; use revm::{ - interpreter::{ - CallInputs, CallOutcome, CreateInputs, CreateOutcome, CreateScheme, TransferValue, - }, + interpreter::{CallInputs, CallOutcome, CreateInputs, CreateOutcome, CreateScheme}, Database, EvmContext, Inspector, }; @@ -59,14 +57,12 @@ where return None; } - let value = inputs.call_value(); - // dani: `inputs.transfers_value()` - if matches!(inputs.value, TransferValue::Value(_)) && !value.is_zero() { + if inputs.transfers_value() { self.transfers.push(TransferOperation { kind: TransferKind::Call, from: inputs.caller, to: inputs.target_address, - value, + value: inputs.call_value(), }); } From 84fdbf1ff3d79fb212bcd88827f43f45664dbe71 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sun, 21 Apr 2024 23:29:41 +0200 Subject: [PATCH 04/11] main --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 647ecf37..daf11154 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ serde = ["dep:serde", "revm/serde"] js-tracer = ["dep:boa_engine", "dep:boa_gc"] [patch.crates-io] -revm = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } -revm-interpreter = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } -revm-precompile = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } -revm-primitives = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } +revm = { git = "https://github.com/bluealloy/revm" } +revm-interpreter = { git = "https://github.com/bluealloy/revm" } +revm-precompile = { git = "https://github.com/bluealloy/revm" } +revm-primitives = { git = "https://github.com/bluealloy/revm" } From f3601e23aef39bdf10ae689c72dc77a561a8e848 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sun, 21 Apr 2024 23:33:08 +0200 Subject: [PATCH 05/11] Revert "main" This reverts commit 84fdbf1ff3d79fb212bcd88827f43f45664dbe71. --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index daf11154..647ecf37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ serde = ["dep:serde", "revm/serde"] js-tracer = ["dep:boa_engine", "dep:boa_gc"] [patch.crates-io] -revm = { git = "https://github.com/bluealloy/revm" } -revm-interpreter = { git = "https://github.com/bluealloy/revm" } -revm-precompile = { git = "https://github.com/bluealloy/revm" } -revm-primitives = { git = "https://github.com/bluealloy/revm" } +revm = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } +revm-interpreter = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } +revm-precompile = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } +revm-primitives = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } From b505c29022ae643c42cb2ea7012d2aa163fc74a1 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 27 Apr 2024 11:25:19 +0200 Subject: [PATCH 06/11] bump --- Cargo.toml | 8 ++++---- src/tracing/js/bindings.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 647ecf37..053baeb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ serde = ["dep:serde", "revm/serde"] js-tracer = ["dep:boa_engine", "dep:boa_gc"] [patch.crates-io] -revm = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } -revm-interpreter = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } -revm-precompile = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } -revm-primitives = { git = "https://github.com/danipopes/revm", branch = "refactor-opinfo" } +revm = { git = "https://github.com/danipopes/revm", branch = "tmp-prs2" } +revm-interpreter = { git = "https://github.com/danipopes/revm", branch = "tmp-prs2" } +revm-precompile = { git = "https://github.com/danipopes/revm", branch = "tmp-prs2" } +revm-primitives = { git = "https://github.com/danipopes/revm", branch = "tmp-prs2" } diff --git a/src/tracing/js/bindings.rs b/src/tracing/js/bindings.rs index 8a918295..d1aab506 100644 --- a/src/tracing/js/bindings.rs +++ b/src/tracing/js/bindings.rs @@ -805,7 +805,7 @@ impl EvmDbRef { )); }; - to_buf(bytecode.bytecode_bytes().to_vec(), ctx) + to_buf(bytecode.bytecode().to_vec(), ctx) } fn read_state( From 4f9b44fa388e23dc29deddcfd8239cf755dd811b Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Wed, 1 May 2024 08:50:46 +0200 Subject: [PATCH 07/11] main --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 053baeb5..daf11154 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ serde = ["dep:serde", "revm/serde"] js-tracer = ["dep:boa_engine", "dep:boa_gc"] [patch.crates-io] -revm = { git = "https://github.com/danipopes/revm", branch = "tmp-prs2" } -revm-interpreter = { git = "https://github.com/danipopes/revm", branch = "tmp-prs2" } -revm-precompile = { git = "https://github.com/danipopes/revm", branch = "tmp-prs2" } -revm-primitives = { git = "https://github.com/danipopes/revm", branch = "tmp-prs2" } +revm = { git = "https://github.com/bluealloy/revm" } +revm-interpreter = { git = "https://github.com/bluealloy/revm" } +revm-precompile = { git = "https://github.com/bluealloy/revm" } +revm-primitives = { git = "https://github.com/bluealloy/revm" } From cd16df6539eb72c5f5a6ef06833b4074af786e33 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Wed, 1 May 2024 08:51:45 +0200 Subject: [PATCH 08/11] rev --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index daf11154..02ef06b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ serde = ["dep:serde", "revm/serde"] js-tracer = ["dep:boa_engine", "dep:boa_gc"] [patch.crates-io] -revm = { git = "https://github.com/bluealloy/revm" } -revm-interpreter = { git = "https://github.com/bluealloy/revm" } -revm-precompile = { git = "https://github.com/bluealloy/revm" } -revm-primitives = { git = "https://github.com/bluealloy/revm" } +revm = { git = "https://github.com/bluealloy/revm", rev = "67c13f3daaba8620829d949b93fb0583d8f8fcd7" } +revm-interpreter = { git = "https://github.com/bluealloy/revm", rev = "67c13f3daaba8620829d949b93fb0583d8f8fcd7" } +revm-precompile = { git = "https://github.com/bluealloy/revm", rev = "67c13f3daaba8620829d949b93fb0583d8f8fcd7" } +revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "67c13f3daaba8620829d949b93fb0583d8f8fcd7" } From d3a811246fb71e40370ee6ecdbf4d67eecefd994 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Fri, 3 May 2024 13:46:06 +0200 Subject: [PATCH 09/11] fix --- src/tracing/js/mod.rs | 2 +- src/tracing/types.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tracing/js/mod.rs b/src/tracing/js/mod.rs index 76e5b851..4e8d4acc 100644 --- a/src/tracing/js/mod.rs +++ b/src/tracing/js/mod.rs @@ -448,7 +448,7 @@ where // determine correct `from` and `to` based on the call scheme let (from, to) = match inputs.scheme { CallScheme::DelegateCall | CallScheme::CallCode => { - (inputs.bytecode_address, inputs.target_address) + (inputs.target_address, inputs.bytecode_address) } _ => (inputs.caller, inputs.bytecode_address), }; diff --git a/src/tracing/types.rs b/src/tracing/types.rs index 447976d5..4c157795 100644 --- a/src/tracing/types.rs +++ b/src/tracing/types.rs @@ -54,8 +54,6 @@ pub struct CallTrace { pub gas_limit: u64, /// The status of the trace's call pub status: InstructionResult, - /// call context of the runtime - // pub call_context: Option>, /// Opcode-level execution steps pub steps: Vec, } From 60a035d30325657eb38244e69f83786c08cce74b Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Fri, 10 May 2024 09:47:22 +0200 Subject: [PATCH 10/11] bump --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8bd0f4e3..b8c6a45e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ serde = ["dep:serde", "revm/serde"] js-tracer = ["dep:boa_engine", "dep:boa_gc"] [patch.crates-io] -revm = { git = "https://github.com/bluealloy/revm", rev = "67c13f3daaba8620829d949b93fb0583d8f8fcd7" } -revm-interpreter = { git = "https://github.com/bluealloy/revm", rev = "67c13f3daaba8620829d949b93fb0583d8f8fcd7" } -revm-precompile = { git = "https://github.com/bluealloy/revm", rev = "67c13f3daaba8620829d949b93fb0583d8f8fcd7" } -revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "67c13f3daaba8620829d949b93fb0583d8f8fcd7" } +revm = { git = "https://github.com/bluealloy/revm", rev = "1914696de833600f28d895be6c2621714402419c" } +revm-interpreter = { git = "https://github.com/bluealloy/revm", rev = "1914696de833600f28d895be6c2621714402419c" } +revm-precompile = { git = "https://github.com/bluealloy/revm", rev = "1914696de833600f28d895be6c2621714402419c" } +revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "1914696de833600f28d895be6c2621714402419c" } From db06c1d5251ffc79d5df0473047235cec8b918b9 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sun, 12 May 2024 15:26:31 +0300 Subject: [PATCH 11/11] bump to 9 --- Cargo.toml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b8c6a45e..ff3bec1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,15 +25,15 @@ alloy-sol-types = "0.7.1" alloy-primitives = "0.7.1" alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "77c1240" } alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "77c1240" } -revm = { version = "8.0", default-features = false, features = ["std"] } +revm = { version = "9.0", default-features = false, features = ["std"] } anstyle = "1.0" colorchoice = "1.0" -thiserror = { version = "1" } +thiserror = "1.0" # serde serde = { version = "1", optional = true, features = ["derive"] } -serde_json = { version = "1" } +serde_json = "1.0" # js-tracer boa_engine = { version = "0.18", optional = true } @@ -45,9 +45,3 @@ expect-test = "1.4" [features] serde = ["dep:serde", "revm/serde"] js-tracer = ["dep:boa_engine", "dep:boa_gc"] - -[patch.crates-io] -revm = { git = "https://github.com/bluealloy/revm", rev = "1914696de833600f28d895be6c2621714402419c" } -revm-interpreter = { git = "https://github.com/bluealloy/revm", rev = "1914696de833600f28d895be6c2621714402419c" } -revm-precompile = { git = "https://github.com/bluealloy/revm", rev = "1914696de833600f28d895be6c2621714402419c" } -revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "1914696de833600f28d895be6c2621714402419c" }