Skip to main content

Module adaptive_lookup

Module adaptive_lookup 

Source
Expand description

Adaptive Kademlia lookup scheduler that tunes alpha (parallelism) based on observed latency.

§Overview

Kademlia’s alpha parameter controls how many concurrent RPCs are issued per lookup iteration. The standard value is 3, but a static setting is suboptimal:

  • A congested network benefits from lower alpha so that fewer in-flight requests compete for the same scarce bandwidth.
  • A fast network with low latency can sustain higher alpha, reducing total lookup latency through more parallelism.

This module provides:

Structs§

AdaptiveLookupScheduler
Maintains a rolling latency window and adaptively tunes Kademlia alpha.
LookupSchedulerStats
Point-in-time snapshot of AdaptiveLookupScheduler state.
PeerLatencyTracker
Tracks per-peer latency with sliding windows and enables peer ranking.

Constants§

ALPHA_DEFAULT
Default parallelism degree (standard Kademlia value).
ALPHA_MAX
Maximum parallelism degree for Kademlia lookups.
ALPHA_MIN
Minimum parallelism degree for Kademlia lookups.