Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump revm #131

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ alloy-sol-types = "0.7.2"
alloy-primitives = "0.7.2"
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "5940871" }
alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "5940871" }
revm = { version = "9.0", default-features = false, features = ["std"] }
revm = { version = "9.0", git = "https://github.com/bluealloy/revm.git", rev = "a28a543", default-features = false, features = [
"std",
] }

anstyle = "1.0"
colorchoice = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/tracing/builder/geth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl GethTraceBuilder {

// insert the original value of all modified storage slots
for (key, slot) in changed_acc.storage.iter() {
acc_state.storage.insert((*key).into(), slot.previous_or_original_value.into());
acc_state.storage.insert((*key).into(), slot.original_value.into());
}

prestate.0.insert(addr, acc_state);
Expand All @@ -244,7 +244,7 @@ impl GethTraceBuilder {
// handle storage changes
for (key, slot) in changed_acc.storage.iter().filter(|(_, slot)| slot.is_changed())
{
pre_state.storage.insert((*key).into(), slot.previous_or_original_value.into());
pre_state.storage.insert((*key).into(), slot.original_value.into());
post_state.storage.insert((*key).into(), slot.present_value.into());
}

Expand Down
5 changes: 1 addition & 4 deletions src/tracing/builder/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,7 @@ where
for (key, slot) in changed_acc.storage.iter().filter(|(_, slot)| slot.is_changed()) {
entry.storage.insert(
(*key).into(),
Delta::changed(
slot.previous_or_original_value.into(),
slot.present_value.into(),
),
Delta::changed(slot.original_value.into(), slot.present_value.into()),
);
}

Expand Down
14 changes: 7 additions & 7 deletions src/tracing/js/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use revm::{
opcode::{PUSH0, PUSH32},
OpCode, SharedMemory, Stack,
},
primitives::{AccountInfo, Bytecode, State, KECCAK_EMPTY},
primitives::{AccountInfo, Bytecode, EvmState, KECCAK_EMPTY},
DatabaseRef,
};
use std::{cell::RefCell, rc::Rc};
Expand Down Expand Up @@ -326,11 +326,11 @@ unsafe impl Trace for MemoryRef {

/// Represents the state object
#[derive(Clone, Debug)]
pub(crate) struct StateRef(GuardedNullableGc<State>);
pub(crate) struct StateRef(GuardedNullableGc<EvmState>);

impl StateRef {
/// Creates a new stack reference
pub(crate) fn new(state: &State) -> (Self, GcGuard<'_, State>) {
pub(crate) fn new(state: &EvmState) -> (Self, GcGuard<'_, EvmState>) {
let (inner, guard) = GuardedNullableGc::new_ref(state);
(Self(inner), guard)
}
Expand Down Expand Up @@ -744,7 +744,7 @@ pub(crate) struct EvmDbRef {

impl EvmDbRef {
/// Creates a new evm and db JS object.
pub(crate) fn new<'a, 'b, DB>(state: &'a State, db: &'b DB) -> (Self, EvmDbGuard<'a, 'b>)
pub(crate) fn new<'a, 'b, DB>(state: &'a EvmState, db: &'b DB) -> (Self, EvmDbGuard<'a, 'b>)
where
DB: DatabaseRef,
DB::Error: std::fmt::Display,
Expand Down Expand Up @@ -934,7 +934,7 @@ struct EvmDbRefInner {
/// This ensures that the guards are dropped within the lifetime of the borrowed values.
#[must_use]
pub(crate) struct EvmDbGuard<'a, 'b> {
_state_guard: GcGuard<'a, State>,
_state_guard: GcGuard<'a, EvmState>,
_db_guard: GcGuard<'b, Box<dyn DatabaseRef<Error = String> + 'static>>,
}

Expand Down Expand Up @@ -1061,7 +1061,7 @@ mod tests {
let f = result.as_callable().unwrap();

let mut db = CacheDB::new(EmptyDB::new());
let state = State::default();
let state = EvmState::default();
{
let (db, guard) = EvmDbRef::new(&state, &db);
let addr = Address::default();
Expand Down Expand Up @@ -1118,7 +1118,7 @@ mod tests {
obj.get(js_string!("setup"), &mut context).unwrap().as_object().cloned().unwrap();

let db = CacheDB::new(EmptyDB::new());
let state = State::default();
let state = EvmState::default();
{
let (db_ref, guard) = EvmDbRef::new(&state, &db);
let js_db = db_ref.into_js_object(&mut context).unwrap();
Expand Down
Loading