From 55a62cbeb66a640c8d9eff07b0ac441ef2d9859c Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Nov 2026 02:49:55 +0000 Subject: federation: votes build on the events proposing what they vote on A node voting by itself, and a party's client, signed a vote on the heads the node held: where those held what is beside a checkpoint's heads (a party's writes made while the swarm was parted, say), the vote wasn't above them, and a version event written on it was refused, so the checkpoint never moved, though it passed. Both now vote on the events proposing what they vote on, and a node proposes a checkpoint on the heads it names: so their votes are above those heads wherever the proposal is. --- src/federation/party.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/federation/party.rs') diff --git a/src/federation/party.rs b/src/federation/party.rs index d7880c2..ecd75a9 100644 --- a/src/federation/party.rs +++ b/src/federation/party.rs @@ -364,7 +364,8 @@ async fn vote( .filter_map(|id| id.as_str().and_then(Id::from_hex)) .collect() }; - let Some(proposing) = ids(&proposal, "proposals").first().copied() else { + let proposals = ids(&proposal, "proposals"); + let Some(proposing) = proposals.first().copied() else { bail!("no proposal of hash {proposal} on the current version, as the node reads it"); }; let proposed = match Event::read(&node.event(&proposing).await?) { @@ -400,8 +401,9 @@ async fn vote( let kept = record .may_vote(¤t, proposal, &proposed, yes, &nays) .map_err(|why| anyhow!(why))?; - let (_, heads) = node.summary().await?; - let cast = signer.sign(&heads, event::vote(current.hash, proposal, yes)); + // On the events proposing it: above the heads it names for a checkpoint wherever they + // are, so a version event may be written on it. + let cast = signer.sign(&proposals, event::vote(current.hash, proposal, yes)); record.cast(¤t, &cast, kept); record.save(path).map_err(|why| anyhow!(why))?; node.put(&cast).await -- cgit v1.3.1