From 53809129a56633d8bc58c399bc6a98affcfe39eb Mon Sep 17 00:00:00 2001 From: Giuliano Mega Date: Tue, 2 Apr 2024 09:31:52 -0300 Subject: [PATCH] Disable Discv5 bucket and routing table IP limits (#764) * disable Discv5 bucket and routing table IP limits * actually configure the discovery protocol --- codex/discovery.nim | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/codex/discovery.nim b/codex/discovery.nim index ce0b4032..af269324 100644 --- a/codex/discovery.nim +++ b/codex/discovery.nim @@ -16,7 +16,7 @@ import pkg/questionable import pkg/questionable/results import pkg/stew/shims/net import pkg/contractabi/address as ca -import pkg/codexdht/discv5/protocol as discv5 +import pkg/codexdht/discv5/[routing_table, protocol as discv5] import ./rng import ./errors @@ -193,6 +193,18 @@ proc new*( self.updateAnnounceRecord(announceAddrs) + # -------------------------------------------------------------------------- + # FIXME disable IP limits temporarily so we can run our workshop. Re-enable + # and figure out proper solution. + let discoveryConfig = DiscoveryConfig( + tableIpLimits: TableIpLimits( + tableIpLimit: high(uint), + bucketIpLimit:high(uint) + ), + bitsPerHop: DefaultBitsPerHop + ) + # -------------------------------------------------------------------------- + self.protocol = newProtocol( key, bindIp = bindIp.toNormalIp, @@ -200,6 +212,7 @@ proc new*( record = self.providerRecord.get, bootstrapRecords = bootstrapNodes, rng = Rng.instance(), - providers = ProvidersManager.new(store)) + providers = ProvidersManager.new(store), + config = discoveryConfig) self