From fb54044c688e0252b4af54a057151b9c4d4ccf98 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 24 Nov 2026 18:58:32 +0000 Subject: federation: no true on a checkpoint at heads no version may name A version event is refused where the heads its version names for a checkpoint have one in another's history, or aren't after the current checkpoint (may_move). Neither the voters' rule nor what a node tells clients asked that: votes on such a proposal are taken, no version event on them ever is, so nothing lapses, and every party that voted true stays bound until others' nays end it. A followed key proposing one bound all its followers; with two thirds of the parties so, nothing passed on that version again. may_move's part about the heads is may_name now, which backs_checkpoint asks before a true, and GET /events/counts says as none, so that a party's client backs no such proposal either. --- src/api/events.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/api/events.rs') diff --git a/src/api/events.rs b/src/api/events.rs index 5a69769..1d275f9 100644 --- a/src/api/events.rs +++ b/src/api/events.rs @@ -199,7 +199,8 @@ async fn heard(state: &AppState) -> std::collections::HashMap { /// for a checkpoint, those above its heads), the votes on it, the parties /// voting `true` and `false`, whether it passed and whether it is dead, why a party's /// client backs it not, where it is no version that can be written on the current one -/// (`client::backable`), and, for a checkpoint, what its parties signed that moving there +/// (`client::backable`) or names heads no version may (`State::may_name`), and, for a +/// checkpoint, what its parties signed that moving there /// refuses (`beside`, `signed_beside`). async fn counts(State(state): State) -> Response { let aliases = crate::swarm::members::aliases(&state.doc.read().await.doc); @@ -255,6 +256,17 @@ async fn counts(State(state): State) -> Response { let none = read .proposal(&hash) .and_then(|proposed| client::backable(current, proposed).err()) + .or_else(|| { + let heads = read + .proposal(&hash) + .and_then(|json| crate::federation::version::Version::read(json).ok()) + .and_then(|version| version.checkpoint)?; + let why = read.may_name(&heads).err()?; + Some(format!( + "no version event may name its heads ({}): it is never written", + why.0 + )) + }) .or_else(|| { (proposing.is_empty() && !ballot.proposals.is_empty()).then(|| { "no event proposing it is above the heads it names: no version \ -- cgit v1.3.1