From: Matt Corallo Date: Wed, 6 Nov 2024 15:41:47 +0000 (+0000) Subject: Limit `full_stack` fuzz runtime by limiting block connection ops X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2024-07-fst-bolt12;p=rust-lightning Limit `full_stack` fuzz runtime by limiting block connection ops --- 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();