Skip to content

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

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, #2219
Twin: synonymdev/bitkit-ios#1565
Companion: #2224, synonymdev/bitkit-ios#1569 (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: #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.
  • verification-metadata.xml gets the rc.85 aar, module and debug-symbol checksums, written by Gradle.
  • 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).
  • ./gradlew --write-verification-metadata sha256 help resolves 0.7.0-rc.85 from GitHub Packages and records its checksums.

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 (#2219).

Verified: ./gradlew --write-verification-metadata sha256 help resolves ldk-node-android 0.7.0-rc.85 from GitHub Packages and records its checksums
@ovitrif

ovitrif commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

release-3.2.0 briefly had this PR's commit (1094361) pushed to it directly, by mistake. I restored it to ad2881b with a force-push leased on 1094361, and cancelled the four runs that started on that commit. The change now reaches release-3.2.0 only through this PR.

@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:45:59.693595Z 1094361 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.

@ovitrif
ovitrif requested a review from piotr-iohk December 1, 2026 14:45
@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Updates ldk-node-android from rc.84 to rc.85 to pick up the reported connection-reuse fix for slow node starts.

  • The node gets through its first channel backup sooner on slow 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 #2219 (slow node start), the one change agreed for RC3.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 1094361 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@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 1094361.

No new actionable code findings.

No actionable code findings. The app pins com.synonym:ldk-node-android to 0.7.0-rc.85, records that version's AAR, module, and native debug-symbol checksums, and adds the changelog fragment. Node start still calls buildWithVssStore and buildWithVssStoreAndLnurlAuthKeyDomain with the same arguments.

On ldk-node#147, only the VSS connection contract and the binding surface this app calls were checked, not a full review. At e36d347, each side's read and write clients share one reqwest::Client built with the same 10s total, connect, and read timeouts as VssClient::new_with_headers in vss-client-ng 0.4.1. Retry policy and header provider stay on each client, and the blocking pool stays separate from the async pool. Channel-monitor persistence uses KVStoreSync, so the first monitor write uses the blocking pool that the store's schema and monitor reads already open. Release tag v0.7.0-rc.85 (3f45b8ec) only bumps versions on top of that commit; src/io/vss_store.rs is identical, and the Rust diff from rc.84 leaves the bindings API unchanged.

Compared with bitkit-ios#1565 at 7ed4afe: the same 0.7.0-rc.85 pin (Swift package revision 3f45b8ec) and the same changelog sentence. The app-level behavior matches.

build-and-test and lint succeeded on this commit, so the rc.85 artifacts resolved and the app linked. Two local e2e shards were still running; they do not assert VSS connection reuse. This review did not run the library connection test.

Device testing: not performed in this review. The author reports manual case 1 has not been run on a phone. Issue #2219 also describes a closed channel being force-closed on start. The author reports this bump leaves that load path as it is; this diff shares the VSS HTTP client, so that report is unchanged.

Ready for device testing. Manual case 1 is the remaining check: a wallet with a channel, on a mobile network, from Got new ChannelMonitor to Persistence … completed in about 0.3–0.4s. The journey capabilities table does not provide a network that drops new connections.

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 ldk-node-android 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 1094361, full tier, static: per the Bitkit track rule I do not build Android branches here, 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: tag v0.7.0-rc.85 resolves to 3f45b8ec, two commits on top of rc.84 (synonymdev/ldk-node#147 and the release commit), both with green checks; #147 merged with two approvals.
CI: green on 1094361 (build-and-test, lint, detekt, build-local, the migration matrix, e2e shards). One e2e shard (onchain_boost_receive_widgets) was still running when I posted. The red checks on the PR page come from earlier runs on the same sha (runs 46670115422 and 46670116269) that were cancelled when the current runs started.

Ruled out

  • 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 private build_client() that new_with_headers used before. Only the connection pool is shared now.
  • Read retries holding the write path: the clients still have their own retry policies (retry_policy() for reads, no_retry_policy() for writes, with retries in fenced_retry). What they share is a reqwest::Client, which is an Arc pool handle, so neither side serialises behind the other.
  • Blocking and async clients sharing a pool across runtimes: each side gets its own pool, one for the blocking path and one for the async path, both driven on the internal ldk-node-vss-runtime. The new first_write_reuses_the_read_connection test counts exactly 1 connection for the blocking side and 2 in total.
  • Checksums: verification-metadata.xml adds rc.85 entries next to rc.80 to rc.84 for the aar, module and debug symbols, and build-local / build-and-test passed with dependency verification on, so Gradle accepted them.

Merge confidence: 4/5, CI green but one e2e shard was still running, and the fix is covered only by ldk-node's connection test, not by an app-level 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: #2224 (merged) carries the same rc.85 bump, and @piotr-iohk picks the fixes from master into release-3.2.0. The iOS twin synonymdev/bitkit-ios#1565 closes for the same reason.

@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