aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/store/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-16 17:18:47 +0000
committertv <tv@krebsco.de>2026-11-16 18:30:01 +0100
commitb4aa915fcd1d6f49c4b00d207881b269442644fb (patch)
treeab296ab6d62b42e4e1ea08b1b91d28d7383c4cde /src/federation/store/mod.rs
parente568c7729ca498fb817ab9941f23a21bb5e905b2 (diff)
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.
Diffstat (limited to 'src/federation/store/mod.rs')
-rw-r--r--src/federation/store/mod.rs3
1 files changed, 3 insertions, 0 deletions
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<Vec<Id>>;