From 30aba591b10384440d1d2f1df43eebbac3d0c88a Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:27:18 +0200 Subject: [PATCH] fix: re-enable foldhash by default, but exclude it from zkvm --- crates/core/Cargo.toml | 1 + crates/primitives/Cargo.toml | 2 +- crates/primitives/src/map/mod.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 74288adf1..172e8d60d 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -60,6 +60,7 @@ tiny-keccak = ["alloy-primitives/tiny-keccak"] map = ["alloy-primitives/map"] map-hashbrown = ["alloy-primitives/map-hashbrown"] map-indexmap = ["alloy-primitives/map-indexmap"] +map-foldhash = ["alloy-primitives/map-foldhash"] map-fxhash = ["alloy-primitives/map-fxhash"] getrandom = ["alloy-primitives/getrandom"] diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index e7e1572db..9fd6ad059 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -95,7 +95,7 @@ criterion.workspace = true serde_json.workspace = true [features] -default = ["std", "map"] +default = ["std", "map", "map-foldhash"] std = [ "bytes/std", "hex/std", diff --git a/crates/primitives/src/map/mod.rs b/crates/primitives/src/map/mod.rs index 951fc12aa..466b3dd5d 100644 --- a/crates/primitives/src/map/mod.rs +++ b/crates/primitives/src/map/mod.rs @@ -115,7 +115,7 @@ cfg_if! { // Default hasher. cfg_if! { - if #[cfg(feature = "map-foldhash")] { + if #[cfg(all(feature = "map-foldhash", not(target_os = "zkvm")))] { type DefaultHashBuilderInner = foldhash::fast::RandomState; } else if #[cfg(feature = "map-fxhash")] { type DefaultHashBuilderInner = FxBuildHasher;