Skip to content

Commit 31c1b14

Browse files
committed
Merge bitcoin/bitcoin#25689: fuzz: Remove no-op SetMempoolConstraints
fa57c44 fuzz: Remove no-op SetMempoolConstraints (MacroFake) Pull request description: Now that the mempool no longer uses the args manager (after commit e4e201d), there is no point setting the mempool limits after it is constructed. Fix that by setting them once right before the mempool is constructed. ACKs for top commit: dongcarl: utACK fa57c44 glozow: utACK fa57c44 Tree-SHA512: d236f9cdcee8c2076272b82c97f8a5942f1ecf119ab36edafd42088ef97554592348a61e1fbe504fd52b30301ef0177813042599ad12e8cb95b4a20586c85bb0
2 parents a65f6d8 + fa57c44 commit 31c1b14

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/test/fuzz/tx_pool.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
136136
auto& chainstate{static_cast<DummyChainState&>(node.chainman->ActiveChainstate())};
137137

138138
MockTime(fuzzed_data_provider, chainstate);
139-
SetMempoolConstraints(*node.args, fuzzed_data_provider);
140139

141140
// All RBF-spendable outpoints
142141
std::set<COutPoint> outpoints_rbf;
@@ -150,6 +149,7 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
150149
// The sum of the values of all spendable outpoints
151150
constexpr CAmount SUPPLY_TOTAL{COINBASE_MATURITY * 50 * COIN};
152151

152+
SetMempoolConstraints(*node.args, fuzzed_data_provider);
153153
CTxMemPool tx_pool_{MakeMempool(node)};
154154
MockedTxPool& tx_pool = *static_cast<MockedTxPool*>(&tx_pool_);
155155

@@ -220,9 +220,6 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
220220
if (fuzzed_data_provider.ConsumeBool()) {
221221
MockTime(fuzzed_data_provider, chainstate);
222222
}
223-
if (fuzzed_data_provider.ConsumeBool()) {
224-
SetMempoolConstraints(*node.args, fuzzed_data_provider);
225-
}
226223
if (fuzzed_data_provider.ConsumeBool()) {
227224
tx_pool.RollingFeeUpdate();
228225
}
@@ -316,7 +313,6 @@ FUZZ_TARGET_INIT(tx_pool, initialize_tx_pool)
316313
auto& chainstate = node.chainman->ActiveChainstate();
317314

318315
MockTime(fuzzed_data_provider, chainstate);
319-
SetMempoolConstraints(*node.args, fuzzed_data_provider);
320316

321317
std::vector<uint256> txids;
322318
for (const auto& outpoint : g_outpoints_coinbase_init_mature) {
@@ -328,6 +324,7 @@ FUZZ_TARGET_INIT(tx_pool, initialize_tx_pool)
328324
txids.push_back(ConsumeUInt256(fuzzed_data_provider));
329325
}
330326

327+
SetMempoolConstraints(*node.args, fuzzed_data_provider);
331328
CTxMemPool tx_pool_{MakeMempool(node)};
332329
MockedTxPool& tx_pool = *static_cast<MockedTxPool*>(&tx_pool_);
333330

@@ -338,9 +335,6 @@ FUZZ_TARGET_INIT(tx_pool, initialize_tx_pool)
338335
if (fuzzed_data_provider.ConsumeBool()) {
339336
MockTime(fuzzed_data_provider, chainstate);
340337
}
341-
if (fuzzed_data_provider.ConsumeBool()) {
342-
SetMempoolConstraints(*node.args, fuzzed_data_provider);
343-
}
344338
if (fuzzed_data_provider.ConsumeBool()) {
345339
tx_pool.RollingFeeUpdate();
346340
}

0 commit comments

Comments
 (0)