Skip to content

Commit ee3768b

Browse files
committed
Merge 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
1 parent 199ac79 commit ee3768b

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

‎src/test/fuzz/tx_pool.cpp‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ FUZZ_TARGET(tx_pool_standard, .init = initialize_tx_pool)
129129
auto& chainstate{static_cast<DummyChainState&>(node.chainman->ActiveChainstate())};
130130

131131
MockTime(fuzzed_data_provider, chainstate);
132-
SetMempoolConstraints(*node.args, fuzzed_data_provider);
133132

134133
// All RBF-spendable outpoints
135134
std::set<COutPoint> outpoints_rbf;
@@ -143,6 +142,7 @@ FUZZ_TARGET(tx_pool_standard, .init = initialize_tx_pool)
143142
// The sum of the values of all spendable outpoints
144143
constexpr CAmount SUPPLY_TOTAL{COINBASE_MATURITY * 50 * COIN};
145144

145+
SetMempoolConstraints(*node.args, fuzzed_data_provider);
146146
CTxMemPool tx_pool_{/*estimator=*/nullptr, /*check_ratio=*/1};
147147
MockedTxPool& tx_pool = *static_cast<MockedTxPool*>(&tx_pool_);
148148

@@ -211,9 +211,6 @@ FUZZ_TARGET(tx_pool_standard, .init = initialize_tx_pool)
211211
if (fuzzed_data_provider.ConsumeBool()) {
212212
MockTime(fuzzed_data_provider, chainstate);
213213
}
214-
if (fuzzed_data_provider.ConsumeBool()) {
215-
SetMempoolConstraints(*node.args, fuzzed_data_provider);
216-
}
217214
if (fuzzed_data_provider.ConsumeBool()) {
218215
tx_pool.RollingFeeUpdate();
219216
}
@@ -307,7 +304,6 @@ FUZZ_TARGET(tx_pool, .init = initialize_tx_pool)
307304
auto& chainstate{static_cast<DummyChainState&>(node.chainman->ActiveChainstate())};
308305

309306
MockTime(fuzzed_data_provider, chainstate);
310-
SetMempoolConstraints(*node.args, fuzzed_data_provider);
311307

312308
std::vector<uint256> txids;
313309
for (const auto& outpoint : g_outpoints_coinbase_init_mature) {
@@ -319,6 +315,7 @@ FUZZ_TARGET(tx_pool, .init = initialize_tx_pool)
319315
txids.push_back(ConsumeUInt256(fuzzed_data_provider));
320316
}
321317

318+
SetMempoolConstraints(*node.args, fuzzed_data_provider);
322319
CTxMemPool tx_pool_{/*estimator=*/nullptr, /*check_ratio=*/1};
323320
MockedTxPool& tx_pool = *static_cast<MockedTxPool*>(&tx_pool_);
324321

@@ -331,9 +328,6 @@ FUZZ_TARGET(tx_pool, .init = initialize_tx_pool)
331328
if (fuzzed_data_provider.ConsumeBool()) {
332329
MockTime(fuzzed_data_provider, chainstate);
333330
}
334-
if (fuzzed_data_provider.ConsumeBool()) {
335-
SetMempoolConstraints(*node.args, fuzzed_data_provider);
336-
}
337331
if (fuzzed_data_provider.ConsumeBool()) {
338332
tx_pool.RollingFeeUpdate();
339333
}

0 commit comments

Comments
 (0)