From 8347900a553a3c4c9f9d3fc4a539fd31b41b07d3 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 19 Nov 2026 14:09:23 +0000 Subject: vote: a checkpoint after every version that changes more, unless told otherwise After a close vote, one key voting twice passes a rival version at a history from before the version that followed, the votes cast before counting with its own, any time until a checkpoint above that version: nodes that took the version refuse it, but one lagging behind, or joining from the root, may take it. A node voting by itself proposed a checkpoint after a version only where its operator set `--store-propose-versions`; now it does unless told otherwise (1 unless set; 0 never so). Versions that change more than moving to a checkpoint are rare, so the cost is a checkpoint each. A default set, store-propose-versions no longer asks for store-vote-key, as store-held-for and store-back-after don't. --- docs/example.toml | 5 +++-- docs/federation.md | 2 +- docs/guides/federation/checkpoints.md | 4 ++-- docs/guides/federation/voting-by-itself.md | 12 ++++++------ src/config/mod.rs | 8 ++------ src/lib.rs | 2 +- 6 files changed, 15 insertions(+), 18 deletions(-) diff --git a/docs/example.toml b/docs/example.toml index ce1ea83..d318d53 100644 --- a/docs/example.toml +++ b/docs/example.toml @@ -155,8 +155,9 @@ htpasswd = "/etc/continuum/htpasswd" # named (by default only on versions that only move to a checkpoint), votes `false` on a # checkpoint proposed beside one it backs, if told, and proposes a checkpoint once it # holds so many events beyond its checkpoint, so many versions changing more than moving -# to a checkpoint were written since, or so long after it moved there; it backs and -# proposes none sooner than store-back-after after a move or its start. +# to a checkpoint were written since (1 unless set, 0 never), or so long after it moved +# there; it backs and proposes none sooner than store-back-after after a move or its +# start. # store-vote-key = "/var/lib/continuum/party.key" # store-vote-record = "/var/lib/continuum/party-record.json" # store-follow = ["lass"] diff --git a/docs/federation.md b/docs/federation.md index e8eea8c..f36eabd 100644 --- a/docs/federation.md +++ b/docs/federation.md @@ -729,7 +729,7 @@ fold, with crafted events. *Sim*: a simulation. *Bench*: measured, not judged. | 17 | Votes split, honestly or not | Nothing passes; nays make the proposals dead, and another passes | unit | | 18 | The parties beyond two thirds never vote, or vote `false` on everything | Nothing passes; the others fork | unit | | 19 | A node of the party a version takes out writes that version | Taken: a version counts by its votes, not by who wrote it | unit | -| 20 | The keys an earlier version named pass another proposal on it, or one that died, at a history from before, the votes cast before counting with theirs, so that after a close vote one key voting twice is enough, and raise its number | Refused by every node that took the version after it, and reported; a node that lagged, or joins from the root, may take it: keys voted twice. Refused by every node once a checkpoint above that version passed: nodes may propose one after every version (`--store-propose-versions 1`) | unit | +| 20 | The keys an earlier version named pass another proposal on it, or one that died, at a history from before, the votes cast before counting with theirs, so that after a close vote one key voting twice is enough, and raise its number | Refused by every node that took the version after it, and reported; a node that lagged, or joins from the root, may take it: keys voted twice. Refused by every node once a checkpoint above that version passed: a node voting by itself proposes one after every version changing more, unless told otherwise (`--store-propose-versions`) | unit | | 21 | Two versions changing the one a node reads, coming together | It takes the first it judges, and refuses the other | unit | | 22 | Values signed with a key a party's set holds, stolen | Count until the party drops the key | unit | | 23 | A key a version names, stolen, votes, or writes its party's set or list | Counts while that version is current; the party's own vote beside it is voting twice, answered by a fork | unit | diff --git a/docs/guides/federation/checkpoints.md b/docs/guides/federation/checkpoints.md index c929d89..61800a1 100644 --- a/docs/guides/federation/checkpoints.md +++ b/docs/guides/federation/checkpoints.md @@ -37,8 +37,8 @@ nothing that can still pass is proposed on the current version. A node voting for its party by itself proposes checkpoints by its operator's rules: once it holds so many events beyond its checkpoint (`--store-propose-events`), so many versions changing more than moving to a checkpoint were written since it -(`--store-propose-versions`, after every such version with 1), -or so long after its store moved there (`--store-propose-every`), at the heads it holds, +(`--store-propose-versions`, 1 unless set), or so long after its store moved there +(`--store-propose-every`), at the heads it holds, no more than an event may name (64, which it merges first under a revision with merge events), where no proposal holds it back ([`voting-by-itself.md`](voting-by-itself.md), [Its rules](voting-by-itself.md#its-rules)); and it backs what it proposes. diff --git a/docs/guides/federation/voting-by-itself.md b/docs/guides/federation/voting-by-itself.md index b01bfd3..73e9df8 100644 --- a/docs/guides/federation/voting-by-itself.md +++ b/docs/guides/federation/voting-by-itself.md @@ -51,18 +51,18 @@ or `POST /admin/events/vote` with `{"proposal": "8d02…", "yes": true}`. * **Proposing checkpoints** (`--store-propose-events COUNT`, `--store-propose-versions COUNT`, `--store-propose-every DURATION`): once it holds so many events beyond its checkpoint, so many versions changing more than moving to a checkpoint were written - since it, or so long after its store moved there by its own clock, it proposes a - version that only moves to a checkpoint, at the + since it (1 unless set, 0 never), or so long after its store moved there by its own + clock, it proposes a version that only moves to a checkpoint, at the heads it holds, no more than an event may name (64, which it merges first under a revision with merge events), where no proposal on the current version holds it back: one it would back that can still pass; one that can still pass that a third of the parties back, someone but its proposer among them; or one held for less than a while (`--store-held-for`, ten minutes unless set) whose proposer has none older on the version. It backs what it proposes, so that the nodes following its party back it too. - With `--store-propose-versions 1`, it proposes one after every version that changes - more: after a close vote, one key voting twice can pass a rival version at a history - from before it, any time later, which nodes lagging behind or joining from the root may - take; a checkpoint above that version ends that. + Unless told otherwise, it proposes one after every version that changes more: after a + close vote, one key voting twice can pass a rival version at a history from before it, + any time later, which nodes lagging behind or joining from the root may take; a + checkpoint above that version ends that. * **`false` beside** (`--store-nay-beside`): where it backs a proposal that can still pass, it votes `false` on every other version only moving to a checkpoint, so that of two checkpoints proposed at once the other dies, and its backers are free. diff --git a/src/config/mod.rs b/src/config/mod.rs index caecb49..652a10e 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -309,8 +309,8 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[ "store-propose-versions", Kind::Integer, "COUNT", - None, - "With store-vote-key: propose a checkpoint, as store-propose-events, once this many versions changing more than moving to a checkpoint were written since its store's checkpoint: with 1, after every such version, so that what keys voting twice could grow beside it at a history from before ends there.", + Some("1"), + "With store-vote-key: propose a checkpoint, as store-propose-events, once this many versions changing more than moving to a checkpoint were written since its store's checkpoint: with 1, after every such version, so that what keys voting twice could grow beside it at a history from before ends there; with 0, never so.", ), #[cfg(feature = "federation")] option( @@ -1380,10 +1380,6 @@ impl Settings { ("store-nay-beside", self.store_nay_beside), ("store-propose-events", self.store_propose_events.is_some()), ("store-propose-every", self.store_propose_every.is_some()), - ( - "store-propose-versions", - self.store_propose_versions.is_some(), - ), ]; match (&self.store_vote_key, &self.store_vote_record) { (Some(_), None) => { diff --git a/src/lib.rs b/src/lib.rs index 3b3da86..0750cd4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,7 +70,7 @@ fn voter(args: &config::Settings) -> Result> { nay_beside: args.store_nay_beside, propose_events: args.store_propose_events, propose_every: args.store_propose_every, - propose_versions: args.store_propose_versions, + propose_versions: args.store_propose_versions.filter(|versions| *versions > 0), held_for: args.store_held_for, back_after: args.store_back_after, }, -- cgit v1.3.1