From 7323e8ed8598cda9784493aa3334d947120b53d8 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:22 +0100 Subject: swarm: changes taken unjudged, dropped (REFUSALS) A node refusing changes a peer brought tells it which broke a rule; the peer judges them itself, and if its rules refuse them too, drops them with all built on them (its document forked without them, a fresh actor), quarantining its own writes among them. Wire version 42. Auth plan M6 (rejoin on taint). --- src/transport/traffic.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/transport/traffic.rs') diff --git a/src/transport/traffic.rs b/src/transport/traffic.rs index 180d3b5..e810595 100644 --- a/src/transport/traffic.rs +++ b/src/transport/traffic.rs @@ -59,6 +59,8 @@ pub(crate) struct ByKind { pub(crate) hyparview: Counter, /// SIGNATURES (`swarm::signatures`). pub(crate) signatures: Counter, + /// REFUSALS (`swarm::refusals`). + pub(crate) refusals: Counter, } impl ByKind { @@ -76,6 +78,7 @@ impl ByKind { MessageKind::Prune, MessageKind::Neighbour, MessageKind::Signatures, + MessageKind::Refusals, ] { let theirs = *other.get(kind); self.get_mut(kind).absorb(theirs); @@ -98,6 +101,7 @@ impl ByKind { &self.hyparview } MessageKind::Signatures => &self.signatures, + MessageKind::Refusals => &self.refusals, } } @@ -117,6 +121,7 @@ impl ByKind { &mut self.hyparview } MessageKind::Signatures => &mut self.signatures, + MessageKind::Refusals => &mut self.refusals, } } } @@ -327,6 +332,7 @@ fn names(kind: MessageKind) -> (&'static str, &'static str) { MessageKind::NeighbourReply => ("NEIGHBOUR_REPLY", "hyparview"), MessageKind::Disconnect => ("DISCONNECT", "hyparview"), MessageKind::Signatures => ("SIGNATURES", "signatures"), + MessageKind::Refusals => ("REFUSALS", "refusals"), } } -- cgit v1.3.1