regression: open the publish endpoint before the bootstrap dial

A node's mesh arrives on inbound dials from nodes that bootstrapped earlier, so it is
ready to publish long before its own staggered dial returns. Gating :8645 on that dial
left half a 1000-node fleet refusing publishes: the statefulset reported all 1000 ready
at 01:46:35 while pod-700 did not finish its own dial until 01:55, and 32 of 600
injections were refused. Restores the ordering from 7e37a02, which only ever landed on a
campaign branch.
This commit is contained in:
radiken
2026-08-12 10:06:02 +01:00
parent 8ed2736670
commit f7cd9fe97d
+6 -2
View File
@@ -204,6 +204,12 @@ proc main {.async.} =
await switch.start()
# Before the staggered bootstrap dial below, not after. A node's mesh arrives on
# inbound dials from nodes that bootstrapped earlier, so it can publish long before
# its own dial returns; gating :8645 on that left half the fleet refusing publishes.
info "Starting listening endpoint for publish controller"
discard gossipSub.startHttpServer(myId)
info "Starting metrics server"
let metricsServer = startMetricsServer(parseIpAddress("0.0.0.0"), prometheusPort)
if metricsServer.isErr:
@@ -238,8 +244,6 @@ proc main {.async.} =
# Hold connections open until gossipsub traffic takes over
asyncSpawn pingLoop(switch, pingProtocol)
info "Starting listening endpoint for publish controller"
discard gossipSub.startHttpServer(myId)
await sleepAsync(2.days)