From bac68a1ba39b568c658d60a1d18a869e1d733740 Mon Sep 17 00:00:00 2001 From: Yusef Napora Date: Tue, 19 May 2020 11:37:29 -0400 Subject: [PATCH] add doc comment for GossipSubDout --- gossipsub.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gossipsub.go b/gossipsub.go index d084325..c4bebc0 100644 --- a/gossipsub.go +++ b/gossipsub.go @@ -49,7 +49,14 @@ var ( // At least GossipSubDscore of the retained peers will be high-scoring, while the remainder are // chosen randomly. GossipSubDscore = 4 - GossipSubDout = 2 + + // GossipSubDout sets the quota for the number of outbound connections to maintain in a topic mesh. + // When the mesh is pruned due to over subscription, we make sure that we have outbound connections + // to at least GossipSubDout of the survivor peers. This prevents sybil attackers from overwhelming + // our mesh with incoming connections. + // + // GossipSubDout must be set below GossipSubDlo, and must not exceed GossipSubD / 2. + GossipSubDout = 2 // gossip parameters