summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-24 13:05:54 +0200
committertv <tv@krebsco.de>2026-10-24 13:05:54 +0200
commitc852ea8478963f5298e5b186ca5e1d7284504fd1 (patch)
tree6b9405ab6735fe46bad45432e8c1b034b2503237 /src/main.rs
parent871c6ac9bc5244875eb1ad09a37359bbf751297b (diff)
add electorate
For an upcoming change in remake coordination, nodes now maintain their self-assessed liveness in the document.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index cc1699e..5f1b3d2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -102,6 +102,11 @@ struct Args {
#[arg(long, value_name = "NAME", value_parser = parse_alias)]
alias: Option<String>,
+ /// Members that renewed their alive stamp within this many days vote on remakes
+ /// (a majority of them must agree). Matters on the node that coordinates a remake.
+ #[arg(long, value_name = "DAYS", default_value_t = 7, value_parser = clap::value_parser!(u64).range(1..))]
+ electorate_window_days: u64,
+
/// Test hook: start on a non-genesis epoch of this generation (with a fixed dummy
/// id), to check that nodes on different epochs refuse to sync.
#[arg(long, hide = true, requires = "debug_api", value_name = "GENERATION")]
@@ -222,6 +227,7 @@ async fn main() -> Result<()> {
run_id: uuid::Uuid::new_v4().into_bytes(),
neighbours_k: args.neighbours.max(2),
alias: args.alias,
+ electorate_window: Duration::from_secs(args.electorate_window_days * 24 * 3600),
neighbours: Default::default(),
pulling: Default::default(),
rtt: Default::default(),