Kademlia: intra-lookup RPC retransmit for loss-tolerant lookups#669
Merged
Conversation
A timed-out lookup probe is now retransmitted up to lookupRetries (=1) times before it is given up, without evicting the peer from the routing table (a dropped packet is not a dead node). This keeps a single async lookup exact under packet loss, not just the eventually-refreshed tables: measured live, lookups from one node went from 21/45 to 31/35 exact at 10% drop, with drop=0 staying a perfect 35/35. Checks off a roadmap backlog item; suite stays 178/178; full gate green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019XuHZAjE3TuggDG5k91gL6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A follow-up to the Kademlia DHT lab (merged in #668) that lands a roadmap backlog item: intra-lookup RPC retransmit. A timed-out lookup probe is now retransmitted up to
lookupRetries(=1) times before it is given up — Kademlia retransmits RPCs — and crucially without evicting the peer from the routing table (a dropped packet is not a dead node; k-bucket eviction still only happens when a direct liveness ping fails).Why
Before this, only the eventually-refreshed routing tables tolerated packet loss; a single async lookup that happened to lose a reply could return an approximate k-closest. With one retransmit the initiator recovers from the drop and the lookup stays exact.
Effect (measured live on the deterministic kernel)
drop=0stays a perfect 35/35 exact (retransmit never fires when nothing is lost, so no behaviour change on a clean network).verify-projectgate green (scope + conformance + lint + build).Scope
Three files, all under
projects/quorum-distsys-k7r2/(Golden Rule):types.ts(config + per-lookup retry counter),kademlia.ts(retransmit in the probe-timeout handler), andJOURNAL.md(checks the backlog item off and records the measured gain).🤖 Generated with Claude Code
https://claude.ai/code/session_019XuHZAjE3TuggDG5k91gL6
Generated by Claude Code