This adds coverage in the existing tx_pool harness for the ExtractBestByMiningScoreWithTopology method recently added in #34628.
fuzz: cover the mempool interface for transaction announcement #35856
pull darosior wants to merge 1 commits into bitcoin:master from darosior:2607_fuzz_mem_inv changing 1 files +48 −0-
darosior commented at 7:46 PM on July 31, 2026: member
-
dd2561003d
fuzz: cover the mempool interface for transaction announcement
This adds coverage for the recently-added ExtractBestByMiningScoreWithTopology method.
- DrahtBot added the label Fuzzing on Jul 31, 2026
-
DrahtBot commented at 7:46 PM on July 31, 2026: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35856.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline and AI policy for information on the review process.
Type Reviewers ACK dergoegge If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
-
in src/test/fuzz/tx_pool.cpp:127 in dd2561003d
122 | +{ 123 | + LOCK(tx_pool.cs); 124 | + std::vector<Wtxid> res; 125 | + 126 | + uint8_t dummy{0}; 127 | + const auto mempool_entries{tx_pool.entryAll()};
maflcko commented at 10:35 AM on August 3, 2026:const auto mempool_entries{WITH_LOCK(tx_pool.cs, return tx_pool.entryAll())};nit: Doesn't matter, but can scope the mempool lock.
dergoegge approveddergoegge commented at 10:51 AM on August 3, 2026: memberutACK dd2561003dd2766f1ac872e5055bb526c11dc217
in src/test/fuzz/tx_pool.cpp:198 in dd2561003d
193 | + // not correspond to a mempool entry.. 194 | + const auto is_in_mempool = [&](const auto& wtxid) EXCLUSIVE_LOCKS_REQUIRED(tx_pool.cs) { return tx_pool.GetIter(wtxid).has_value(); }; 195 | + Assert(WITH_LOCK(tx_pool.cs, return std::ranges::all_of(wtxids_to_relay, is_in_mempool))); 196 | + // ..As well as all duplicates. 197 | + const auto wtxids_count{wtxids_to_relay.size()}; 198 | + const std::set<Wtxid> unique_wtxids{std::make_move_iterator(wtxids_to_relay.begin()), std::make_move_iterator(wtxids_to_relay.end())};
maflcko commented at 10:56 AM on August 3, 2026:nit: they are in direct memory, not indirect, so the move is redundant/confusing and actually a copy. Could just write:
const std::set unique_wtxids(wtxids_to_relay.begin(), wtxids_to_relay.end());
darosior commented at 1:55 PM on August 3, 2026:Ah, right. Will be more careful next time (or have my bot review, it should catch this type of stuff).
fanquake merged this on Aug 3, 2026fanquake closed this on Aug 3, 2026maflcko commented at 11:08 AM on August 3, 2026: memberlgtm ACK dd2561003dd2766f1ac872e5055bb526c11dc217
darosior deleted the branch on Aug 3, 2026
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-05 03:51 UTC
More mirrored repositories can be found on mirror.b10c.me