Skip to content

Strip PeerKeyLocation payloads from Subscribe messages #2183

@sanity

Description

@sanity

Problem

Subscribe messages still carry full PeerKeyLocation for target/subscriber, even though routing is now connection-based by socket address. Using PeerKeyLocation (with embedded addresses) for connected peers is redundant and risks stale/wrong addresses being propagated.

Why it matters

  • We identify live peers by SocketAddr now; the transport source (upstream_addr) is authoritative for routing ReturnSub.
  • Embedded addresses can be wrong (NAT loopback/private) and should not be trusted.
  • Carrying a full location in payload forces us to thread addresses we don’t actually use.
  • PR fix: allow parallel connection attempts (max 3 concurrent) #2174 surfaced a regression where trusting a Known-but-wrong embedded address breaks NAT peers; overriding from transport source fixed it, but removing embedded addresses would prevent the class entirely.

Proposal

  • Keep subscriber identity (pubkey/PeerId), but drop/ignore embedded addresses in Subscribe payloads.
  • Treat routing as fully connection-based: return path uses upstream_addr; forward path uses selected next-hop socket address.
  • Adjust add_subscriber/ring/seeding code to accept identity + observed upstream address instead of a full PeerKeyLocation payload.
  • Consider merging RequestSub/SeekNode (see Unify Subscribe RequestSub and SeekNode message variants #2182) so the message shape is simplified in one pass.

Scope

  • Out of scope for PR stack 2167–2175; track as follow-up cleanup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-networkingArea: Networking, ring protocol, peer discoveryE-mediumExperience needed to fix/implement: Medium / intermediateT-enhancementType: Improvement to existing functionality

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions