From 31d41eb1c902c907a5c6e5608510f96c4b1bc864 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 19 Nov 2026 01:48:57 +0000 Subject: store: a new event builds on as many heads as an event may name A party's client builds on the heads its node shows (`GET /events`), and a node on its own heads; an event names at most 64 dependencies. With more heads than that, where many write at once and nothing merges, every event built on them was none. `Store::building_on` gives the heads, as many as an event may name (`Fold::DEPENDENCIES`, the federation's 64), the earliest taken first, so that what is written merges what stayed apart the longest; `GET /events` shows those, and a node voting by itself builds on them. --- src/federation/fold.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/federation/fold.rs') diff --git a/src/federation/fold.rs b/src/federation/fold.rs index 7986a13..46f56e1 100644 --- a/src/federation/fold.rs +++ b/src/federation/fold.rs @@ -626,6 +626,8 @@ impl Fold for Federation { const LARGEST: usize = event::LARGEST; + const DEPENDENCIES: usize = event::DEPENDENCIES; + fn dependencies(event: &[u8]) -> Option> { Event::read(event).map(|event| event.deps().to_vec()) } -- cgit v1.3.1