From 0fb8b8edd22ebf6820ca29c118e88e222ebc1056 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 9 Feb 2024 10:18:50 -0800 Subject: [PATCH] chore: remove ahash (#1991) We don't really have a good reason to use it, so we might as well stick to the standard `HashMap`. --- Cargo.lock | 4 ---- Cargo.toml | 1 - ipld/amt/fuzz/Cargo.toml | 1 - ipld/amt/fuzz/fuzz_targets/equivalence.rs | 6 ++++-- ipld/hamt/fuzz/Cargo.toml | 1 - ipld/hamt/fuzz/fuzz_targets/common.rs | 4 +++- ipld/kamt/fuzz/Cargo.toml | 1 - ipld/kamt/fuzz/fuzz_targets/common.rs | 4 +++- 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c6436893..a27608c71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,7 +44,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", - "getrandom", "once_cell", "version_check", "zerocopy", @@ -3111,7 +3110,6 @@ dependencies = [ name = "ipld_amt_fuzz" version = "0.0.0" dependencies = [ - "ahash", "arbitrary", "cid 0.10.1", "fvm_ipld_amt 0.6.2", @@ -3124,7 +3122,6 @@ dependencies = [ name = "ipld_hamt-fuzz" version = "0.0.0" dependencies = [ - "ahash", "arbitrary", "fvm_ipld_blockstore 0.2.0", "fvm_ipld_hamt 0.9.0", @@ -3135,7 +3132,6 @@ dependencies = [ name = "ipld_kamt-fuzz" version = "0.0.0" dependencies = [ - "ahash", "arbitrary", "fvm_ipld_blockstore 0.2.0", "fvm_ipld_kamt 0.3.0", diff --git a/Cargo.toml b/Cargo.toml index a0a43f95e..93f1cc618 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,6 @@ wasmtime-runtime = { version = "12.0.2", default-features = false } # misc libfuzzer-sys = "0.4" arbitrary = "1.3.0" -ahash = "0.8.7" itertools = "0.11.0" once_cell = "1.18.0" unsigned-varint = "0.7.2" diff --git a/ipld/amt/fuzz/Cargo.toml b/ipld/amt/fuzz/Cargo.toml index 082d9a841..ff8099aed 100644 --- a/ipld/amt/fuzz/Cargo.toml +++ b/ipld/amt/fuzz/Cargo.toml @@ -11,7 +11,6 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = { workspace = true } arbitrary = { workspace = true, features = ["derive"] } -ahash = { workspace = true } itertools = { workspace = true } cid = { workspace = true, features = ["serde-codec", "arb", "std"] } diff --git a/ipld/amt/fuzz/fuzz_targets/equivalence.rs b/ipld/amt/fuzz/fuzz_targets/equivalence.rs index 15ac8b7b9..f2a155152 100644 --- a/ipld/amt/fuzz/fuzz_targets/equivalence.rs +++ b/ipld/amt/fuzz/fuzz_targets/equivalence.rs @@ -3,6 +3,8 @@ // SPDX-License-Identifier: Apache-2.0, MIT #![no_main] +use std::collections::HashMap; + use arbitrary::Arbitrary; use cid::Cid; use fvm_ipld_amt::Amt; @@ -22,10 +24,10 @@ enum Method { Remove, Get, } -fn execute(ops: Vec) -> (Cid, ahash::AHashMap) { +fn execute(ops: Vec) -> (Cid, HashMap) { let db = fvm_ipld_blockstore::MemoryBlockstore::default(); let mut amt = Amt::new(&db); - let mut elements = ahash::AHashMap::new(); + let mut elements = HashMap::new(); for (i, Operation { idx, method, flush }) in ops.into_iter().enumerate() { let idx = idx as u64; diff --git a/ipld/hamt/fuzz/Cargo.toml b/ipld/hamt/fuzz/Cargo.toml index a6f85c0cc..9354820e6 100644 --- a/ipld/hamt/fuzz/Cargo.toml +++ b/ipld/hamt/fuzz/Cargo.toml @@ -11,7 +11,6 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = { workspace = true } arbitrary = { workspace = true, features = ["derive"] } -ahash = { workspace = true } fvm_ipld_hamt = { workspace = true } fvm_ipld_blockstore = { workspace = true } diff --git a/ipld/hamt/fuzz/fuzz_targets/common.rs b/ipld/hamt/fuzz/fuzz_targets/common.rs index e24172315..3869b1127 100644 --- a/ipld/hamt/fuzz/fuzz_targets/common.rs +++ b/ipld/hamt/fuzz/fuzz_targets/common.rs @@ -2,6 +2,8 @@ // Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT +use std::collections::HashMap; + use arbitrary::Arbitrary; use fvm_ipld_hamt::{Config, Hamt}; @@ -21,7 +23,7 @@ pub enum Method { pub fn run(flush_rate: u8, operations: Vec, conf: Config) { let db = fvm_ipld_blockstore::MemoryBlockstore::default(); let mut hamt = Hamt::<_, _, _>::new_with_config(&db, conf); - let mut elements = ahash::AHashMap::new(); + let mut elements = HashMap::new(); let flush_rate = (flush_rate as usize).saturating_add(5); for (i, Operation { key, method }) in operations.into_iter().enumerate() { diff --git a/ipld/kamt/fuzz/Cargo.toml b/ipld/kamt/fuzz/Cargo.toml index 739508725..dc341cfdf 100644 --- a/ipld/kamt/fuzz/Cargo.toml +++ b/ipld/kamt/fuzz/Cargo.toml @@ -11,7 +11,6 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = { workspace = true } arbitrary = { workspace = true, features = ["derive"] } -ahash = { workspace = true } fvm_ipld_kamt = { workspace = true } fvm_ipld_blockstore = { workspace = true } diff --git a/ipld/kamt/fuzz/fuzz_targets/common.rs b/ipld/kamt/fuzz/fuzz_targets/common.rs index ce52227cb..f64fd9a7c 100644 --- a/ipld/kamt/fuzz/fuzz_targets/common.rs +++ b/ipld/kamt/fuzz/fuzz_targets/common.rs @@ -2,6 +2,8 @@ // Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT +use std::collections::HashMap; + use arbitrary::Arbitrary; use fvm_ipld_kamt::id::Identity; use fvm_ipld_kamt::{Config, Kamt}; @@ -22,7 +24,7 @@ pub enum Method { pub fn run(flush_rate: u8, operations: Vec, conf: Config) { let db = fvm_ipld_blockstore::MemoryBlockstore::default(); let mut kamt = Kamt::<_, u64, u64, Identity>::new_with_config(&db, conf); - let mut elements = ahash::AHashMap::new(); + let mut elements = HashMap::new(); let flush_rate = (flush_rate as usize).saturating_add(5); for (i, Operation { key, method }) in operations.into_iter().enumerate() {