Skip to content

Commit

Permalink
add faster-hash gate
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsing committed May 9, 2024
1 parent e1e8f7a commit 91f161f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/interpreter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ serde = ["dep:serde", "revm-primitives/serde"]
arbitrary = ["std", "revm-primitives/arbitrary"]
asm-keccak = ["revm-primitives/asm-keccak"]
portable = ["revm-primitives/portable"]
faster-hash = ["revm-primitives/faster-hash"]

optimism = ["revm-primitives/optimism"]
# Optimism default handler enabled Optimism handler register by default in EvmBuilder.
Expand Down
2 changes: 2 additions & 0 deletions crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ portable = ["revm-primitives/portable", "c-kzg?/portable"]
# In Linux it passes. If you don't require to build wasm on win/mac, it is safe to use it and it is enabled by default.
secp256k1 = ["dep:secp256k1"]

faster-hash = ["revm-primitives/faster-hash"]

[[bench]]
name = "bench"
path = "benches/bench.rs"
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ serde = [
arbitrary = ["std", "alloy-primitives/arbitrary", "bitflags/arbitrary"]
asm-keccak = ["alloy-primitives/asm-keccak"]
portable = ["c-kzg?/portable"]
faster-hash = ["hashbrown/ahash"]

optimism = []
# Optimism default handler enabled Optimism handler register by default in EvmBuilder.
Expand Down
4 changes: 3 additions & 1 deletion crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ pub use constants::*;
pub use env::*;

cfg_if::cfg_if! {
if #[cfg(feature = "std")] {
if #[cfg(feature = "faster-hash")] {
pub use hashbrown::{hash_map, hash_set, HashMap, HashSet};
} else if #[cfg(feature = "std")] {
pub use std::collections::{hash_map, hash_set, HashMap, HashSet};
use hashbrown as _;
} else {
Expand Down
1 change: 1 addition & 0 deletions crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ serde-json = ["serde", "dep:serde_json"]
arbitrary = ["revm-interpreter/arbitrary"]
asm-keccak = ["revm-interpreter/asm-keccak", "revm-precompile/asm-keccak"]
portable = ["revm-precompile/portable", "revm-interpreter/portable"]
faster-hash = ["revm-interpreter/faster-hash", "revm-precompile/faster-hash"]

test-utils = []

Expand Down

0 comments on commit 91f161f

Please sign in to comment.