Skip to content

Unify Subscribe RequestSub and SeekNode message variants #2182

@sanity

Description

@sanity

Problem

Subscribe currently uses two nearly identical message variants:

  • : initial hop (first leg), minimal fields, no skip list/htl/retries.
  • : forwarded/retry form that carries skip list, HTL, retries.

Routing is already connection-based (uses upstream transport addr), so the split is legacy/convenience. The first leg is not meaningfully different from subsequent legs: each hop tries to register, and if it can’t, forwards to another peer with loop/TTL controls.

Maintaining two variants adds code paths and increases risk of divergent behavior (e.g., address handling). It also keeps payload complexity without clear benefit.

Proposal

  • Collapse RequestSub and SeekNode into a single Subscribe message that always carries search metadata (skip list, HTL, retries) initialized on the first hop.
  • Keep subscriber identity for registration, but treat routing as fully connection-based (use upstream transport addr, not embedded addresses).
  • Simplify logic and message shaping; reduce code duplication in subscribe handling.

Context

  • Raised during review of PR stack 2167-2175 (connection-based routing/NAT fixes). This simplification is out of scope for that stack but would clarify the protocol and reduce special cases.

Notes

  • Ensure skip/htl defaults cover the first hop (e.g., HTL initialized from config; skip initialized with self/requester).
  • Audit tests that assume distinct RequestSub vs SeekNode handling.

Labels: enhancement, networking

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-networkingArea: Networking, ring protocol, peer discoveryE-mediumExperience needed to fix/implement: Medium / intermediateS-needs-designStatus: Needs architectural design or RFCT-enhancementType: Improvement to existing functionality

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions