Repository navigation
Closed
Description
Seems wasteful to spend time in TopUp while fuzzing, so my recommendation would be to limit TopUp iterations a bit.
Run scriptpubkeyman with args ['/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz', '-runs=1', PosixPath('/ci_container_base/ci/scratch/qa-assets/fuzz_seed_corpus/scriptpubkeyman')]INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 3840853548
INFO: Loaded 1 modules (623498 inline 8-bit counters): 623498 [0x5572c2e0a518, 0x5572c2ea28a2),
INFO: Loaded 1 PC tables (623498 PCs): 623498 [0x5572c2ea28a8,0x5572c3826148),
INFO: 8841 files found in /ci_container_base/ci/scratch/qa-assets/fuzz_seed_corpus/scriptpubkeyman
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 924704 bytes
INFO: seed corpus: files: 8841 min: 1b max: 924704b total: 49718183b rss: 173Mb
#128 pulse cov: 12139 ft: 24855 corp: 125/930b exec/s: 25 rss: 191Mb
#256 pulse cov: 15522 ft: 49362 corp: 251/2416b exec/s: 4 rss: 286Mb
#512 pulse cov: 19356 ft: 64381 corp: 483/6374b exec/s: 3 rss: 448Mb
Slowest unit: 18 s:
artifact_prefix='./'; Test unit written to ./slow-unit-c9b8928cecb1edc192fb2d5816b4b7878cdfcf50
Base64: dHIoJTI5LzMvKicpXCUprSlUVO3t/e3t7e3tra2t7e0=
#1024 pulse cov: 21215 ft: 88717 corp: 877/17Kb exec/s: 2 rss: 610Mb
#2048 pulse cov: 21835 ft: 104559 corp: 1467/57Kb exec/s: 2 rss: 653Mb
#4096 pulse cov: 23163 ft: 120057 corp: 2005/171Kb exec/s: 2 rss: 694Mb
#8192 pulse cov: 24591 ft: 135480 corp: 2490/1045Kb exec/s: 3 rss: 849Mb
#8844 INITED cov: 24681 ft: 137958 corp: 2568/7024Kb exec/s: 3 rss: 1001Mb
#8844 DONE cov: 24681 ft: 137958 corp: 2568/7024Kb lim: 793168 exec/s: 3 rss: 1001Mb
Done 8844 runs in 2763 second(s)
$ FUZZ=scriptpubkeyman perf record -g --call-graph dwarf ./src/test/fuzz/fuzz -runs=10 ./qa-assets/fuzz_seed_corpus/scriptpubkeyman/c9b8928cecb1edc192fb2d5816b4b7878cdfcf50
$ hotspot ./perf.data

Activity
brunoerg commentedon Jul 19, 2024
Instead of calling
TopUpevery time we callAddDescriptorKey, maybe it could be done just one time per iteration. I can see it.Also, there are other functions,
GetNewDestination,MarkUnusedAddressesandAddWalletDescriptorthat internally callTopUp().brunoerg commentedon Jul 20, 2024
Forget, reducing keypool size should be enough. Just opened #30494.
Merge bitcoin#30494: fuzz: reduce keypool size in `scriptpubkeyman` t…
Merge bitcoin#30494: fuzz: reduce keypool size in `scriptpubkeyman` t…
Merge bitcoin#30494: fuzz: reduce keypool size in `scriptpubkeyman` t…
Merge bitcoin#30494: fuzz: reduce keypool size in `scriptpubkeyman` t…
Merge bitcoin#30494: fuzz: reduce keypool size in `scriptpubkeyman` t…
Merge bitcoin#30494: fuzz: reduce keypool size in `scriptpubkeyman` t…
Merge bitcoin#30494: fuzz: reduce keypool size in `scriptpubkeyman` t…