From dd5bb695eda4b660c67bb6e7c1d389e33b374805 Mon Sep 17 00:00:00 2001 From: Kim De Mey Date: Wed, 25 Sep 2024 17:38:33 +0200 Subject: [PATCH] Tune revalidateMax + defaultMaxGossipNodes values in wire protocol (#2658) The revalidateMax value is lowered to have a quicker ramp up of the radiusCache + to keep it healthier. The defaultMaxGossipNodes value is lowered because with the current value a Nodes lookup is triggered almost always. This value is dependant on the content replication value. This is dependant on the network (and subnetwork) because of the amount of nodes and their radius/storage capacity. --- fluffy/network/wire/portal_protocol.nim | 6 +++--- fluffy/network/wire/portal_protocol_config.nim | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fluffy/network/wire/portal_protocol.nim b/fluffy/network/wire/portal_protocol.nim index b5e6495e3..93e90ca75 100644 --- a/fluffy/network/wire/portal_protocol.nim +++ b/fluffy/network/wire/portal_protocol.nim @@ -115,7 +115,7 @@ const ## that will be processed refreshInterval = 5.minutes ## Interval of launching a random query to ## refresh the routing table. - revalidateMax = 10000 ## Revalidation of a peer is done between 0 and this + revalidateMax = 4000 ## Revalidation of a peer is done between 0 and this ## value in milliseconds initialLookups = 1 ## Amount of lookups done when populating the routing table @@ -1500,8 +1500,8 @@ proc neighborhoodGossip*( # 1. Select the closest neighbours in the routing table # 2. Check if the radius is known for these these nodes and whether they are # in range of the content to be offered. - # 3. If more than n (= 8) nodes are in range, offer these nodes the content - # (max nodes set at 8). + # 3. If more than n (= maxGossipNodes) nodes are in range, offer these nodes + # the content (maxed out at n). # 4. If less than n nodes are in range, do a node lookup, and offer the nodes # returned from the lookup the content (max nodes set at 8) # diff --git a/fluffy/network/wire/portal_protocol_config.nim b/fluffy/network/wire/portal_protocol_config.nim index c78de53b3..e6081fbbd 100644 --- a/fluffy/network/wire/portal_protocol_config.nim +++ b/fluffy/network/wire/portal_protocol_config.nim @@ -46,7 +46,7 @@ const defaultRadiusConfig* = RadiusConfig(kind: Dynamic) defaultRadiusConfigDesc* = $defaultRadiusConfig.kind defaultDisablePoke* = false - defaultMaxGossipNodes = 8 + defaultMaxGossipNodes = 4 revalidationTimeout* = chronos.seconds(30) defaultPortalProtocolConfig* = PortalProtocolConfig(