Expand description
Peer Reputation Manager — long-term behavioral scoring for trust-weighted routing.
Tracks per-peer reputation scores derived from a stream of PrReputationEvents.
Scores are clamped to [0.0, 1.0], decay toward the neutral value of 0.5 each tick,
and drive tier classification used by connection prioritisation and routing.
§Quick start
use ipfrs_network::peer_reputation::{
PeerReputationManager, PrReputationConfig, PrReputationEvent,
};
let cfg = PrReputationConfig::default();
let mut mgr = PeerReputationManager::new(cfg);
mgr.record_event("peer-A", PrReputationEvent::BlockDelivered { bytes: 4096 });
mgr.record_event("peer-A", PrReputationEvent::GoodProof);
let score = mgr.score("peer-A").expect("peer exists");
assert!(score.is_trusted());Structs§
- Peer
Reputation Manager - Manages long-term reputation scores for a set of remote peers.
- PrReputation
Config - Tuning parameters for score deltas and temporal decay.
- PrReputation
Score - Long-term reputation score for a single peer.
- PrReputation
Stats - Aggregate statistics across all tracked peers.
Enums§
- PrReputation
Event - A discrete behavioural observation for a remote peer.