Fix bloom filter cascade: gate re-announcements on content change

FilterAnnounce messages never settled in steady state because
handle_filter_announce unconditionally marked all peers for
re-announcement on every inbound filter, creating a perpetual
ping-pong at ~1 message/sec.

Added last_sent_filters tracking to BloomState. mark_changed_peers()
computes outgoing filters and compares against what was last sent,
only marking peers whose filter content actually differs.
This commit is contained in:
Johnathan Corgan
2026-02-14 23:36:39 +00:00
parent 57b2eef995
commit 89bc9cc4b0
3 changed files with 51 additions and 10 deletions
+2 -1
View File
@@ -107,7 +107,8 @@ impl Node {
}
}
// Bloom filter cleanup: our outgoing filter changed (lost a peer's filter)
// Bloom filter cleanup: clear state for removed peer, mark remaining
self.bloom_state.remove_peer_state(node_addr);
let remaining_peers: Vec<NodeAddr> = self.peers.keys().copied().collect();
self.bloom_state.mark_all_updates_needed(remaining_peers);