Skip to content

Implement content discovery via cdn/dht/v1 Kademlia DHT #320

Closed

Description

@alpergundogdu

Context

ADR 022 specifies a Kademlia DHT for O(log N) content location. Without content discovery, clients cannot find which nodes hold a given blob — they would need to probe every peer.

Scope

Protocol types (crates/protocol)

  • FindValueRequest — hash being looked up
  • FindValueResponse — providers: Vec, closer_nodes: Vec
  • StoreRequest — "I hold this hash" with signature over {hash, published_at_us}
  • StoreAck
  • FindNodeRequest / FindNodeResponse — routing table bootstrap

Handler (crates/node)

  • Register cdn/dht/v1 ALPN handler on the router
  • Kademlia routing table (k=20 bucket size, 256 buckets)
  • Iterative lookup with α=3 parallelism
  • Content provider publication on cache insertion

Lifecycle

  • On CacheEngine insert → publish StoreRequest to k closest nodes
  • On client lookup → iterative FindValue until providers found or closest nodes exhausted
  • TTL: 1 hour on DHT records, garbage-collected periodically
  • Fallback on DHT miss: on-chain origin directory (PublisherRegistry.namespaceOf → OriginAssignment.getOrigins → StakingRegistry.nodeIdOf). Broadcast probe fan-out is no longer part of the protocol.

References

Activity

  1. self-assigned this
    on May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions