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/remake/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/remake/mod.rs') diff --git a/src/remake/mod.rs b/src/remake/mod.rs index 342eab3..840322a 100644 --- a/src/remake/mod.rs +++ b/src/remake/mod.rs @@ -39,6 +39,23 @@ mod vote; #[cfg(test)] pub(crate) use api::testing; + +/// Quarantines `paths` of `document` (of `epoch`): this node's writes on a change the +/// swarm's rules refuse, which it took unjudged and has dropped since +/// (`AppState::drop_taken`). The quarantine's id, if any. +pub(crate) fn quarantine_taken( + host: &H, + epoch: crate::document::replica::Epoch, + document: &crate::document::Document, + paths: Vec>, +) -> Option { + let reason = "written on a change the swarm's rules refuse, which this node took unjudged"; + let quarantined = paths + .into_iter() + .map(|path| (path, reason.to_owned())) + .collect(); + quarantine::add(host, epoch, epoch, document, quarantined) +} pub(crate) use delta::Superseded; pub(crate) use kind::remake_genesis; pub(crate) use local::RemakeState; -- cgit v1.3.1