Skip to content

Tracking: kad-dht query convergence & routing-table reliability #3536

@tabcat

Description

@tabcat

Tracking issue for a set of internal @libp2p/kad-dht reliability fixes found while hardening the IPNS-over-DHT write path. All are internal (no public API changes); each lands as its own PR, linked here as it opens. Ordered roughly by impact.

  • getClosestPeers should only add peers that responded
  • Terminate a query path once the closest-K set is full
  • Run the periodic routing-table refresh
  • Evict unresponsive peers from the routing table on query failure
    • A peer that fails a lookup is never removed (eviction only happens via bucket-full ping-replace), so dead entries are re-queried on every lookup. Ping-confirm before evicting. (needs design + test)
    • Scratched: a maintained routing table stays healthy on its own, so proactive eviction adds little. A 45-min live run on the fix(kad-dht): run the periodic routing table refresh #3538 refresh branch (passive node, no manual queries) held a stable table at ~5-8% unreachable with no upward drift (~46 peers, ~20 connections kept open to the KEEP_ALIVE closest-peer set).
  • Unbiased Fisher-Yates shuffle for the disjoint-path seed
    • Scratched: shuffling is not required for S/Kademlia disjoint-path lookups (the spec only says to distribute the k closest into d buckets); the bias is harmless to the lookup result and go-libp2p doesn't shuffle at all.
  • Fix alpha option doc
  • Defer the dialability check until after the distance checks

Evaluated, not pursuing: per-request timeout cap (reach is ceiling-independent once the live-peer fix lands), backfilling failed PUTs to peers outside the closest-K (breaks Kademlia write semantics, periodic republish covers it), streaming PUTs before the lookup completes (closest-K is not known until convergence).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions