fuzz: add basic TxOrphanage::EraseForBlock cov #31918

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:2025-02-orphanage-eraseforblock changing 1 files +18 −0
  1. instagibbs commented at 7:07 pm on February 20, 2025: member
    Currently uncovered
  2. fuzz: add basic TxOrphanage::EraseForBlock cov 8400b742fa
  3. DrahtBot commented at 7:07 pm on February 20, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31918.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK dergoegge, marcofleon

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on Feb 20, 2025
  5. fanquake requested review from glozow on Feb 20, 2025
  6. fanquake requested review from marcofleon on Feb 20, 2025
  7. dergoegge approved
  8. dergoegge commented at 9:05 am on February 21, 2025: member
    utACK 8400b742fa6dda4ad89311f547ccf50b0187e817
  9. marcofleon commented at 11:51 am on February 21, 2025: contributor

    ACK 8400b742fa6dda4ad89311f547ccf50b0187e817

    Ran the target and checked coverage to be sure, lgtm.

  10. fanquake merged this on Feb 21, 2025
  11. fanquake closed this on Feb 21, 2025

  12. in src/test/fuzz/txorphan.cpp:207 in 8400b742fa
    198@@ -195,6 +199,20 @@ FUZZ_TARGET(txorphan, .init = initialize_orphanage)
    199                     Assert(!orphanage.HaveTxFromPeer(tx->GetWitnessHash(), peer_id));
    200                     Assert(orphanage.UsageByPeer(peer_id) == 0);
    201                 },
    202+                [&] {
    203+                    // Make a block out of txs and then EraseForBlock
    204+                    CBlock block;
    205+                    int num_txs = fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(0, 1000);
    206+                    for (int i{0}; i < num_txs; ++i) {
    207+                        auto& tx_to_remove = PickValue(fuzzed_data_provider, tx_history);
    


    glozow commented at 4:14 pm on February 24, 2025:
    Maybe would have been cool to make the fuzzer generate a tx, that way can have non-identical but conflicting txns.
  13. glozow commented at 4:14 pm on February 24, 2025: member
    post merge code review ACK

github-metadata-mirror

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: 2025-03-29 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me