Skip to content

Commit

Permalink
Increase Kademlia bucket & table sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
wizeguyy committed Sep 25, 2023
1 parent 08235be commit 9e57a40
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions p2p/discover/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 9e57a40

Please sign in to comment.