aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/client.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-19 03:52:49 +0000
committertv <tv@krebsco.de>2026-11-19 05:11:45 +0100
commit6c6f978189eafa15add0df865f713dc946dfc5cb (patch)
tree2b4c556ba96820aa6fd13c22d96cd5fe5af9e091 /src/federation/client.rs
parent54bcc0e4ee8e1e6a29e0e01369c2ba95b27abce8 (diff)
federation: merge events, the first revision
What builds on many heads merges them, but only an event a party writes: in a quiet federation, heads beside each other stay so, and past 64 no event is above them all. Revision 1 (`merge-events`) adds merge events: `{"merge": true}`, signed with a node's own key, the `key` its Ed25519 key, for the party whose node list names it. One counts for nothing, and only gathers what it builds on into the history of what builds on it. Under the base revision, signed by a node its party doesn't list, or by a party's key, it is refused; the model alike. Generated federations begin at either revision, and their nodes merge. A node voting by itself backs no version changing the revision, on any version neither: its party's operators vote on that one, once their nodes run a continuum that knows it. `federation.md` lists the revisions, says what a merge event is, and row 71 is tested (`federation_attack_71`).
Diffstat (limited to 'src/federation/client.rs')
-rw-r--r--src/federation/client.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/federation/client.rs b/src/federation/client.rs
index da64923..4d61944 100644
--- a/src/federation/client.rs
+++ b/src/federation/client.rs
@@ -342,7 +342,7 @@ impl Record {
/// What its party signs again, as a move refused it: of the latest event it signed at
/// each place, its key set and its node list, those `refused` names, each with what it
/// does. Not what a later one replaced, nor votes and proposals, whose version a move
- /// leaves behind.
+ /// leaves behind, nor merges, which a node signs.
pub(crate) fn again(&self, refused: impl Fn(&Id) -> bool) -> Vec<(Id, Does)> {
let mut latest: BTreeMap<String, (Id, Does)> = BTreeMap::new();
for text in &self.signed {
@@ -353,7 +353,7 @@ impl Record {
Does::Write { path, .. } => format!("write {}", path.join("/")),
Does::Keys(_) => "keys".to_owned(),
Does::Nodes(_) => "nodes".to_owned(),
- Does::Proposal { .. } | Does::Vote { .. } => continue,
+ Does::Proposal { .. } | Does::Vote { .. } | Does::Merge => continue,
};
latest.insert(what, (Id::of(text.as_bytes()), signed.does));
}