Disable Discv5 bucket and routing table IP limits ()

* disable Discv5 bucket and routing table IP limits

* actually configure the discovery protocol
This commit is contained in:
Giuliano Mega 2024-04-02 09:31:52 -03:00 committed by GitHub
parent 0a34c37c87
commit 53809129a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 2 deletions

View File

@ -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