Skip to main content

Module reputation

Module reputation 

Source
Available on crate feature std only.
Expand description

Per-IP reputation tracking for adaptive PoW-difficulty escalation (DOS-2).

Pairs with the stateless cookie + proof-of-work gate in transport::handshake: an IP that repeatedly fails handshakes within a sliding window accrues violations and pays an exponentially escalating PoW difficulty (capped at MAX_DIFFICULTY), while clean / new IPs and resumption- ticket holders pay nothing extra. The tracking map is bounded (ReputationTracker::with_capacity) so a spoofed / varied-source-IP flood cannot turn this CPU-DoS defense into a memory-DoS.

Structs§

ReputationTracker
Tracks per-IP reputation and computes a PoW-difficulty escalation for abusive sources (DOS-2). A clean / new IP contributes 0 (so well-behaved clients are never penalized); an IP that accrues handshake violations within the sliding window pays an escalating difficulty, capped at MAX_DIFFICULTY. The map is bounded (see Self::with_capacity).