From 1df85d13453b717dbee8f4ebf47b87de4f647866 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 24 Oct 2026 13:09:22 +0200 Subject: introduce majority voting on remakes --- src/remake/switch.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/remake/switch.rs') diff --git a/src/remake/switch.rs b/src/remake/switch.rs index f4a018a..e9f49ee 100644 --- a/src/remake/switch.rs +++ b/src/remake/switch.rs @@ -32,6 +32,7 @@ use super::local::LocalStatus; use super::quarantine; use super::records::{self, EpochRecord, Record, unix_millis}; use super::snapshot::{self, META_ROOT, REMAKES}; +use super::vote; use crate::document::replica::Epoch; use crate::document::store; use crate::swarm::sync::paths_related; @@ -78,6 +79,8 @@ async fn check(host: &H) { return catchup::check(host).await; } + vote::cast(host).await; + let all = host.read_doc(records::load_all).await; let local_record = EpochRecord::from(local); @@ -93,7 +96,7 @@ async fn check(host: &H) { [] => return catchup::check(host).await, [(id, record)] => (id.clone(), record.clone()), several => { - // The settle protocol prevents this; never guess which one is right. Peers + // Majority voting prevents this; never guess which one is right. Peers // that did switch can still be followed. let ids: Vec<&str> = several.iter().map(|(id, _)| id.as_str()).collect(); error!(remakes = ?ids, "Several remakes committed for this epoch; not switching on my own"); -- cgit v1.3.1