From b4aa915fcd1d6f49c4b00d207881b269442644fb Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Nov 2026 17:18:47 +0000 Subject: store: the fold says how large an event may be, and the document judges by it The document took any bytes that hash to their key, while the fold bounds events (the federation: 256 KiB): one change of any size filled every node until the next remake. How large an event may be is a question of the change alone, so the fold says it (`Fold::LARGEST`), the document refuses a change putting a larger one, and the store takes such bytes as none. --- docs/store.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/store.md b/docs/store.md index dad1485..e23a6a0 100644 --- a/docs/store.md +++ b/docs/store.md @@ -87,6 +87,7 @@ A fold says, of its events: * **what an event builds on**, read from its bytes; bytes that aren't one of its events are none, and are refused; +* **how large an event may be**, which the document judges a change by (On Automerge); * **whether an event is taken where its history reads as a given state**: judging. A root is taken only as its own store's, never by judging; * **the state a checkpoint and the events after it read as**, built by adding the events @@ -106,6 +107,8 @@ In Rust, roughly: ```rust pub trait Fold { type State: Clone; + /// The most bytes an event may have: larger ones are none. + const LARGEST: usize; /// What the event builds on; `None` where its bytes are none of this fold's events. fn dependencies(event: &[u8]) -> Option>; /// Whether the event is taken where its history reads as `at`. @@ -226,8 +229,8 @@ nothing else of a strict policy: the document holds no values but events. A change of a swarm holding a store writes nothing but: -* **events**: at `_continuum/events/` the bytes whose ID it is, at a key held - nowhere at the change's history; +* **events**: at `_continuum/events/` the bytes whose ID it is, no more than its fold + allows, at a key held nowhere at the change's history; * **its node's own protocol data**: its entry, its acks, a remake's record and proposal, and, as a remake's coordinator, its decision or its abort; or, an epoch's first change, epochs, the swarm's ID, the policy and the checkpoint. @@ -407,6 +410,7 @@ crafted changes. *Sim*: a simulation. *Bench*: measured, not judged. | 29 | Flooding: events, writers, history, remakes | Slow, or out of memory; not wrong | bench | | 30 | A member decides compactions, grinding their IDs until the new epoch's ID is lower than the honest one's | Nodes on the honest epoch rejoin the lower, once a generation; no event is lost: slow, not wrong | sim | | 31 | A made-up epoch whose snapshot holds a checkpoint before the node's document's, the root say | Not followed: a node follows an epoch only where the snapshot's checkpoint is its document's, one it builds from it, or one its operator pins | sim | +| 32 | An event larger than the fold allows, put by a change | Refused: the change, by its own bytes; the store takes it nowhere | unit | ## Tests -- cgit v1.3.1