Expand description
Three-layer token-bucket rate limiter for cdn/dht/v1 inbound traffic
(ADR 022 §DHT Rate Limiting).
This is a thin DHT-flavoured wrapper over the shared
crate::rate_limit::ThreeLayerRateLimiter engine: it pins the
DHT-specific operator-visible metric names (via a private metrics sink)
and re-exports the config/reject types under their historical DHT names.
The layering, cheapest-first ordering, keyspace bound, and batch-token
accounting all live in the shared engine — see its
module docs.
Structs§
- DhtRate
Limiter - Three-layer rate limiter for inbound
cdn/dht/v1requests. Newtype over the sharedThreeLayerRateLimiterthat injects the DHT metrics sink.
Type Aliases§
- DhtRate
Limit Config - Resolved DHT rate-limit configuration. See ADR 022 §DHT Rate Limiting.
Defaultreturns the ADR 022 values (per-peer 20/40, per-IP 100/200, global 1000/2000). - DhtReject
Layer - Layer that triggered a
cdn/dht/v1rejection. Alias of the sharedRejectLayer; theper_peer/per_ip/globallabel strings are stable.