aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/fold.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-19 01:48:58 +0000
committertv <tv@krebsco.de>2026-11-19 03:19:39 +0100
commitdd720b2556fa64bd07dc1d087b502ac4ab0f7899 (patch)
tree1a56f3f9c556a3d44197732d66ba0a1af52f3d35 /src/federation/fold.rs
parentb00371d1260f4379241a9226d576270dd3a68285 (diff)
vote: propose a checkpoint after so many versions
The votes cast before count at a history from before too: a proposal that died, or a rival, needs there only the votes it lacked, and after a close vote one key voting twice is enough, at any time until a checkpoint above the version that followed. Nodes that took that version refuse it; one lagging behind, or joining from the root, may take it. `federation.md` said it took the keys of two thirds of the parties. A node voting by itself proposes a checkpoint once so many versions were written since its store's (`--store-propose-versions`), as the design lists: with 1, after every version, so that what keys voting twice grow beside a version ends at a checkpoint above it. `federation.md` says how little a rival version takes, row 20 too, and the guides the option.
Diffstat (limited to 'src/federation/fold.rs')
-rw-r--r--src/federation/fold.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/federation/fold.rs b/src/federation/fold.rs
index 46f56e1..3670051 100644
--- a/src/federation/fold.rs
+++ b/src/federation/fold.rs
@@ -348,6 +348,11 @@ impl State {
ballots
}
+ /// The checkpoint's version: the one current where the store moved there, or started.
+ pub(crate) fn checkpoint_version(&self) -> &Version {
+ &self.versions[&self.checkpoint]
+ }
+
/// The version the proposal of hash `proposal` proposes, as JSON, where it holds one:
/// whether it is a version is asked apart (`Version::read`).
pub(crate) fn proposal(&self, proposal: &Id) -> Option<&Json> {