Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: Favor peers from addrman over fetching seednodes #29605

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on May 6, 2024

  1. net: Favor peers from addrman over fetching seednodes

    The current behavior of seednode fetching is pretty eager: we do it as the first
    step under `ThreadOpenNetworkConnections` even if some peers may be queryable
    from our addrman. This poses two potential issues:
    
    - First, if permanently set (e.g. running with seednode in a config file) we'd
    be signaling such seed every time we restart our node
    - Second, we will be giving the seed node way too much influence over our addrman,
    populating the latter even with data from the former even when unnecessary
    
    This changes the behavior to only add seednodes to `m_addr_fetch` if our addrman
    is empty, or little by little after we've spent some time trying addresses from
    our addrman. Also, seednodes are added to `m_addr_fetch` in random order, to avoid
    signaling the same node in case more than one seed is added and we happen to try
    them over multiple restarts
    sr-gi committed May 6, 2024
    Configuration menu
    Copy the full SHA
    94f4a46 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2024

  1. net: Pass along seed_nodes instead of storing in a member

    Avoids bloating CConnman with state that is only used during startup.
    cbergqvist authored and sr-gi committed May 13, 2024
    Configuration menu
    Copy the full SHA
    a28546e View commit details
    Browse the repository at this point in the history
  2. test: adds seednode functional tests

    Adds functional tests to test the interaction between seednode and the AddrMan
    sr-gi committed May 13, 2024
    Configuration menu
    Copy the full SHA
    b41bbd5 View commit details
    Browse the repository at this point in the history