diff options
| author | tv <tv@krebsco.de> | 2026-11-07 22:35:22 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-07 22:35:22 +0100 |
| commit | 7323e8ed8598cda9784493aa3334d947120b53d8 (patch) | |
| tree | 1e772cdf74974f918cf07d2e4b9d8e8593bed9dd /src/remake | |
| parent | d322e7d4aa41d94232113cb7680cec1d65a11b0c (diff) | |
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).
Diffstat (limited to 'src/remake')
| -rw-r--r-- | src/remake/mod.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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<H: Host>( + host: &H, + epoch: crate::document::replica::Epoch, + document: &crate::document::Document, + paths: Vec<Vec<String>>, +) -> Option<String> { + 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; |
