Skip to content

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

Merged
ovitrif merged 1 commit into
masterfrom
fix/ldk-node-rc85-master
Dec 1, 2026
Merged

ovitrif merged 1 commit into
masterfrom
fix/ldk-node-rc85-master

Conversation

@ovitrif

@ovitrif ovitrif commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #2219
Twin: synonymdev/bitkit-ios#1569
Dependency: synonymdev/ldk-node#147 (released as v0.7.0-rc.85)

Bumps ldk-node to 0.7.0-rc.85 on master, the same bump as #2222 on release-3.2.0, so master doesn't fall behind the release. 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.

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

Gaps

    1. not run on a phone yet; needs a run on a mobile network.

Models used

  • Planning/scoping: Not used
  • Implementation: Claude Opus 5.5 (reasoning: medium)
  • Review: opus (reasoning: Not exposed), gemini-4-neon-high (reasoning: Not exposed)
  • Review rounds: 2

Bumps ldk-node to 0.7.0-rc.85 on master, matching release-3.2.0: 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: none (same pins and checksums as the release-3.2.0 bump, which resolved rc.85 from GitHub Packages and a clean SwiftPM cache)
@ovitrif ovitrif added this to the 3.2.0 milestone Dec 1, 2026
@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-01T15:58:26.067675Z 0c6797e 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
Contributor

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

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

Summary

Updates ldk-node-android from 0.7.0-rc.84 to 0.7.0-rc.85 to bring in the slow-network startup fix.

  • Lightning node startup writes its first monitor over the connection already used for reads.

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

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 0c6797e (run).

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

@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 from 0.7.0-rc.84 to 0.7.0-rc.85 on master and adds the rc.85 verification checksums. Reviewed 0c6797e, full tier (dependency manifest), static: the PR branch is not built here.

What I checked

Pin: libs.versions.toml and the new verification-metadata.xml component name the same version, 0.7.0-rc.85
Checksums: the native-debug-symbols.zip sha256 matches the digest GitHub reports for that asset on the ldk-node v0.7.0-rc.85 release; the aar and module checksums are enforced by Gradle verification, and build-and-test resolved and passed with them
Upstream delta: git diff --stat v0.7.0-rc.84 v0.7.0-rc.85 in ldk-node touches only src/io/vss_store.rs plus version strings (Cargo, Package.swift, gradle.properties, pyproject), so the bindings surface the app compiles against is unchanged, as the body says
CI: build-and-test green; build-local, lint and compose-ui still running at review time

Merge confidence: 4/5, a dependency bump whose changed path (VSS write at node start) no test here exercises; the body names the device run on a mobile network as the open gap.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the runtime does not report it to the reviewer)

@ovitrif ovitrif removed this from the 3.2.0 milestone Dec 1, 2026

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

Two independent reviews.

worth doing, does not block

  • Fixes #2219 closes the issue that still tracks the closed-channel force-close. Merging this into master will auto-close #2219, but only half of that issue's Expected section is fixed here. gh issue view 2219 --json closedByPullRequestsReferences returns [2224], so GitHub has already linked this PR as the closer. The issue's second expected item is: "A closed channel's monitor is not force-closed and re-persisted on every start." A later maintainer comment says ldk-node#147 does not touch that, "so this issue stays open for it after the bumps". Where comments disagree, the later one wins, and this PR's description is later than nothing that overrides it. I searched for a separate issue (gh issue list --state all --search "force close closed channel monitor start") and found none. #2215 is a different bug. The slow keychain restore from the same thread also has no issue of its own, even though the comment says it "needs its own issue". Closing #2219 would leave both untracked. Use Part of #2219 or Refs #2219 instead. Or file the force-close (and the keychain restore) as their own issues before merging.
  • No changelog fragment, and the stated reason for skipping it is wrong. The Out of Scope note says release-3.2.0 merges back into master, so a fragment here would list the fix twice. Release branches are not merged back. git merge-base --is-ancestor shows none of origin/release-2.3.2 through origin/release-3.2.0 is an ancestor of master. Instead, a master-side record PR copies the release section into CHANGELOG.md and deletes the consumed fragments. The last ldk-node bump that shipped on both branches did it the other way. Master commit cce0cfe (rc.80) and release PR #1872 both added changelog.d/next/1870.security.md. The record PR 0443ae5 (chore: record Android 3.1.1 release) deleted master's copy and listed the entry once. CLAUDE.md asks for exactly one fragment on every user-facing fix: PR. Adding the same changelog.d/next/2219.fixed.md that #2222 carries would follow that rule and the precedent, and would not duplicate the entry.

the reviewers disagree, your call

  • Merging would close #2219 before its remaining bug is fixed (general). Objection: Real, but non-blocking rather than blocking: Confirmed: the PR targets master, which is the default branch. GitHub lists #2219 in its closingIssuesReferences. The maintainer's 13:11 comment on #2219 says the issue "stays open for it after the bumps" because ldk-node#147 doesn't touch the closed-channel force-close on start, and no other issue tracks that bug. Still, this is a one-line fix to the PR body, and a closed issue can simply be reopened, so it shouldn't block the change itself. When switching to Refs #2219, also add a Source: line as #2222 does, since a PR that closes no issue needs one.

@ovitrif

ovitrif commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

@coreyphillips

Fixes #2219 closes the issue that still tracks the closed-channel force-close.

Fixes #2219 stays, so the issue closes with the start-time fix. The force-close is now tracked on its own in #2226, and the slow keychain restore in #2227.

No changelog fragment, and the stated reason for skipping it is wrong.

3.2.0 does merge back: #2160 (release-3.2.0 → master) is open, as is synonymdev/bitkit-ios#1531, and release-3.1.0 is an ancestor of master in both apps. The rc.80 precedent shipped in 3.1.1, the release that wasn't merged back. When #2160 merges, RC prep will already have collected #2222's 2219.fixed.md into the 3.2.0 section, so a copy left in master's changelog.d/next/ would list the fix again in the next release.

@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 0c6797e.

No new actionable code findings.

The diff bumps com.synonym:ldk-node-android from 0.7.0-rc.84 to 0.7.0-rc.85 and records the new checksums. Published tag v0.7.0-rc.85 is 3f45b8ec, the release commit after ldk-node#147 (e36d347). On that tag, startup channel-monitor persistence uses the synchronous store, and the write client shares the HTTP pool with the reads from store setup and monitor load, so the first monitor write keeps the connection those reads opened. The bindings surface is unchanged. build-and-test passed at this revision, so Gradle accepted the AAR and module checksums. The native-debug-symbols sha256 matches the asset on that release. GitHub Packages refused a direct AAR download with this credential.

bitkit-ios#1569 at 3c41d8f selects the same 0.7.0-rc.85 package (3f45b8ec). For ldk-node#147, only the VSS write-connection contract and binding compatibility were checked, not a full review. #2219 also expects a closed channel's monitor not to be force-closed again on start; this bump does not change that path, which is tracked in #2226. The slow keychain restore from the same report is #2227.

Device testing: not performed in this review. Manual case 1 remains the check for this change: on a mobile network, start a mainnet or staging wallet that has a channel and compare Got new ChannelMonitor to Persistence … completed with 3.1.1.

Ready for device testing.

Reviewer model: grok-4.7
Reasoning effort: xhigh

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

Rechecked after replies, with no new commit since 0c6797e. Nothing blocking remains.

addressed

  • Fixes #2219 closes the issue that still tracks the closed-channel force-close. Rebutted: The 16:17 reply holds: the force-close is now tracked in #2226 and the slow restore in #2227. gh issue view shows both are open, and #2226's body says it was split from #2219. The maintainer's latest comment on #2219 says this PR closes it, and that comment replaces the earlier "stays open" one, so Fixes #2219 no longer leaves anything untracked.
  • No changelog fragment, and the stated reason for skipping it is wrong. Rebutted: The 16:17 reply holds against the repo. Minor releases do merge back: #1755 (release-3.1.0) and #1512 (release-3.0.0) were merged into master, and #2160 (release-3.2.0 → master) is open. Only patch branches like 3.1.1 were not merged back. #2222 adds changelog.d/next/2219.fixed.md on release-3.2.0, and release prep consumes fragments there, as the 3.2.0 section already in its CHANGELOG.md shows. In a three-way merge, a fragment added only on master is kept, so a master copy would list the fix again in the next release. Leaving it out is right here.
  • Merging would close #2219 before its remaining bug is fixed. Rebutted: Same as point 1: the closed-channel rebroadcast is now tracked by open issue #2226, which says it was split from #2219, and the maintainer's latest comment on #2219 names this PR as its closer. Closing #2219 no longer drops a tracked bug. Since Fixes #2219 stays, the PR closes an issue and needs no Source: line.

@ovitrif

ovitrif commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

Merging: approved on 0c6797e with CI green. This closes #2219 for the start time; the force-close and slow restore continue in #2226 and #2227.

@ovitrif
ovitrif merged commit beb2f88 into master Dec 1, 2026
24 checks passed
@ovitrif
ovitrif deleted the fix/ldk-node-rc85-master branch December 1, 2026 16:36
@piotr-iohk

Copy link
Copy Markdown
Collaborator

Open-channel startup smoke passed on 0c6797ec9094 in an Android 13 Pixel 6 emulator using regtest and normal lab connectivity. A cold launch recovered the existing channel and wallet balances. The active channel’s monitor start and completion markers were 66 ms apart.

The real weak-mobile timing case remains open. This measurement is from the lab connection.

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.

bug: node start takes up to a minute since ldk-node rc.82

4 participants