diff options
| author | tv <tv@krebsco.de> | 2026-11-18 17:26:53 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-18 18:31:11 +0100 |
| commit | 598366b03679eac9d04f32d9194f3ba4ba9c3da8 (patch) | |
| tree | 91620955243fa081fdd0365fb76c8aca0ba4288c /src/federation/store/mod.rs | |
| parent | f261a80b88c1fb640f4c892934809e15a7e05a95 (diff) | |
store: a drop refuses whatever writes what a dropped event writes
A fold may say what an event writes that others may write alike
(`Fold::writes`): of the federation, a version event's version. A node
whose operator has it drop such an event drops the taken events writing
the same with it, and refuses any writing it from then on, whoever wrote
it anew: of a version, it takes no other version event naming it and
writes none itself, though it holds the votes that passed it. The node
keeps what each dropped event writes in its store file, across restarts;
allowing one of them takes them all back.
Row 51 of the federation's attacks has its test, and waits no more.
Diffstat (limited to 'src/federation/store/mod.rs')
| -rw-r--r-- | src/federation/store/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/federation/store/mod.rs b/src/federation/store/mod.rs index ec3fb56..4027fb9 100644 --- a/src/federation/store/mod.rs +++ b/src/federation/store/mod.rs @@ -94,6 +94,12 @@ pub(crate) trait Fold { true } + /// What the event writes that other events may write alike, where it writes such: a + /// node refuses whatever writes what an event its operator had it drop writes. + fn writes(_event: &[u8]) -> Option<Id> { + None + } + /// The checkpoint at `heads`, read as `at`: its bytes, and the events it keeps. fn checkpoint(at: &Self::State, heads: &[Id]) -> (Vec<u8>, Vec<Id>); |
