Skip to main content

Module dht

Module dht 

Source
Expand description

Kademlia content DHT (cdn/dht/v1) — runtime-side modules.

See ADR 022 for the canonical design. Wire types live in decdn_protocol::dht; this module owns the routing table, rate limiter, record store, republish scheduler, and the requester-side iterative lookup that surround the handler.

Re-exports§

pub use auth::AuthenticatedNodeId;
pub use bootstrap::BootstrapOutcome;
pub use bootstrap::bootstrap;
pub use chain_origin_directory::ChainOriginDirectory;
pub use chain_staker_set::ChainStakerSet;
pub use lookup::LookupConfig;
pub use lookup::find_providers;
pub use negative_cache::NegativeProbeCache;
pub use node_address::ChainNodeAddressDirectory;
pub use node_address::NodeAddressResolver;
pub use node_address::StaticNodeAddressDirectory;
pub use origin::EmptyOriginDirectory;
pub use origin::OriginDirectory;
pub use origin::StaticOriginDirectory;
pub use probe_cache::PositiveProbeCache;
pub use probe_cache::ProbedProvider;
pub use publish::RepublishScheduler;
pub use rate_limit::DhtRateLimiter;
pub use rate_limit::DhtRejectLayer;
pub use records::InsertOutcome;
pub use records::RecordStore;
pub use records::RecordStoreConfig;
pub use routing::NODE_ID_LEN;
pub use routing::RoutingTable;
pub use routing::xor_distance;
pub use staker_set::ConfigStakerSet;
pub use staker_set::StakerSet;

Modules§

auth
The authenticated-identity trust boundary for the DHT handler.
bootstrap
DHT bootstrap (ADR 022 §Bootstrap).
bucket_refresh
Routing-table bucket refresh (ADR 022 §Routing Table — “Bucket refresh interval | 1 hour”).
capacity_bond_registry
One CapacityBond watcher feeding five registry projections.
chain_origin_directory
Chain-backed OriginDirectory implementation.
chain_staker_set
Chain-backed StakerSet implementation.
client
Client-side cdn/dht/v1 request primitives.
dial_addrs
NodeId → registry-published direct dial addresses (ADR 001 § Node Discovery), mirrored into an iroh MemoryLookup that the runtime registers on the node’s endpoint.
lazy_origin_cache
Lazy, bounded, TTL-split cache of getOrigins(namespaceId) results.
lookup
Requester-side iterative FindValue lookup (ADR 022 §FIND_VALUE Flow + §Lookup integrity).
negative_cache
Requester-side negative probe cache (ADR 001 §Probe cache).
node_address
Node-id → operator Ethereum address resolver (ADR 003 §Node Registry, #831).
origin
On-chain origin-directory fallback (ADR 022 §FIND_VALUE Flow “Origin discovery” and §Bootstrap “the on-chain origin directory provides the deterministic fallback”).
probe_cache
Requester-side POSITIVE probe cache (ADR 001 §Probe cache).
publish
DHT republish scheduler (ADR 022 §STORE Flow & §Bootstrap).
rate_limit
Three-layer token-bucket rate limiter for cdn/dht/v1 inbound traffic (ADR 022 §DHT Rate Limiting).
records
Receiver-side DHT record store (ADR 022 §Content Records and TTL).
routing
Kademlia k-bucket routing table for cdn/dht/v1 (ADR 022 §Routing Table).
staker_set
Active-staker set abstraction (ADR 022 §STORE Flow, §FIND_VALUE Flow).

Structs§

NodeId
A 32-byte node identifier (Ed25519 public key).