fuzz: Reduce iterations in slow targets
What changed, and why it matters
This commit only changes internal fuzz testing code. It reduces the number of loop iterations in three slow-running fuzz targets so the tests run faster. It does not touch any production Bitcoin Core code, network protocol, wallet, consensus, or mining logic, and it introduces no security-relevant behavior changes.
No security action needed. Treat as a normal test-maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch lowers iteration caps in fuzz harnesses: mini_miner from 500 to 100, tx_pool_standard from 300 to 100, and txdownloadman/txdownloadman_impl from 10000 to 500. These are test-only performance tuning changes inside src/test/fuzz/. They do not alter runtime validation, mempool policy, transaction download behavior, or any code reachable by end users or network peers.
Changed components
src/test/fuzz/mini_miner.cppsrc/test/fuzz/tx_pool.cppsrc/test/fuzz/txdownloadman.cppInspect captured patch +4 / −4
diff --git a/src/test/fuzz/mini_miner.cpp b/src/test/fuzz/mini_miner.cpp
index 9c3ec7de..a0c16c51 100644
--- a/src/test/fuzz/mini_miner.cpp
+++ b/src/test/fuzz/mini_miner.cpp
@@ -50,7 +50,7 @@ FUZZ_TARGET(mini_miner, .init = initialize_miner)
std::deque<COutPoint> available_coins = g_available_coins;
LOCK2(::cs_main, pool.cs);
// Cluster size cannot exceed 500
- LIMITED_WHILE(!available_coins.empty(), 500)
+ LIMITED_WHILE(!available_coins.empty(), 100)
{
CMutableTransaction mtx = CMutableTransaction();
const size_t num_inputs = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, available_coins.size());
diff --git a/src/test/fuzz/tx_pool.cpp b/src/test/fuzz/tx_pool.cpp
index 4245d3e1..90155d38 100644
--- a/src/test/fuzz/tx_pool.cpp
+++ b/src/test/fuzz/tx_pool.cpp
@@ -223,7 +223,7 @@ FUZZ_TARGET(tx_pool_standard, .init = initialize_tx_pool)
return coin.out.nValue;
};
- LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 300)
+ LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 100)
{
{
// Total supply is the mempool fee + all outpoints
diff --git a/src/test/fuzz/txdownloadman.cpp b/src/test/fuzz/txdownloadman.cpp
index bdca947c..2bb64eeb 100644
--- a/src/test/fuzz/txdownloadman.cpp
+++ b/src/test/fuzz/txdownloadman.cpp
@@ -178,7 +178,7 @@ FUZZ_TARGET(txdownloadman, .init = initialize)
std::chrono::microseconds time{244466666};
- LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000)
+ LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 500)
{
NodeId rand_peer = fuzzed_data_provider.ConsumeIntegralInRange<int64_t>(0, NUM_PEERS - 1);
@@ -303,7 +303,7 @@ FUZZ_TARGET(txdownloadman_impl, .init = initialize)
std::chrono::microseconds time{244466666};
- LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000)
+ LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 500)
{
NodeId rand_peer = fuzzed_data_provider.ConsumeIntegralInRange<int64_t>(0, NUM_PEERS - 1);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.