From 42dbbd753663f4698e930582a7c8d72666e7344e Mon Sep 17 00:00:00 2001 From: Padreug Date: Tue, 26 May 2026 00:29:53 +0200 Subject: [PATCH] =?UTF-8?q?disable=20pingOrDie=20watchdog=20=E2=80=94=20fa?= =?UTF-8?q?lse-positives=20on=20non-public=20relays?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NDK 2.8.1's outbox model doesn't reliably deliver self-published events back through subscriptions when the configured relay set is a single custom (non-public) relay. The pingOrDie self-watchdog publishes a kind-24133 event to its own pubkey every 20s and exits the bunker if it doesn't see the echo within 50s — which means on a private relay channel (e.g. LNbits's nostrrelay extension), the bunker exits cleanly every 50s even though admin RPCs over that same channel are working fine. Plain-WebSocket round-trips to the same relay echo correctly in <1s, so the issue is on NDK's side, not the relay's. Commenting out the watchdog is the minimum patch to keep the daemon alive. Real fix is either an env-flag opt-out, a simpler connectivity check that doesn't depend on self-echo, or an NDK upgrade that fixes the outbox-vs-subscribe race. Fixes #4. See also #7 for the underlying NDK echo investigation. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/daemon/admin/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/daemon/admin/index.ts b/src/daemon/admin/index.ts index 4db9cc2..75dfc4b 100644 --- a/src/daemon/admin/index.ts +++ b/src/daemon/admin/index.ts @@ -122,7 +122,12 @@ class AdminInterface { this.rpc.on('request', (req) => this.handleRequest(req)); - pingOrDie(this.ndk); + // pingOrDie disabled — NDK 2.8.1 outbox model doesn't echo + // self-published events back through subscriptions on + // non-public relay channels, so the watchdog fires false + // positives and exits the bunker every 50s on private relays. + // See aiolabs/nsecbunkerd#4 + #7. + // pingOrDie(this.ndk); }).catch((err) => { console.log('❌ admin connection failed'); console.log(err);