test: cover addnode connection limit #35624

pull beihaili wants to merge 1 commits into bitcoin:master from beihaili:codex/28635-addnode-limit-test changing 2 files +77 −0
  1. beihaili commented at 7:02 AM on June 30, 2026: none

    This PR adds functional test coverage for the MAX_ADDNODE_CONNECTIONS part of #28635.

    The issue also discusses a separate double-addnode / ThreadOpenAddedConnections timing problem. This PR does not try to cover that case. I kept this test focused on the connection limit because it can be checked through RPC behavior without mocking the networking thread timing.

    The test starts node0 and 9 reachable target nodes. node0 adds all 9 targets with addnode "add". It then checks that getaddednodeinfo() records 9 added nodes, while getpeerinfo() shows no more than 8 manual outbound connections. It also checks the count over a short stability window.

    So the behavior covered here is: Bitcoin Core may remember more than 8 added nodes, but active addnode/manual outbound connections are capped by MAX_ADDNODE_CONNECTIONS.

    Tested locally:

    • python3 -m py_compile test/functional/rpc_addnode_limits.py
    • test/functional/rpc_addnode_limits.py --configfile=build-clang/test/config.ini
    • test/functional/rpc_net.py --configfile=build-clang/test/config.ini
    • git diff --check
  2. test: cover addnode connection limit 3be5ceeee7
  3. DrahtBot added the label Tests on Jun 30, 2026
  4. DrahtBot commented at 7:02 AM on June 30, 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/35624.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK sedited

    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. sedited commented at 3:10 PM on June 30, 2026: contributor

    Concept ACK

    Your pull request description looks like it was generated by an LLM. Please completely write it in your own words to demonstrate to potential reviewers that you understand the changes proposed here.


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-07-02 02:51 UTC

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