diff options
| author | tv <tv@krebsco.de> | 2026-11-29 14:09:22 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-29 14:09:22 +0000 |
| commit | 598caecb7e5470e26379be4b2e199f6656ebb72c (patch) | |
| tree | 7604f1bac650a719ea3ac8e071350ccc517b5d19 /src/federation/store/passing.rs | |
| parent | dde5570e80b0584a19f92011780e202db4924a74 (diff) | |
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.
Diffstat (limited to 'src/federation/store/passing.rs')
| -rw-r--r-- | src/federation/store/passing.rs | 11 |
1 files changed, 1 insertions, 10 deletions
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<F: Fold>(set: &Set<F>) -> 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(), } } |
