mirror of
https://github.com/logos-messaging/nim-chat-poc.git
synced 2026-07-07 00:49:35 +00:00
perf(mix): don't block node startup on kad DHT bootstrap
Mounting Kademlia for fleet mix-discovery put KadDHT.start()'s blocking initial bootstrap (iterative self-lookup + per-bucket refresh) onto the switch.start() critical path, so node start (and the UI 'Starting...') waited for discovery to converge. Set disableBootstrapping=true so the node comes up immediately; the mix pool fills in the background via the maintenance + service-lookup + top-up loops.
This commit is contained in:
parent
556b456eb3
commit
5a6a8c210f
@ -360,7 +360,13 @@ proc start*(client: WakuClient) {.async.} =
|
||||
servicesToDiscover: toHashSet(@[mix_proto.MixProtocolID]),
|
||||
randomLookupInterval: chronos.seconds(15),
|
||||
serviceLookupInterval: chronos.seconds(15),
|
||||
kadDhtConfig: KadDHTConfig.new(),
|
||||
# Don't block node startup on the initial DHT bootstrap (an iterative
|
||||
# self-lookup + per-bucket refresh). With it on, KadDHT.start() ->
|
||||
# await bootstrap() runs inside switch.start(), so the whole node start
|
||||
# (and the UI "Starting...") waits for discovery to converge. Disabled,
|
||||
# the node comes up immediately and the mix pool fills in the background
|
||||
# via maintainBuckets + runServiceLookupLoop + runServicePeerTopUp.
|
||||
kadDhtConfig: KadDHTConfig.new(disableBootstrapping = true),
|
||||
discoConfig: sd_types.ServiceDiscoveryConfig.new(),
|
||||
clientMode: false,
|
||||
xprPublishing: true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user