From 7a975809975834b49209f5d854c877b6dd9e81de Mon Sep 17 00:00:00 2001 From: marcofleon Date: Thu, 14 May 2026 12:32:04 +0100 Subject: [PATCH] fuzz: Fix txorphan timeout by limiting block weight Github-Pull: #35289 Rebased-From: 004a7e3cfbc5b2118536651d2201cf8b72c87736 --- src/test/fuzz/txorphan.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/fuzz/txorphan.cpp b/src/test/fuzz/txorphan.cpp index f6720ffb897..ef26fe429f3 100644 --- a/src/test/fuzz/txorphan.cpp +++ b/src/test/fuzz/txorphan.cpp @@ -196,9 +196,13 @@ FUZZ_TARGET(txorphan, .init = initialize_orphanage) [&] { // Make a block out of txs and then EraseForBlock CBlock block; + int64_t block_weight{0}; int num_txs = fuzzed_data_provider.ConsumeIntegralInRange(0, 1000); for (int i{0}; i < num_txs; ++i) { auto& tx_to_remove = PickValue(fuzzed_data_provider, tx_history); + const auto tx_weight = GetTransactionWeight(*tx_to_remove); + if (block_weight + tx_weight > MAX_BLOCK_WEIGHT) break; + block_weight += tx_weight; block.vtx.push_back(tx_to_remove); } orphanage->EraseForBlock(block);