#34717 p2p: remove m_getaddr_sent

full analysis

https://github.com/bitcoin/bitcoin/pull/34717 · naiyoma · +1/-13 in 2 files, 2 commits · labels: P2P

Goal

  • Clean up peer address tracking so outbound peers' initial self-announcements can be relayed
  • Remove misleading relay-suppression state without weakening existing limits on large address messages

This PR removes the `m_getaddr_sent` boolean flag from `Peer` and the corresponding check in `ProcessAddrs`. The flag was intended to prevent relaying responses to `GETADDR`, but since self-announcements were separated into their own message in #34146, the first self-announcement clears the flag before the `GETADDR` response arrives, rendering the check ineffective. As a result, the initial self-announcement is now relayed immediately, while large `GETADDR` responses remain suppressed by the existing check that message size is 10 addresses or fewer.

Problem: The `m_getaddr_sent` flag creates misleading state and suppresses relay of the first self-announcement from outbound peers without effectively preventing small `GETADDR` response relays.

Category: P2P (#55 of 65)

P3 · cleanup

  • P3 because it cleans up broken internal state logic that was already rendered ineffective
  • The change is a minor peer-to-peer cleanup with low impact on overall network relay

Removing m_getaddr_sent cleans up broken internal state tracking that failed to accomplish its design purpose after #34146. As mzumsande noted, 'the flag was already unnecessary before (due to the <10 criterion)... improves logic that was already broken before', representing a worthwhile but minor P2P cleanup.

Membership: Touches peer message handling in src/net_processing.cpp and functional test test/functional/p2p_addr_relay.py.

Factors: security/stability 0, bug 1, performance 0, user value 0, leverage 0

Reviewability: Stale: Author silent 71 days

  • Stale because the author has been silent for 71 days with open design questions

The author has been inactive for 71 days exceeding the 60-day project threshold, leaving open conceptual questions regarding privacy and potential address relay token abuse.

Author status: silent since 2026-07-08 (71 days) after summarizing open questions on self-announcement privacy and GETADDR relay behavior

Open concerns:

  • taki-abedesselam Concept NACKed, arguing that removing the flag lets malicious peers abuse the 1000-token GETADDR allowance to forward unsolicited addresses.
  • ajtowns and Crypt-iQ raised potential privacy concerns regarding relaying initial self-announcements and small GETADDR responses, discussing whether separate message types or age inflation are needed.

Resolved concerns:

  • Removal of the redundant functional test assertion was clarified after review questions from Bortlesboat and danielabrozzoni.

Agreement: Disputed

  • Support because existing size checks already guard address relay and the flag is ineffective (danielabrozzoni, w0xlt)
  • Concept objection: removing the flag lets peers abuse token allocations for unsolicited addrs (taki-abedesselam)
  • Open privacy questions about topology leakage and relaying self-announcements (ajtowns, Crypt-iQ)

Disputed: taki-abedesselam Concept NACKs over relay token abuse; privacy questions remain open despite ACKs from w0xlt and danielabrozzoni

Reviewers are divided. While w0xlt and danielabrozzoni approved the change as a clean fix for broken state logic, taki-abedesselam objected with a Concept NACK over token abuse concerns, and ajtowns and Crypt-iQ highlighted unanswered privacy and design questions.

  • taki-abedesselam: Concept NACK, stating that removing m_getaddr_sent allows peers to abuse the +1000 token GETADDR allocation to relay unsolicited addresses
  • ajtowns: questioned the utility and privacy implications of relaying outbound self-announcements, suggesting alternative filtering or age inflation
  • Crypt-iQ: asked whether relaying GETADDR responses or initial self-announcements leaks network topology
  • danielabrozzoni and w0xlt: ACKed the removal because the size <= 10 check already guards address relay and the flag was ineffective

Review verdicts (DrahtBot): 2 (+2) -1

Files

8 lines under test/bench/ci.

  • test/functional/p2p_addr_relay.py +0/-8
  • src/net_processing.cpp +1/-5

Card

PR 34717 removes the m_getaddr_sent peer flag, which was intended to suppress relaying GETADDR responses but was rendered ineffective after self-announcements were split into separate messages in #34146. Removing it allows initial outbound self-announcements to relay while continuing to rely on a size check (<= 10 addresses) to block bulk address relay. Reviewers agree the flag is broken, but the PR is disputed due to a Concept NACK from taki-abedesselam concerning relay token abuse and unresolved privacy questions from ajtowns and Crypt-iQ. Review is currently stale as the author has been silent for 71 days.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T16:18, confidence high, input hash a06aa902a6d4844a