From ea12e77b1c26fac1b2dafb99a32805a0b5ae6b7a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 6 Nov 2024 15:41:47 +0000 Subject: [PATCH] Limit `full_stack` fuzz runtime by limiting block connection ops --- fuzz/src/full_stack.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs index be40af501..6fd444c2b 100644 --- a/fuzz/src/full_stack.rs +++ b/fuzz/src/full_stack.rs @@ -309,6 +309,14 @@ impl<'a> MoneyLossDetector<'a> { } fn connect_block(&mut self, all_txn: &[Transaction]) { + if self.blocks_connected > 100_000 { + // Connecting blocks is relatively slow, and some commands can connect many blocks. + // This can inflate the total runtime substantially, leading to spurious timeouts. + // Instead, because block connection rate is expected to be limited by PoW, simply + // start ignoring blocks after the first 100k. + return; + } + let mut txdata = Vec::with_capacity(all_txn.len()); for (idx, tx) in all_txn.iter().enumerate() { let txid = tx.compute_txid(); -- 2.39.5