Constant libp2p::kad::K_VALUE

source ยท
pub const K_VALUE: NonZero<usize>;
Expand description

The k parameter of the Kademlia specification.

This parameter determines:

  1. The (fixed) maximum number of nodes in a bucket.
  2. The (default) replication factor, which in turn determines: a) The number of closer peers returned in response to a request. b) The number of closest peers to a key to search for in an iterative query.

The choice of (1) is fixed to this constant. The replication factor is configurable but should generally be no greater than K_VALUE. All nodes in a Kademlia DHT should agree on the choices made for (1) and (2).

The current value is 20.