diff options
| author | tv <tv@krebsco.de> | 2026-11-19 01:48:57 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-19 03:18:59 +0100 |
| commit | 31d41eb1c902c907a5c6e5608510f96c4b1bc864 (patch) | |
| tree | 5a1a38166c6b22312b4d1eb02adc5dc5f12bce95 /src/api | |
| parent | 03744437a5ffc36fbb5e973a0ddfd6b91945b212 (diff) | |
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.
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/events.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api/events.rs b/src/api/events.rs index 214882a..b13de63 100644 --- a/src/api/events.rs +++ b/src/api/events.rs @@ -81,7 +81,8 @@ fn why(refusal: &Refusal) -> String { } } -/// `GET /events`: the store's ID, its checkpoint's, its heads, how many events it took +/// `GET /events`: the store's ID, its checkpoint's, its heads, as many as an event may +/// name, what a new event builds on (`Store::building_on`), how many events it took /// after its checkpoint, the event it stopped at, if any, the node's party, and whether /// the node votes for it by itself. async fn summary(State(state): State<AppState>) -> Response { @@ -94,7 +95,7 @@ async fn summary(State(state): State<AppState>) -> Response { json!({ "store": store.id().to_string(), "checkpoint": Id::of(store.checkpoint()).to_string(), - "heads": ids(store.heads()), + "heads": ids(store.building_on()), "taken": store.taken().len(), "stopped": stopped, "party": party, |
