Skip to content

fix: speed up node start on slow networks - #1565

Closed
ovitrif wants to merge 1 commit into
release-3.2.0from
fix/ldk-node-rc85
Closed

ovitrif wants to merge 1 commit into
release-3.2.0from
fix/ldk-node-rc85

Conversation

@ovitrif

@ovitrif ovitrif commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Source: team, synonymdev/bitkit-android#2219
Twin: synonymdev/bitkit-android#2222
Companion: #1569, synonymdev/bitkit-android#2224 (the same bump on master)
Dependency: synonymdev/ldk-node#147 (released as v0.7.0-rc.85)

Bumps ldk-node to 0.7.0-rc.85 on release-3.2.0 for RC3. Since rc.82, the first ChannelMonitor write at node start opened a new VSS connection, so a network that drops new connects sent it through the write retry backoff: 0.8–62 s on 3.2.0 against 0.3 s on 3.1.1. In rc.85, writes reuse the connection the store's reads opened. Cause and timings: synonymdev/bitkit-android#2219 (comment)

Description

  • ldk-node 0.7.0-rc.84 → 0.7.0-rc.85. rc.85 changes only src/io/vss_store.rs and the version numbers; the bindings API is the same as rc.84.
  • Package.resolved pinned to the v0.7.0-rc.85 tag commit 3f45b8ec.
  • Changelog fragment for the fix.

Out of Scope

Design

N/A — no UI changes.

Preview

N/A

QA Notes

Setup

Mainnet or staging wallet with a channel, on a mobile network.

Journeys

N/A — not drivable; see Manual Tests.

Manual Tests

  • 1. Start the app with a channel open → Got new ChannelMonitor → Persistence … completed in the log takes about as long as on 3.1.1 (0.3–0.4 s), with no multi-second stalls on a weak network — real mobile network conditions not in Capabilities

Automated Checks

N/A

Evidence

  • ldk-node side: a local proxy that delays or fails new connections gives rc.84 2.33–2.41 s and 5 attempts for the first monitor write, against 0.38 s and 1 attempt on rc.85 (fix: reuse the read connection for vss writes ldk-node#147).
  • xcodebuild -resolvePackageDependencies from a clean package cache resolves 0.7.0-rc.85; SwiftPM checks the xcframework checksum.

Gaps

    1. not run on a phone yet; needs a release tester's run on a mobile network.

Models used

  • Planning/scoping: Not used
  • Implementation: Claude Opus 5.5 (reasoning: medium)
  • Review: opus (reasoning: Not exposed)
  • Review rounds: 1

Bumps ldk-node to 0.7.0-rc.85: VSS writes reuse the connection the store's reads opened (synonymdev/ldk-node#147), so the first ChannelMonitor write at node start doesn't wait on a new connect and its retries (synonymdev/bitkit-android#2219).

Verified: xcodebuild -resolvePackageDependencies from a clean package cache resolves ldk-node 0.7.0-rc.85
@ovitrif ovitrif self-assigned this Dec 1, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T14:46:02.825638Z 7ed4afe PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The supplied changes appear safe to merge, with no actionable issues found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The supplied changes appear safe to merge, with no actionable issues found.

Summary

Updates ldk-node from 0.7.0-rc.84 to 0.7.0-rc.85 to reduce startup delays on slow networks.

  • Lightning node startup avoids extra waits on weak mobile networks.

Reviews (1) · Last reviewed commit: "fix: speed up node start on slow network..." · Reviewed by Greptile

@ovitrif ovitrif added this to the 3.2.0 milestone Dec 1, 2026
@ovitrif

ovitrif commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

In 3.2.0: this is the RC3 fix for slow node start (synonymdev/bitkit-android#2219), twin of synonymdev/bitkit-android#2222, the one change agreed for RC3.

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review

Scope: full PR diff against its merge base, at 7ed4afe.

No new actionable code findings.

No actionable code findings. The app pins ldk-node 0.7.0-rc.85 at 3f45b8ec4eabca452697405518114beb001ffa02, the commit of tag v0.7.0-rc.85. That revision contains the VSS write-connection reuse from ldk-node#147. Only that contract was checked, not a full review of ldk-node.

Channel-monitor persistence goes through LDK's synchronous store wrapper into VssStore's blocking write client. At rc.85 that client shares its HTTP pool with the blocking read client used for store setup and monitor reads. Write retries, the 10-second timeouts, and rustls stay on the existing vss-client-ng 0.4.1 client. The Swift API is unchanged: LightningService still calls buildWithVssStore and buildWithVssStoreAndLnurlAuthKeyDomain. GitHub's digest for the published v0.7.0-rc.85 xcframework matches the checksum in that revision's Package.swift.

bitkit-android#2222 at 1094361 bumps the same version and uses the same changelog sentence. That comparison is not a full review of the Android PR.

Device testing: not performed in this review. Manual case 1 is the runtime check; the journey environment has no capability for a network that drops new connections. The author reports case 1 has not been run on a phone. At review time SwiftFormat had passed on this head, and the app build and unit tests were still running. The failed prepare-wallets job is the legacy React Native v1.1.6 restore fixture: the Android GRAB control was not shown (log).

Reviewer model: grok-4.7
Reasoning effort: xhigh

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings. Bumps the ldk-node Swift package 0.7.0-rc.84 to rc.85 on release-3.2.0, so the first ChannelMonitor write reuses the VSS connection the reads opened. Reviewed 7ed4afe, full tier, static: iOS does not build on this Linux box, so this is reasoned from the code and CI.

What I checked, and 4 candidates I ruled out

Read in full: the PR diff (3 files); git diff v0.7.0-rc.84 v0.7.0-rc.85 in ldk-node (8 files, only src/io/vss_store.rs is code); VssClient::new_with_headers / from_client_and_headers / build_client in vss-client-ng 0.4.1, the version rc.85's Cargo.lock pins.
Dependency: annotated tag v0.7.0-rc.85 dereferences to 3f45b8ec4eabca452697405518114beb001ffa02, which matches Package.resolved exactly (and rc.84's tag matched the old revision 05c70958). rc.85's Package.swift points at that release's LDKNodeFFI.xcframework.zip with checksum 7837d164…, and the release has that asset. #147 merged with two approvals and green checks.
CI: SwiftFormat, Greptile, migration-plan and prepare-wallets (rn_upgrade) pass. build and Run Tests were still running when I posted. prepare-wallets (rn_restore) failed, and that failure is not from this change: the job prepares a legacy React Native wallet on an Android emulator, and it timed out waiting for the GRAB element (Failed to prepare independent wallet 3 after 3 attempts). It never runs this PR's iOS build.

Ruled out

  • pbxproj and Package.resolved disagreeing: both pin exactVersion 0.7.0-rc.85, and the revision is the tag's commit. originHash did not change, as in the earlier rc bumps on this branch (rc.82 to rc.84), because the set of package references stayed the same.
  • Timeout change from the shared client: rc.85's build_http_client() uses 10 s for timeout, connect and read, the same as vss-client's own build_client(). Only the connection pool is shared now.
  • Read retries holding the write path: retry policies are still per client (no_retry_policy() for writes, with retries in fenced_retry). They share a reqwest::Client, which is an Arc pool handle, not a lock.
  • Bindings API drift: the rc.84 to rc.85 diff touches no UDL and no binding source, only version strings, so the Swift API is unchanged.

Merge confidence: 4/5, build and Run Tests had not finished when I posted, and the fix is covered only by ldk-node's connection test (the PR lists the on-device run as an open gap).

@ovitrif

ovitrif commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

Closing in favour of master: #1569 carries the same rc.85 bump, and @piotr-iohk picks the fixes from master into release-3.2.0. The Android twin synonymdev/bitkit-android#2222 closes for the same reason (its master twin synonymdev/bitkit-android#2224 is merged).

@ovitrif ovitrif closed this Dec 1, 2026
@ovitrif
ovitrif deleted the fix/ldk-node-rc85 branch December 1, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants