Repository navigation
Description
What happened
Found in mainnet QA of 3.2.0 RC2 (build 199, Android 17). Starting the node takes much longer on 3.2.0 than on 3.1.1 on the same phone and network, also after the only channel was closed. Until it starts, the Send sheet shows "Connecting to network".
The step that grew is LDK persisting the channel monitor while the node is built, which writes to VSS:
| Build | Got new ChannelMonitor → Persistence … completed |
|---|---|
| 3.1.1 (10 starts, 2026-11-15 to 2026-11-30) | 0.3–0.4 s every time |
| 3.2.0 (16 starts, 2026-11-30 to 2026-12-01) | 0.8, 1.0, 1.8, 3.3, 3.6, 8.6, 8.7, 8.7, 16.4, 41.4, 49.0, 62.2 s; the last session (after the channel was closed) had not finished after 49 s |
Building the node (before this step) also loads five extra on-chain wallet accounts at about 2 s each; that cost is the same on 3.1.1 and is not the regression.
Logs
3.1.1:
2026-11-30 09:44:22.841 VERBOSE [LightningService.kt:366] Building node with vssUrl: 'https://bitkit.to/vss_rs_auth' lnurlAuthServerUrl: 'https://bitkit.to/lnurl_auth/auth'
2026-11-30 09:44:45.253 TRACE [lightning::chain::chainmonitor:1373] Got new ChannelMonitor for channel 22996d62f741…
2026-11-30 09:44:45.550 INFO [lightning::chain::chainmonitor:1387] Persistence of new ChannelMonitor for channel 22996d62f741… completed
2026-11-30 09:44:45.837 DEBUG [LightningService.kt:421] Starting node… - LightningService
3.2.0:
2026-12-01 10:18:27.308 VERBOSE [LightningService.kt:459] Building node with vssUrl: 'https://api.bitkit.to/vss_rs_auth' lnurlAuthServerUrl: 'https://api.bitkit.to/lnurl_auth/auth' keyDomain: 'bitkit.to'
2026-12-01 10:18:45.622 INFO [ldk_node::builder:1679] Loaded configured wallet for OnchainWalletAccount { address_type: NativeSegwit, account_index: 6 }
2026-12-01 10:18:49.694 TRACE [lightning::chain::chainmonitor:1373] Got new ChannelMonitor for channel 22996d62f741…
2026-12-01 10:19:38.722 INFO [lightning::chain::chainmonitor:1387] Persistence of new ChannelMonitor for channel 22996d62f741… completed
2026-12-01 10:19:39.030 DEBUG [LightningService.kt:538] Starting node… - LightningService
After the channel was closed cooperatively at 10:37, the next start also force-closed the closed channel's monitor and tried to rebroadcast its commitment:
2026-12-01 11:44:08.134 [lightning::ln::channelmanager:17197] Queueing monitor update to ensure missing channel 22996d62f741… is force closed
2026-12-01 11:44:13.651 ERROR [ldk_node::chain::electrum:1051] Failed to broadcast transaction 68182f5db3c6…: Made one or multiple attempts, all errored: - invalid type: null, expected an ASCII hex string …
2026-12-01 11:44:48.758 VERBOSE [LightningService.kt:459] Building node with vssUrl: 'https://api.bitkit.to/vss_rs_auth' …
2026-12-01 11:45:10.621 TRACE [lightning::chain::chainmonitor:1373] Got new ChannelMonitor for channel 22996d62f741…
(no "Persistence … completed" or "Starting node…" by the time logs were exported at 11:45:59; support snapshot lifecycle 'Starting')
What changed between the two builds
- ldk-node rc.80 → rc.84 (fix: stop the native abort when the node stops with stuck work #1999, fix: keep a stopped node's late writes off its rebuilt node #2004, chore: bump ldk-node to 0.7.0-rc.84 #2197), which change VSS write handling and runtime shutdown.
- VSS moved from
bitkit.totoapi.bitkit.towith an LNURL-auth key domain (chore: move service endpoints to api.bitkit.to #2154, chore: move lnurl-auth to api.bitkit.to #2167).
Likely cause: ldk-node 9ab24d5 ("fence a replaced vss store's writes", released in rc.82). At rc.84, src/io/vss_store.rs:348-354 adds separate blocking_write_client / async_write_client with no_retry_policy(), retried through fenced_retry with WRITE_ATTEMPT_TIMEOUT = 30 s (:79). rc.80 had only the read clients. The build's first monitor write now opens a fresh TLS connection instead of reusing the read client's warm one, and a slow or rejected new connect costs a full request timeout before the retry. App side, LightningService.setup() (LightningService.kt:357-382) holds lifecycleMutex (LightningRepo.kt:487) for the whole build, so every node operation waits on it.
Not yet confirmed: the same start on rc.80 vs rc.84 on one network, timing Got new ChannelMonitor → Persistence … completed. This likely also needs an upstream issue in synonymdev/ldk-node.
Expected
The node starts in about the time 3.1.1 took. A closed channel's monitor is not force-closed and re-persisted on every start.
Activity
ovitrif commentedon Dec 1, 2026
Placing this in the 3.2.0 milestone as an RC blocker candidate: it is a regression from the release's own ldk-node bump (rc.80 → rc.84, #2197), visible on every node start, with "Connecting to network" for up to a minute. iOS ships the same ldk-node rc.84 (synonymdev/bitkit-ios#1550), so it likely starts slowly too. The rc.80 vs rc.84 timing on one network would confirm the cause.
ovitrif commentedon Dec 1, 2026
First timings: the slow write doesn't reproduce from a desktop network, on any host.
Store level (ldk-node rc.84, fresh store, 150 KB write to
monitors/, attempts counted):api.bitkit.tobitkit.to, 60 reads firstbitkit.toFull node (rc.84, regtest, staging VSS with LNURL-auth, one channel, 3 restarts):
Got new ChannelMonitor→Persistence … completedtook 0.12–0.13 s; build took 1.1–1.3 s.bitkit.toandapi.bitkit.toresolve to the same IP, with about 0.1 s TLS each, so the host move alone doesn't explain it.watch_channel→MonitorUpdatingPersister::persist_new_channel→ one VSSputObjectsof the full monitor.blocking_write_client/async_write_client), so the first monitor write pays a new DNS lookup, TCP connect and TLS handshake that rc.80 skipped by reusing the reads' warm connection. Its retries also run infenced_retry: 10 ms doubling backoff, 30 s per attempt. That fits the 0.8 s floor on a phone. If the new connection fails a few times, it also fits the long tail: 41 s is about 12 failed attempts of doubling backoff. Not confirmed: rc.84 doesn't log failed write attempts.release-3.2.0pins the same rc.84.Closed channel force-closed on start: LDK 0.2.8 queues
ChannelForceClosed { should_broadcast: true }on load for a monitor with no channel in the manager that hasn't seen the funding spend (no_further_updates_allowed()false), which rebroadcasts its commitment. So the 11:44 start loaded a monitor that never persisted the closing tx's confirmation: either no block was processed before the stop, or the monitor writes after the close didn't land.Next: rc.80 vs rc.84 through a proxy that makes new connections slow or fail. If rc.84 alone slows down, the fix is to share one connection pool between reads and writes, keeping
fenced_retry.ovitrif commentedon Dec 1, 2026
Cause confirmed on rc.84; fix in synonymdev/ldk-node#147.
A local proxy that makes new connections slow or fail separates the versions:
rc.80 writes over the connection the reads just opened. rc.84 opens a new one for the first write, so every start pays that connect, and on a phone any failed connect adds a retry. synonymdev/ldk-node#147 shares one HTTP client between each side's reads and writes and keeps
fenced_retryas is. It doesn't roll anything back from rc.82–rc.84, so the shutdown crash fix and the stale-write protection stay.Once it's approved: release
0.7.0-rc.85, then bump both apps onrelease-3.2.0. Phone start times on that build still need checking against 3.1.1's 0.3–0.4 s.ovitrif commentedon Dec 1, 2026
Same A/B on rc.82 (RC1): the first monitor write takes 2.30–2.50 s with 2 s added per new connection, and needs 5 attempts when the first 4 connects fail, as on rc.84. So RC1 is affected too, and rc.83's LNURL-auth key domain isn't the cause.
iOS
release-3.2.0builds the node the same way (buildWithVssStoreAndLnurlAuthKeyDomainon rc.84), so it goes through the same write path. An iOS device start timing still needs a tester.synonymdev/ldk-node#147 doesn't touch the closed-channel force-close on start. That one is LDK's load path for a monitor that never persisted the closing tx's confirmation, so this issue stays open for it after the bumps.
ovitrif commentedon Dec 1, 2026
Slow restore on 3.2.0 (Pixel 10 Pro, mainnet, no channels): it isn't the VSS monitor write. synonymdev/ldk-node#147 doesn't change it.
This wallet has no channels, so there's no
Got new ChannelMonitorline and no monitor write. The restore took 3 min 16 s. About 178 s of that went to five keychain passes over the WALLET backup, around 35 s each:restoreUsdtRecovery: upsertUSDT_PENDING_BACKUP_RESTORErestoreUsdtRecovery: upsertPAYKIT_PENDING_BACKUP_RESTOREperformFullRestoreFromLatestBackup: loadPAYKIT_PENDING_BACKUP_RESTORErestoreWalletBackup: upsertPAYKIT_PENDING_BACKUP_RESTOREretainRecoveryBackup: upsertPAYKIT_RECOVERY_BACKUPPAYKIT_RECOVERY_BACKUPis 3.04 MB of base64, about 2.3 MB of data. Every other keychain entry is under 1.2 KB.AndroidKeyStorecreates when the device has one (this phone does).The node start was slow because of this:
AndroidKeyStore.encryptanddecryptare@Synchronized, so every keychain read waits behind a large pass.LightningService.buildNodeloadsBIP39_MNEMONICand waited 19.6 s, until pass 1 finished.VssBackupClientLdk.setuploads it again and waited 35.4 s, until pass 2 finished.The same keychain passes are already in v3.1.1; 3.2.0 only adds the small
PAYKIT_ALLOWANCE_RESTORE_PAUSEwrite. The time grows with the size of the WALLET backup, so this needs its own issue rather than a place in RC3. Fix options:ovitrif commentedon Dec 1, 2026
@jvsena42's RC2 export agrees with the cause fixed in synonymdev/ldk-node#147.
First monitor write per node start, 3.2.0 (
Got new ChannelMonitor→Persistence … completed), against other requests in the app that failed to connect meanwhile (transport_error,error sending request):fenced_retry's backoff. That is the case the proxy A/B reproduced, and rc.85 writes over the reads' connection instead.fix: speed up node start on slow networks
ovitrif commentedon Dec 1, 2026
#2224 closes this issue with the start-time fix (ldk-node 0.7.0-rc.85, also in #2222 for RC3). The rest is split out:
fix: speed up node start on slow networks (#2224)