Skip to content

Commit 2b3f43b

Browse files
committed
Merge bitcoin#28789: fuzz: Avoid utxo_total_supply timeout (take 2)
fa7ba92 fuzz: Avoid utxo_total_supply timeout (MarcoFalke) Pull request description: Looks like this still may take a long time to run large fuzz inputs. Thus, reduce it further, but still allow it to catch the regression, if re-introduced: ```diff diff --git a/src/consensus/tx_check.cpp b/src/consensus/tx_check.cpp index f949655..4bdd15c5ee 100644 --- a/src/consensus/tx_check.cpp +++ b/src/consensus/tx_check.cpp @@ -40,7 +40,7 @@ bool CheckTransaction(const CTransaction& tx, TxValidationState& state) std::set<COutPoint> vInOutPoints; for (const auto& txin : tx.vin) { if (!vInOutPoints.insert(txin.prevout).second) - return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-inputs-duplicate"); + {}//return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-inputs-duplicate"); } if (tx.IsCoinBase()) ``` This is the second take, see bitcoin#27780. If in the future it still times out, I think the fuzz test can just be removed. Example input: ``` JREROy5pcnAgQyw7IC4ODg4ODg4ODg4O0dEODg4ODg4ZDg4ODg4ODg4ODg7RDg4ODg4ODg4O0dEODg4ODg4ODg4ODg7R0Q4ODg4ODg4ODtHRDg4ODtHR0dEODg4O0dEODg7R0Q4ODg4ODg4ODtHRDg4ODg4ODg4ODg4O0dEODg4ODg4ODg7R0Q4ODg7R0Q4O0dEODg4ODg4ODg4ODg7R0Q4ODg4ODtHRDg4ODtHR ACKs for top commit: dergoegge: ACK fa7ba92 brunoerg: utACK fa7ba92 Tree-SHA512: 154a4895834babede6ce7b775562a7026637af1097e53e55676e92f6cf966ae0c092300ebf7e51a397eebd11f7b41d020586663e781f70d084efda1c0fe851b4
2 parents 0387ca0 + fa7ba92 commit 2b3f43b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/fuzz/utxo_total_supply.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ FUZZ_TARGET(utxo_total_supply)
9494
assert(ActiveHeight() == 0);
9595
// Get at which height we duplicate the coinbase
9696
// Assuming that the fuzzer will mine relatively short chains (less than 200 blocks), we want the duplicate coinbase to be not too high.
97-
// Up to 2000 seems reasonable.
98-
int64_t duplicate_coinbase_height = fuzzed_data_provider.ConsumeIntegralInRange(0, 20 * COINBASE_MATURITY);
97+
// Up to 300 seems reasonable.
98+
int64_t duplicate_coinbase_height = fuzzed_data_provider.ConsumeIntegralInRange(0, 300);
9999
// Always pad with OP_0 at the end to avoid bad-cb-length error
100100
const CScript duplicate_coinbase_script = CScript() << duplicate_coinbase_height << OP_0;
101101
// Mine the first block with this duplicate
@@ -121,7 +121,7 @@ FUZZ_TARGET(utxo_total_supply)
121121

122122
// Limit to avoid timeout, but enough to cover duplicate_coinbase_height
123123
// and CVE-2018-17144.
124-
LIMITED_WHILE(fuzzed_data_provider.remaining_bytes(), 2'000)
124+
LIMITED_WHILE(fuzzed_data_provider.remaining_bytes(), 2'00)
125125
{
126126
CallOneOf(
127127
fuzzed_data_provider,

0 commit comments

Comments
 (0)