From 5a6a8c210ff1075e475f23e62749fff7890aaa9d Mon Sep 17 00:00:00 2001 From: Prem Chaitanya Prathi Date: Fri, 26 Jun 2026 13:43:16 +0530 Subject: [PATCH] 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. --- src/chat/delivery/waku_client.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/chat/delivery/waku_client.nim b/src/chat/delivery/waku_client.nim index bc8054e..37d1578 100644 --- a/src/chat/delivery/waku_client.nim +++ b/src/chat/delivery/waku_client.nim @@ -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,