Skip to content

Commit ffc3b13

Browse files
committed
Switch to hashbrown in fuzzing
hashbrown by default uses ahash, which may be a bit faster, but more importantly, if we upgrade to hashbrown 0.13/ahash 0.8 we can make it use a constant randomization factor, making fuzzers happier.
1 parent 14900d9 commit ffc3b13

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

fuzz/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ libfuzzer_fuzz = ["libfuzzer-sys"]
1818
stdin_fuzz = []
1919

2020
[dependencies]
21-
afl = { version = "0.12", optional = true }
22-
lightning = { path = "../lightning", features = ["regex"] }
21+
lightning = { path = "../lightning", features = ["regex", "hashbrown"] }
2322
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync" }
2423
bitcoin = { version = "0.29.0", features = ["secp-lowmemory"] }
2524
hex = "0.3"
25+
hashbrown = "0.8"
26+
27+
afl = { version = "0.12", optional = true }
2628
honggfuzz = { version = "0.5", optional = true, default-features = false }
2729
libfuzzer-sys = { version = "0.4", optional = true }
2830

fuzz/src/chanmon_consistency.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ use bitcoin::secp256k1::Secp256k1;
6161

6262
use std::mem;
6363
use std::cmp::{self, Ordering};
64-
use std::collections::{HashSet, hash_map, HashMap};
64+
use hashbrown::{HashSet, hash_map, HashMap};
6565
use std::sync::{Arc,Mutex};
6666
use std::sync::atomic;
6767
use std::io::Cursor;

fuzz/src/full_stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ use bitcoin::secp256k1::ecdsa::RecoverableSignature;
5858
use bitcoin::secp256k1::Secp256k1;
5959

6060
use std::cell::RefCell;
61-
use std::collections::{HashMap, hash_map};
61+
use hashbrown::{HashMap, hash_map};
6262
use std::convert::TryInto;
6363
use std::cmp;
6464
use std::sync::{Arc, Mutex};

0 commit comments

Comments
 (0)