From 26703d2dc8006599abecbe7498ae16df9ecd5f43 Mon Sep 17 00:00:00 2001 From: rakita Date: Thu, 26 Dec 2024 13:32:33 +0100 Subject: [PATCH] precompile addresses --- Cargo.toml | 6 +++--- src/tracing/js/builtins.rs | 3 ++- src/tracing/js/mod.rs | 7 ++----- src/tracing/mod.rs | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f8e68eaa..54d3348d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,10 +34,10 @@ alloy-rpc-types-eth = "0.8" alloy-rpc-types-trace = "0.8" alloy-sol-types = "0.8" alloy-primitives = { version = "0.8", features = ["map"] } -revm = { git = "https://github.com/bluealloy/revm.git", rev = "90a6fc6e", default-features = false, features = [ +revm = { git = "https://github.com/bluealloy/revm.git", rev = "3c0c034f", default-features = false, features = [ "std", ] } -revm-inspector = { git = "https://github.com/bluealloy/revm.git", rev = "90a6fc6e", default-features = false, features = [ +revm-inspector = { git = "https://github.com/bluealloy/revm.git", rev = "3c0c034f", default-features = false, features = [ "std", ] } @@ -55,7 +55,7 @@ boa_gc = { version = "0.19", optional = true } [dev-dependencies] snapbox = { version = "0.6", features = ["term-svg"] } -revm-database = { git = "https://github.com/bluealloy/revm.git", rev = "90a6fc6e", default-features = false, features = [ +revm-database = { git = "https://github.com/bluealloy/revm.git", rev = "3c0c034f", default-features = false, features = [ "std", ] } diff --git a/src/tracing/js/builtins.rs b/src/tracing/js/builtins.rs index 088ae31a..93a6de7c 100644 --- a/src/tracing/js/builtins.rs +++ b/src/tracing/js/builtins.rs @@ -9,7 +9,8 @@ use boa_engine::{ Context, JsArgs, JsError, JsNativeError, JsResult, JsString, JsValue, NativeFunction, Source, }; use boa_gc::{empty_trace, Finalize, Trace}; -use std::{borrow::Borrow, collections::HashSet}; +use revm::primitives::HashSet; +use std::borrow::Borrow; /// bigIntegerJS is the minified version of . pub(crate) const BIG_INT_JS: &str = include_str!("bigint.js"); diff --git a/src/tracing/js/mod.rs b/src/tracing/js/mod.rs index 128714ad..d140d4f7 100644 --- a/src/tracing/js/mod.rs +++ b/src/tracing/js/mod.rs @@ -24,7 +24,6 @@ use revm::{ CallInputs, CallOutcome, CallScheme, CreateInputs, CreateOutcome, Gas, InstructionResult, Interpreter, InterpreterResult, }, - primitives::HashSet, Database, DatabaseRef, }; use revm_inspector::{Inspector, JournalExt, JournalExtGetter}; @@ -383,13 +382,11 @@ impl JsInspector { } /// Registers the precompiles in the JS context - fn register_precompiles(&mut self, _context: &mut CTX) { + fn register_precompiles(&mut self, context: &mut CTX) { if !self.precompiles_registered { return; } - let precompiles = PrecompileList(HashSet::default()); - // TODO(rakita) : add precompile_addresses to Journal. - // context.journal().warm_precompiles(addresses);.addresses().copied().collect()); + let precompiles = PrecompileList(context.journal().precompile_addresses().clone()); let _ = precompiles.register_callable(&mut self.ctx); diff --git a/src/tracing/mod.rs b/src/tracing/mod.rs index 328e2094..63cee351 100644 --- a/src/tracing/mod.rs +++ b/src/tracing/mod.rs @@ -245,7 +245,7 @@ impl TracingInspector { to: &Address, value: &U256, ) -> bool { - if context.journal_ref().contains_precompile(to) { + if context.journal_ref().precompile_addresses().contains(to) { // only if this is _not_ the root call return self.is_deep() && value.is_zero(); }