Skip to main content

Module negative_cache

Module negative_cache 

Source
Expand description

Requester-side negative probe cache (ADR 001 §Probe cache).

Suppresses repeated cdn/probe/v1 requests to a (NodeId, hash) pair that already returned has_blob: false within the TTL window. Per ADR 001 § Probe cache the cache:

  • is keyed (NodeId, hash);
  • holds at most 1024 entries with LRU eviction;
  • retains entries for 5 minutes (TTL anchored at insertion);
  • does NOT retain the probe response signature — purely a request- suppression structure, not slashing evidence.

The DHT iterative lookup (super::lookup) consumes NegativeProbeCache::contains_active as the third ADR 022 §Lookup-integrity filter on FindValueResponse.providers. NegativeProbeCache::record_failure is the producer-side hook for the outbound cdn/probe/v1 client.

Structs§

Hash
32-byte content hash. Re-exported from the protocol crate’s decdn_protocol::ContentHash newtype — distinct from NodeId at the type level, identical ([u8; 32]) on the wire. A 32-byte content address (BLAKE3 hash).
NegativeProbeCache
Bounded LRU cache of (NodeId, hash) pairs returned has_blob: false within the TTL window.