aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/held.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-25 12:43:51 +0000
committertv <tv@krebsco.de>2026-11-25 12:43:51 +0000
commit055e09b3410040e4300238ac5d0a53fdc2726e40 (patch)
tree76bc574f812b683a20cc34833a3fd3481845c3c7 /src/federation/held.rs
parent2085f8fa1b7f4d5c5011479cbf1f3d6fac6545a2 (diff)
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.
Diffstat (limited to 'src/federation/held.rs')
-rw-r--r--src/federation/held.rs23
1 files changed, 3 insertions, 20 deletions
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(&current.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,