From c64fcc05d8c53bee99ab039bd709039afb730cdd Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 18 Nov 2026 18:49:50 +0000 Subject: federation: a node stops at a version it doesn't read A version event writing a proposal passed on the version a node reads, which doesn't read as a version there (of a later federation, using what a later continuum takes, or none at all), the node can't judge: `Fold::stops`. The store stops at it: it takes nothing and refuses nothing from then on, holding back whatever comes, that event first (`Offered::Stopped`), and keeps none of it across a restart, where it stops there again. One beside the version the node reads is refused of its own, as any other. Its operator has it drop that event (`POST /admin/events/drop`), or one it builds on: it is refused as dropped, or as built on what was, any version event writing that version with it, kept in the store file; the node judges what it held back and goes on under the version before. Allowed again, it stops there once more. The node logs the stop and its end; `GET /events` names the event, why, and how many it holds back (`stopped`); a put answers `stopped`, written into the document all the same; a node voting by itself casts nothing while stopped. The test fold's eras tagged `new` stop a store. Row 39 is tested (`federation_attack_39`); of rows 9, 10 and 48, a node stops at the version event. --- docs/store.md | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'docs/store.md') diff --git a/docs/store.md b/docs/store.md index 3192389..b598539 100644 --- a/docs/store.md +++ b/docs/store.md @@ -114,6 +114,8 @@ A fold says, of its events: its group ([Members](#members)); * where it needs to, **what a node refuses that its history takes**, by what the node took before ([A node's own](#a-nodes-own)); +* where it needs to, **what a node can't judge** that it would take: an event only a fold + knowing more reads, where the node stops ([A node's own](#a-nodes-own)); * where it needs to, **what an event writes that others may write alike**, so that a node dropping it refuses them all (the federation: a version event's version). @@ -126,10 +128,16 @@ pub trait Fold { const LARGEST: usize; /// What the event builds on; `None` where its bytes are none of this fold's events. fn dependencies(event: &[u8]) -> Option>; - /// Whether the event is taken where its history reads as `at`. + /// Whether the event is taken where its history reads as `at`, as far as it reads it. fn judge(at: &Self::State, id: &Id, event: &[u8]) -> Result<(), Refused>; /// Adds the event, whose dependencies are added already. fn add(state: &mut Self::State, id: &Id, event: &[u8]); + /// Why a node whose store reads as `now` can't judge an event its history doesn't + /// refuse, that it would take, where it can't: the store stops at it. + fn stops(_at: &Self::State, _now: &Self::State, _id: &Id, _event: &[u8]) + -> Option { + None + } /// Whether a node whose store reads as `now` takes an event its history takes. fn keeps(_now: &Self::State, _id: &Id, _event: &[u8]) -> bool { true @@ -169,10 +177,10 @@ which its tests check ([Tests](#tests)). ## What is promised 1. **Every node takes an event or none**, but for what a fold has a node refuse by what - it took, what an operator has its node drop ([A node's own](#a-nodes-own)), and what - moving to a checkpoint refuses. An event is judged at its history, which its ID fixes, - so every node judges it alike, whenever and from whomever it comes. An event refused is - refused with everything built on it. + it took, what an operator has its node drop, what a node stops at + ([A node's own](#a-nodes-own)), and what moving to a checkpoint refuses. An event is + judged at its history, which its ID fixes, so every node judges it alike, whenever and + from whomever it comes. An event refused is refused with everything built on it. 2. **Nodes that hold the same checkpoint and the same events after it read the same state**, whatever order the events came in, and whatever carried them. 3. **Nothing underneath adds an event or takes one away.** What a node holds is what it @@ -203,6 +211,16 @@ so, and its operator's drops, in a file of its own, across restarts. No peer's word moves a node; its operator's does. A node that refuses what another took holds other events, and reads its own state from them; two that hold the same read the same. +A fold may have a node **stop** at an event it can't judge, that it would take: one only +a fold knowing more reads (the federation's node: a version event writing a version +that passed, which its continuum doesn't read, +[Changing the federation](federation.md#changing-the-federation)). The node takes +nothing and refuses nothing from then on: it holds back whatever comes, that event first, +keeps none of it across a restart, where it stops there again, and reports it, until it +runs a continuum that reads the event, or its operator has it drop the event, or one it +builds on. Then it refuses it, as dropped or as built on what was, with everything built +on it, and judges what it held back. What it took before it stopped, it holds as it did. + ## Forks A **fork** is a store whose root is a checkpoint at heads of another, which its maker @@ -335,7 +353,9 @@ coordinator): two remakes at one base are two epochs. checkpoint forgot, and events nobody takes, leave the document here. A node that moved to a later checkpoint since the base builds the snapshot as one that didn't, as both read the document; nodes that read the store differently at the base (the sides of - keys that voted twice, in the federation) build different snapshots, and part here. + keys that voted twice, in the federation, or a node that stopped, holding back what + the others took: [A node's own](#a-nodes-own)) build different snapshots, and part + here. * **A node follows a decision** whichever node coordinated it: a decision reaches it only through a member, which could decide one itself, and a remake changes no event. It builds the snapshot itself, from a base it holds, and checks it against the -- cgit v1.3.1