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:
Prem Chaitanya Prathi 2026-06-26 13:43:16 +05:30
parent 556b456eb3
commit 5a6a8c210f
No known key found for this signature in database

View File

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