gossip: replicate account state only, keep channels node-local

Each event now has a scope: account identity is global and gossips to
every peer; channel state is local to the node that authored it. The
version vector, push, digest and compaction only carry global events,
and ingest refuses any non-global entry a peer sends. A node can no
longer be handed ownership of a channel registered on a network it was
never part of.
This commit is contained in:
Jean Chevronnet 2026-07-12 12:20:24 +00:00
parent e8b55bdb27
commit d4b9172455
No known key found for this signature in database
3 changed files with 132 additions and 17 deletions

View file

@ -127,6 +127,16 @@ impl Engine {
self.db.exists(name)
}
#[cfg(test)]
pub(crate) fn test_register_channel(&mut self, name: &str, founder: &str) {
self.db.register_channel(name, founder).unwrap();
}
#[cfg(test)]
pub(crate) fn test_has_channel(&self, name: &str) -> bool {
self.db.channel(name).is_some()
}
// Insert or refresh a client's in-progress SASL session, stamped now.
fn stash_sasl(&mut self, client: String, session: SaslSession) {
self.sasl_sessions.insert(client, TimedSession { touched: Instant::now(), session });