diff options
| author | tv <tv@krebsco.de> | 2026-11-19 01:48:57 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-19 03:19:12 +0100 |
| commit | e0075264e9efdd4c8a32290c0d5643e7f48bfb14 (patch) | |
| tree | 646f0ab7fb2dd61e93bc1b8cce6f6a13a5ff0b8b /src/federation/vote.rs | |
| parent | 31d41eb1c902c907a5c6e5608510f96c4b1bc864 (diff) | |
federation: a checkpoint of 64 heads at most, a version of 96 parties
No event is above more heads than it may name dependencies (64): a version naming more
for its checkpoint is never written. A node voting by itself proposed one at whatever
heads it held for a while, however many; it now proposes none past 64, as what is
written merges them, and a party's client backs none such (`client::backable`).
A version event names the votes passing a proposal, two thirds of its version's
parties: past 96 parties, more than an event may name. A version names at most 96 now
(`version::PARTIES`).
Diffstat (limited to 'src/federation/vote.rs')
| -rw-r--r-- | src/federation/vote.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/federation/vote.rs b/src/federation/vote.rs index 1b4de16..693339e 100644 --- a/src/federation/vote.rs +++ b/src/federation/vote.rs @@ -397,7 +397,11 @@ fn checkpoint(seen: &Seen<'_>, rules: &Rules, current: &Version, all: &[Proposed .flatten() .collect(); let heads: Vec<Id> = held.difference(&built_on).copied().collect(); - if heads.is_empty() || store.state_at(&heads).current().hash != current.hash { + // No event is above more heads than it may name: what is written merges them. + if heads.is_empty() + || heads.len() > super::event::DEPENDENCIES + || store.state_at(&heads).current().hash != current.hash + { return None; } let Json::Object(mut members) = current |
