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

[p2p] Reduce addr blackholes #21528

Merged
merged 8 commits into from Aug 3, 2021

Commits on Jul 30, 2021

  1. [net_processing] Introduce SetupAddressRelay

    Idempotent function that initializes m_addr_known for connections that support
    address relay (anything other than block-relay-only). Unused until the next
    commit.
    amitiuttarwar committed Jul 30, 2021
    Configuration menu
    Copy the full SHA
    2fcaec7 View commit details
    Browse the repository at this point in the history
  2. [test] Update p2p_addr_relay test to prepare

    Use an init param to make clear whether a getaddr message should be sent when
    the P2PConnection receives a version message. These changes are in preparation
    for upcoming commits that modify the behavior of a bitcoind node and the test
    framework.
    amitiuttarwar committed Jul 30, 2021
    Configuration menu
    Copy the full SHA
    6653fa3 View commit details
    Browse the repository at this point in the history
  3. [net_processing] Defer initializing m_addr_known

    Use SetupAddressRelay to only initialize `m_addr_known` as needed. For outbound
    peers, we initialize the filter before sending our self announcement (not
    applicable for block-relay-only connections). For inbound peers, we initialize
    the filter when we get an addr related message (ADDR, ADDRV2, GETADDR).
    
    These changes intend to mitigate address blackholes. Since an inbound peer has
    to send us an addr related message to become eligible as a candidate for addr
    relay, this should reduce our likelihood of sending them self-announcements.
    amitiuttarwar committed Jul 30, 2021
    Configuration menu
    Copy the full SHA
    1d1ef2d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    201e496 View commit details
    Browse the repository at this point in the history
  5. [net_processing] Remove RelayAddrsWithPeer function

    Now that we have a simple boolean stored on the field, the wrapper function is
    no longer necessary.
    amitiuttarwar committed Jul 30, 2021
    Configuration menu
    Copy the full SHA
    c061599 View commit details
    Browse the repository at this point in the history
  6. [test] Test that we intentionally select addr relay peers.

    This test checks that we only relay addresses with inbound peers who have sent
    us an addr related message. Uses a combination of GETADDR and ADDR to verify
    when peers are eligible.
    amitiuttarwar committed Jul 30, 2021
    Configuration menu
    Copy the full SHA
    0980ca7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3893da0 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3f7250b View commit details
    Browse the repository at this point in the history