From 9e57a408d9df2863c2848f9ecfd06835d37e7187 Mon Sep 17 00:00:00 2001 From: wizeguyy Date: Mon, 25 Sep 2023 15:07:50 -0500 Subject: [PATCH] Increase Kademlia bucket & table sizes --- p2p/discover/table.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/p2p/discover/table.go b/p2p/discover/table.go index 43f6cbe978..91c420fa94 100644 --- a/p2p/discover/table.go +++ b/p2p/discover/table.go @@ -39,9 +39,9 @@ import ( ) const ( - alpha = 3 // Kademlia concurrency factor - bucketSize = 16 // Kademlia bucket size - maxReplacements = 10 // Size of per-bucket replacement list + alpha = 3 // Kademlia concurrency factor + bucketSize = 16 * common.NumRegionsInPrime * common.NumZonesInRegion // Kademlia bucket size + maxReplacements = 10 // Size of per-bucket replacement list // We keep buckets for the upper 1/15 of distances because // it's very unlikely we'll ever encounter a node that's closer. @@ -50,8 +50,8 @@ const ( bucketMinDistance = hashBits - nBuckets // Log distance of closest bucket // IP address limits. - bucketIPLimit, bucketSubnet = 2, 24 // at most 2 addresses from the same /24 - tableIPLimit, tableSubnet = 10, 24 + bucketIPLimit, bucketSubnet = 2 * common.NumRegionsInPrime * common.NumZonesInRegion, 24 // Up to 2x num chains in network + tableIPLimit, tableSubnet = 10 * common.NumRegionsInPrime * common.NumZonesInRegion, 24 // Up to 10x num chains in network refreshInterval = 30 * time.Minute revalidateInterval = 10 * time.Second