From 598caecb7e5470e26379be4b2e199f6656ebb72c Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 14:09:22 +0000 Subject: federation: a set keeps where its store stands, and its entries' names Saying where a set stands read the store's heads anew, which costs its events, and finding an entry by its name hashed every entry: both for every message. A set now keeps the one, read anew where its store changed, and the other as entries come and go; in tests both are compared with what is read anew. --- src/federation/store/passing.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/federation/store/passing.rs') diff --git a/src/federation/store/passing.rs b/src/federation/store/passing.rs index 95e1c3a..5a6e2af 100644 --- a/src/federation/store/passing.rs +++ b/src/federation/store/passing.rs @@ -18,7 +18,6 @@ use std::time::Instant; use serde::{Deserialize, Serialize}; -use sha2::{Digest, Sha256}; use super::entry::Entry; @@ -80,16 +79,8 @@ impl Took { /// Where `set` stands. pub(crate) fn stamp(set: &Set) -> Stamp { - let mut hasher = Sha256::new(); - hasher.update(Id::of(set.store().checkpoint()).0); - // In one order on every node: a store says its heads as it took them. - let mut heads = set.store().heads(); - heads.sort(); - for head in heads { - hasher.update(head.0); - } Stamp { - heads: hasher.finalize().into(), + heads: set.stands(), names: set.names().fingerprint(), } } -- cgit v1.3.1