Expand description
PeerGovernor - the single source of truth for peer policy
and health tracking per .
The framework owns this Component; it’s consulted at both delivery boundaries:
-
**Inbound **: Phase 1 of
Engine::pollcallsPeerGovernor::check_inboundfor everyIngressEvent::EnvelopeFrom { src_peer, .. }. Blocked / non-allowlisted peers are dropped before any slot is written. -
**Outbound **: the compiler pass
bb-compiler/src/insert_peer_health_gates.rsinserts aPeerHealthGatesyscall op upstream of everywire::Send. The gate’sdispatch_atomiccallsPeerGovernor::check_outbound.
Health state (per-peer consecutive failures + last-seen) is
updated by Send-completion callbacks so Component authors stop
touching BackoffTable by hand - the compiler wires the
tracking in for every wire send automatically.
Structs§
- Peer
Governor - Per-peer policy + health state owner.
- Peer
Health - Per-peer health snapshot. Read by
Node::peer_health()for operator introspection.
Enums§
- Block
Reason - Why a peer can’t receive an envelope, surfaced both inbound (drop) and outbound (gate failure).
- Decision
- Outcome of a
check_inbound/check_outboundconsultation. - Lifecycle
Transition - Side-effect of recording a failure or success - the engine
translates these into
EngineStepvariants in Phase 8.
Constants§
- DEFAULT_
FAILURE_ THRESHOLD - Default number of consecutive
wire::Sendfailures before a peer is marked as down.PeerGovernor::record_failureemits the lifecycle transition; the engine’s Phase 8 surfaces it asEngineStep::PeerDown.