@@ -13,10 +13,19 @@ rm *_target.rs
13
13
[ " $( git diff) " != " " ] && exit 1
14
14
popd
15
15
16
+ export RUSTFLAGS=" --cfg=secp256k1_fuzz --cfg=hashes_fuzz"
17
+
18
+ mkdir -p hfuzz_workspace/full_stack_target/input
19
+ pushd write-seeds
20
+ RUSTFLAGS=" $RUSTFLAGS --cfg=fuzzing" cargo run ../hfuzz_workspace/full_stack_target/input
21
+ popd
22
+
16
23
cargo install --color always --force honggfuzz --no-default-features
24
+ # Because we're fuzzing relatively few iterations, the maximum possible
25
+ # compiler optimizations aren't necessary, so switch to defaults.
17
26
sed -i ' s/lto = true//' Cargo.toml
27
+ sed -i ' s/codegen-units = 1//' Cargo.toml
18
28
19
- export RUSTFLAGS=" --cfg=secp256k1_fuzz --cfg=hashes_fuzz"
20
29
export HFUZZ_BUILD_ARGS=" --features honggfuzz_fuzz"
21
30
22
31
cargo --color always hfuzz build
@@ -25,11 +34,13 @@ for TARGET in src/bin/*.rs; do
25
34
FILE=" ${FILENAME% .* } "
26
35
HFUZZ_RUN_ARGS=" --exit_upon_crash -v -n2"
27
36
if [ " $FILE " = " chanmon_consistency_target" ]; then
28
- HFUZZ_RUN_ARGS=" $HFUZZ_RUN_ARGS -F 64 -N100000"
29
- elif [ " $FILE " = " full_stack_target" ]; then
30
- HFUZZ_RUN_ARGS=" $HFUZZ_RUN_ARGS -t0 -N1000000"
37
+ HFUZZ_RUN_ARGS=" $HFUZZ_RUN_ARGS -F 64 -N5000"
38
+ elif [ " $FILE " = " process_network_graph_target" -o " $FILE " = " full_stack_target" -o " $FILE " = " router_target" ]; then
39
+ HFUZZ_RUN_ARGS=" $HFUZZ_RUN_ARGS -N50000"
40
+ elif [ " $FILE " = " indexedmap_target" ]; then
41
+ HFUZZ_RUN_ARGS=" $HFUZZ_RUN_ARGS -N500000"
31
42
else
32
- HFUZZ_RUN_ARGS=" $HFUZZ_RUN_ARGS -N1000000 "
43
+ HFUZZ_RUN_ARGS=" $HFUZZ_RUN_ARGS -N2500000 "
33
44
fi
34
45
export HFUZZ_RUN_ARGS
35
46
cargo --color always hfuzz run $FILE
0 commit comments