summaryrefslogtreecommitdiffstats
path: root/src/federation/party.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:45 +0100
commit295ba74159e371bb9082fcbdada5eaf78de5d1dc (patch)
tree2639551c6526b879107ee23fd5a47036f518f005 /src/federation/party.rs
parentdd720b2556fa64bd07dc1d087b502ac4ab0f7899 (diff)
continuum-party: warns before a true that only every nay left ends
A `true` holds its party until its proposal passes or is dead, and only other parties' nays make it dead: where the parties yet to vote are too few, one of them staying quiet binds the party on that version for good. The client says so before it casts such a `true` (`client::binding`): where ending the proposal would take every party yet to vote, or more, and those are a third of the parties or fewer.
Diffstat (limited to 'src/federation/party.rs')
-rw-r--r--src/federation/party.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/federation/party.rs b/src/federation/party.rs
index 162f8bd..655d4c2 100644
--- a/src/federation/party.rs
+++ b/src/federation/party.rs
@@ -734,6 +734,20 @@ async fn vote(
let kept = record
.may_vote(&current, proposal, &proposed, yes, &nays)
.map_err(|why| anyhow!(why))?;
+ if yes {
+ let parties = |what: &str| -> BTreeSet<String> {
+ ballots[proposal.to_string()][what]
+ .as_array()
+ .into_iter()
+ .flatten()
+ .filter_map(|party| party.as_str().map(str::to_owned))
+ .collect()
+ };
+ if let Some(why) = client::binding(&current, &signer.party, &parties("yes"), &parties("no"))
+ {
+ eprintln!("Warning: {why}");
+ }
+ }
// On the events proposing it the node shows, those above the heads it names for a
// checkpoint, so a version event may be written on it.
let cast = signer.sign(&proposals, event::vote(current.hash, proposal, yes))?;