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. --- src/federation/store/mod.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/federation/store/mod.rs') diff --git a/src/federation/store/mod.rs b/src/federation/store/mod.rs index b11c81a..ad1720d 100644 --- a/src/federation/store/mod.rs +++ b/src/federation/store/mod.rs @@ -72,6 +72,9 @@ pub(crate) trait Fold { /// reading need of the events' history. 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>; -- cgit v1.3.1