test: make orphanage_dos_many fill the orphanage #36407

pull fametrano wants to merge 1 commits into bitcoin:master from fametrano:test-orphanage-dos-many-inv changing 1 files +11 −5
  1. fametrano commented at 9:28 PM on October 1, 2026: contributor

    test_orphanage_dos_many checks that a normal peer's orphan survives while DoS peers flood the orphanage. I found that the orphanage never fills: the 60 peers send the same 51 orphans as tx, and a tx already held as an orphan is dropped in ReceivedTx without recording its sender. The orphanage peaks at 152 announcements against a limit of 3000, so nothing is evicted.

    Here the first peer sends the orphans and the other 59 announce them by inv, which does add them as announcers. The test now asserts that the orphanage holds 3000 announcements, instead of asserting on what it sends. It takes about as long as before.

    If LimitOrphans is changed to evict the normal peer's orphan first, the test used to pass and now fails. (test_orphanage_dos_large already catches that change.)

    Found while porting these tests to https://github.com/btclib-org/bitcoin-node-tests.

    Written with LLM, a computer and the Internet; the mistakes, as usual, are all mine.

  2. test: make orphanage_dos_many fill the orphanage
    test_orphanage_dos_many had 60 peers send the same 51 orphans as tx
    messages. Only the first peer is recorded as announcer: the node ignores
    a tx that is already an orphan. The orphanage held at most 152
    announcements against a limit of 3000, so nothing was evicted and the
    check that the normal peer's orphan survives could not fail.
    
    Have the other 59 peers announce the orphans by inv, which does add them
    as announcers, and check that the orphanage holds 3000 announcements.
    
    A node that evicts the normal peer's orphan first now fails this test at
    the wait for that orphan. Before, it passed.
    86ff13a0af
  3. DrahtBot added the label Tests on Oct 1, 2026
  4. DrahtBot commented at 9:28 PM on October 1, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK instagibbs

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. DrahtBot added the label CI failed on Oct 1, 2026
  6. instagibbs commented at 5:21 PM on October 2, 2026: member

    ACK 86ff13a0af0679ee0c725bac9c64c3e373cb0283

    I remember writing/reviewing this slop, thanks for fixing it with something we didn't consider!

    Test failure seems unrelated


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: 2026-10-04 22:51 UTC

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