From 055e09b3410040e4300238ac5d0a53fdc2726e40 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 25 Nov 2026 12:43:51 +0000 Subject: federation: a node casts no true its own store refuses A node recorded each vote, saved the record, offered the vote to its store, and didn't look at the answer. A party freed by nays cast after a checkpoint's heads were named, with its earlier true in their history, votes on that checkpoint on its proposal alone, as a checkpoint's vote leaves the nays out: there the earlier proposal isn't dead, and every store refuses the vote. Recorded all the same, it bound the party by a vote no node held; and deciding on it each round, the node proposed no checkpoint of its own. The fold's rule for a party's second true is State::may_back now, which a node asks at the history its vote would build on (vote::builds_on), as it decides, by itself or by hand, and as it signs: a vote refused at its own history counts nowhere, so none is cast, and none recorded. --- src/federation/held.rs | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'src/federation/held.rs') diff --git a/src/federation/held.rs b/src/federation/held.rs index 02b94d2..1e1e0d4 100644 --- a/src/federation/held.rs +++ b/src/federation/held.rs @@ -29,7 +29,7 @@ use anyhow::{Context, Result, bail}; use serde::{Deserialize, Serialize}; use tracing::{error, info, warn}; -use super::client::{self, Record}; +use super::client::Record; use super::event::{self, Does, Event, Signed}; use super::fold::Federation; use super::revision::Feature; @@ -756,25 +756,8 @@ impl Holding { // On an event proposing it, of a checkpoint one above the heads it // names, so a version event may be written on it, which the node's // heads, holding what is beside them, may not be; and on the nays that - // freed its party (`client::building`). - let state = store.state(); - let Some(proposing) = - state.proposing(¤t.hash, &proposal).first().copied() - else { - if hand.is_some() { - return Err(format!( - "no event proposing {proposal} is above the heads it names: \ - no version event is written on a vote on it" - )); - } - continue; - }; - let checkpoint = state - .proposal(&proposal) - .and_then(|json| Version::read(json).ok()) - .and_then(|version| version.checkpoint) - .is_some(); - let on = match client::building(proposing, checkpoint, &nays) { + // freed its party: where its store takes it (`vote::builds_on`). + let on = match vote::builds_on(store, party, &proposal, yes, &nays) { Ok(on) => on, Err(why) if hand.is_some() => return Err(why), Err(_) => continue, -- cgit v1.3.1