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:
parent
e8b55bdb27
commit
d4b9172455
3 changed files with 132 additions and 17 deletions
|
|
@ -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 });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue