mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
docs: correct stale doc-comments for LAN handshake and mesh-size
poll_lan_discovery's comment said Noise XX, but LAN-discovered peers dial over UDP through initiate_connection, which uses Noise IK (IK at FMP). compute_mesh_size's header comment still described the obsolete sum-of-disjoint-subtrees estimate; the function OR-unions every connected peer's inbound filter plus self and estimates cardinality once (matching the body comment). Comment-only, no behavior change.
This commit is contained in:
@@ -901,9 +901,9 @@ impl Node {
|
||||
}
|
||||
}
|
||||
|
||||
/// Drain mDNS-discovered peers and initiate Noise XX handshakes.
|
||||
/// Drain mDNS-discovered peers and initiate Noise IK handshakes.
|
||||
/// The handshake itself is the authentication — a spoofed mDNS advert
|
||||
/// with someone else's npub fails the XX exchange and is dropped.
|
||||
/// with someone else's npub fails the IK exchange and is dropped.
|
||||
pub(super) async fn poll_lan_discovery(&mut self) {
|
||||
let Some(runtime) = self.lan_discovery.clone() else {
|
||||
return;
|
||||
|
||||
+6
-3
@@ -1307,9 +1307,12 @@ impl Node {
|
||||
|
||||
/// Compute and cache the estimated mesh size from bloom filters.
|
||||
///
|
||||
/// Uses the spanning tree partition: parent's filter covers nodes reachable
|
||||
/// upward, children's filters cover disjoint subtrees downward. The sum
|
||||
/// of estimated entry counts plus one (self) approximates total network size.
|
||||
/// Builds an OR-union of self plus every connected peer's inbound filter
|
||||
/// and estimates its cardinality once. Unioning (rather than summing
|
||||
/// per-peer counts) deduplicates the overlap between the split-horizon
|
||||
/// filters, each of which approximates "the whole mesh minus my subtree".
|
||||
/// See the body for why all routing peers contribute, not just the tree
|
||||
/// neighborhood.
|
||||
pub(crate) fn compute_mesh_size(&mut self) {
|
||||
let my_addr = *self.tree_state.my_node_addr();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user