regression kad-dht: v2.2.0 pin + open publish endpoint before bootstrap

Bump nim-libp2p to release/v2.2.0 (d721f9c). Move startHttpServer to right
after switch.start() so a stalled kad bootstrap can't leave a node without its
:8645 publish port (verified at 1000 nodes: injection holds even when only
~a third complete bootstrap).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
radiken
2026-07-17 22:31:30 +01:00
co-authored by Claude Opus 4.8
parent 68818fac7f
commit 7e37a02c7e
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -274,6 +274,11 @@ proc main {.async.} =
switch.mount(pingProtocol)
await switch.start()
# Open the publish endpoint up-front, before the kad-dht bootstrap below, so a
# stalled bootstrap can't keep a node from ever opening :8645.
info "Starting listening endpoint for publish controller"
discard gossipSub.startHttpServer(myId)
# Metrics
info "Starting metrics server"
let metricsServer = startMetricsServer(parseIpAddress("0.0.0.0"), prometheusPort)
@@ -310,9 +315,6 @@ proc main {.async.} =
# Periodic mesh-only pings
asyncSpawn pingMeshLoop(switch, pingProtocol, gossipSub, "test")
info "Starting listening endpoint for publish controller"
discard gossipSub.startHttpServer(myId)
await sleepAsync(2.days)
waitFor(main())
+1 -1
View File
@@ -11,5 +11,5 @@ skipDirs = @[]
requires "nim >= 2.2.0",
"nimcrypto 0.6.4",
"https://github.com/vacp2p/nim-libp2p#c470b1146fa2ef23ab88c5a0940923cf7645e9c5", # 2.1.0
"https://github.com/vacp2p/nim-libp2p#d721f9cb13c36b844957556ac04fecade371b059", # release/v2.2.0
"ggplotnim"