mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-23 14:10:15 +01:00
Merge bitcoin/bitcoin#23157: txmempool -/-> validation 1/2: improve performance of check() and remove dependency on validation
082c5bf099[refactor] pass coinsview and height to check() (glozow)ed6115f1ea[mempool] simplify some check() logic (glozow)9e8d7ad5d9[validation/mempool] use Spend/AddCoin instead of UpdateCoins (glozow)09d18916afMOVEONLY: remove single-use helper func CheckInputsAndUpdateCoins (glozow)e8639ec26a[mempool] remove now-unnecessary code (glozow)54c6f3c1da[mempool] speed up check() by using coins cache and iterating in topo order (glozow)30e240f65e[bench] Benchmark CTxMemPool::check() (glozow)cb1407196f[refactor/bench] make mempool_stress bench reusable and parameterizable (glozow) Pull request description: Remove the txmempool <-> validation circular dependency by removing txmempool's dependency on validation. There are two functions in txmempool that need validation right now: `check()` and `removeForReorg()`. This PR removes the dependencies in `check()`. This PR also improves the performance of `CTxMemPool::check()` by walking through the entries exactly once, in ascending ancestorcount order, which guarantees that we see parents before children. ACKs for top commit: jnewbery: reACK082c5bf099GeneFerneau: tACK [082c5bf](082c5bf099) rajarshimaitra: tACK082c5bf099theStack: Code-review ACK082c5bf099Tree-SHA512: 40ac622af1627b5c3e6abb4f0f035d833265a8c5e8dc88faf5354875dfb5137f137825e54bbd2a2668ed37b145c5d02285f776402629f58596e51853a9a79d29
This commit is contained in:
@@ -81,7 +81,7 @@ void SetMempoolConstraints(ArgsManager& args, FuzzedDataProvider& fuzzed_data_pr
|
||||
|
||||
void Finish(FuzzedDataProvider& fuzzed_data_provider, MockedTxPool& tx_pool, CChainState& chainstate)
|
||||
{
|
||||
WITH_LOCK(::cs_main, tx_pool.check(chainstate));
|
||||
WITH_LOCK(::cs_main, tx_pool.check(chainstate.CoinsTip(), chainstate.m_chain.Height() + 1));
|
||||
{
|
||||
BlockAssembler::Options options;
|
||||
options.nBlockMaxWeight = fuzzed_data_provider.ConsumeIntegralInRange(0U, MAX_BLOCK_WEIGHT);
|
||||
@@ -97,7 +97,7 @@ void Finish(FuzzedDataProvider& fuzzed_data_provider, MockedTxPool& tx_pool, CCh
|
||||
std::vector<uint256> all_txids;
|
||||
tx_pool.queryHashes(all_txids);
|
||||
assert(all_txids.size() < info_all.size());
|
||||
WITH_LOCK(::cs_main, tx_pool.check(chainstate));
|
||||
WITH_LOCK(::cs_main, tx_pool.check(chainstate.CoinsTip(), chainstate.m_chain.Height() + 1));
|
||||
}
|
||||
SyncWithValidationInterfaceQueue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user