aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/stats.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-07 22:35:22 +0100
committertv <tv@krebsco.de>2026-11-07 22:35:22 +0100
commitd322e7d4aa41d94232113cb7680cec1d65a11b0c (patch)
tree874e03dbf7acebc51a144498c89c43b335641bf7 /src/api/stats.rs
parenta99bacc0c90ca7a7f879cec8a8fb33f4aa14e84f (diff)
access: members refused as a whole
With signatures required, a member whose own change broke a rule is refused as a whole: sent nothing, shown in /peers (refused), in stats (sync.refusedPeers) and on the dashboard, until a change of its is taken again or the epoch changes. Auth plan M6 (diverged standing).
Diffstat (limited to 'src/api/stats.rs')
-rw-r--r--src/api/stats.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/api/stats.rs b/src/api/stats.rs
index 8eaff0c..1f0701d 100644
--- a/src/api/stats.rs
+++ b/src/api/stats.rs
@@ -127,6 +127,9 @@ struct SyncStats {
last_from_neighbour_secs: Option<u64>,
/// Peers whose heads differ from ours while sync is idle (`peers.md`, healing).
diverged_peers: usize,
+ /// Peers refused as a whole, their own changes having broken the swarm's rules
+ /// (`access::screen`): sent nothing.
+ refused_peers: usize,
/// The largest sync message received since start (its Automerge part). Larger
/// transfers come as deltas (blobs).
largest_received_bytes: u64,
@@ -324,11 +327,15 @@ pub(crate) async fn collect(state: &AppState, list: &PeerListResponse) -> StatsR
let mut incidents = Incidents::default();
let mut last_from_neighbour_secs: Option<u64> = None;
let mut diverged_peers = 0;
+ let mut refused_peers = 0;
for peer in list.peers.values() {
incidents.add(&peer.incidents);
if peer.diverged_for_secs.is_some() {
diverged_peers += 1;
}
+ if peer.refused.is_some() {
+ refused_peers += 1;
+ }
if peer.neighbour
&& let Some(secs) = peer.last_sync_secs_ago
{
@@ -370,6 +377,7 @@ pub(crate) async fn collect(state: &AppState, list: &PeerListResponse) -> StatsR
sync: SyncStats {
last_from_neighbour_secs,
diverged_peers,
+ refused_peers,
largest_received_bytes: node.largest_sync_received,
},
relay: RelayStats {