Skip to content

Commit

Permalink
precompile addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita committed Dec 26, 2024
1 parent 8e703f3 commit 26703d2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
] }

Expand All @@ -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",
] }

Expand Down
3 changes: 2 additions & 1 deletion src/tracing/js/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/peterolson/BigInteger.js>.
pub(crate) const BIG_INT_JS: &str = include_str!("bigint.js");
Expand Down
7 changes: 2 additions & 5 deletions src/tracing/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -383,13 +382,11 @@ impl JsInspector {
}

/// Registers the precompiles in the JS context
fn register_precompiles<CTX: JournalGetter>(&mut self, _context: &mut CTX) {
fn register_precompiles<CTX: JournalGetter>(&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);

Expand Down
2 changes: 1 addition & 1 deletion src/tracing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 26703d2

Please sign in to comment.