Skip to content

fix: stop the native abort when the node stops with stuck work - #1394

Merged
ovitrif merged 3 commits into
masterfrom
fix/ldk-node-rc81
Nov 24, 2026
Merged

ovitrif merged 3 commits into
masterfrom
fix/ldk-node-rc81

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1393
Twin: synonymdev/bitkit-android#1999

Updates LDKNode to 0.7.0-rc.81, which carries synonymdev/ldk-node#136 and synonymdev/ldk-node#138, so both apps run the same ldk-node.

Description

  • When a stop times out, a background task (e.g. a VSS write that keeps retrying) can stay running. Releasing the node shut its Tokio runtime down under that task, and the task aborted the app with A Tokio 1.x context was found, but it is being shutdown. as soon as it resumed (the top Android crash on 3.1.1, crash: native abort when the node restarts after returning from the background bitkit-android#1536). ldk-node 0.7.0-rc.81 keeps the runtime alive until that work ends, then shuts it down.
  • Bumps the exact-version pin in project.pbxproj and Package.resolved.

Out of Scope

Design

N/A — no UI changes.

Preview

N/A

QA Notes

Setup

Regtest build.

Journeys

N/A — no user-visible behaviour change.

Manual Tests

N/A

Automated Checks

Evidence

  • Unit suite (CI test selection) on an iPhone 17 simulator, iOS 26.5, against the published LDKNodeFFI.xcframework of 0.7.0-rc.81 on 45ff9d4: 4153 tests, 0 failures (5 skipped).

Gaps

  • The stuck-stop path cannot be triggered on demand in the app.
  • CI's E2E jobs have not run on this head: the runner could not open the iOS Simulator (run), as on every iOS PR today. They rerun once the runner is fixed, and the merge waits for them.

Models used

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

The pre-PR review run records only its model id.

Takes ldk-node 0.7.0-rc.81, which keeps the runtime alive until detached work ends.

Verified: none (unit suite runs next on m1a)
@ovitrif ovitrif self-assigned this Nov 23, 2026
@ovitrif
ovitrif requested review from a team, coreyphillips and piotr-iohk and removed request for a team November 23, 2026 12:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 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-11-23T12:42:21.696755Z 45ff9d4 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 Nov 23, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The supplied changes appear safe to merge; no actionable defect was established.

Summary

Updates LDKNode from 0.7.0-rc.80 to 0.7.0-rc.81 to address crashes when the node stops with background work still running.

  • The app avoids a crash when Lightning-node work outlasts a stop.

Reviews (1) · Last reviewed commit: "fix: stop the native abort when the node..." · Reviewed by Greptile

@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 LDKNode from 0.7.0-rc.80 to 0.7.0-rc.81 (the runtime reaper from synonymdev/ldk-node#136 and #138) and adds the changelog entry. Reviewed 45ff9d4, light tier.

What I checked, and 2 candidates I ruled out

Pin consistency: project.pbxproj (exactVersion 0.7.0-rc.81) and Package.resolved (revision 366d56ef) agree; 366d56ef is the commit the v0.7.0-rc.81 tag points at in synonymdev/ldk-node, and b6335ecd was the rc.80 tag, so no other reference to the old version remains on the branch.
Binary: the release's LDKNodeFFI.xcframework.zip hashes to 591ab89d...b800, the checksum rc.81's Package.swift declares.
Upstream delta rc.80..rc.81: only src/runtime.rs (the deferred shutdown through a reaper thread, plus its tests), version strings and the changelog. No file under bindings/swift changed, so the generated Swift API is the same and no call site in the app needs to move.

Ruled out

  • Swift API break from the bump: no change under bindings/ other than the Kotlin and Python version strings.
  • Mismatched pin between the project and the resolved file: both name rc.81, and the resolved revision is the tag's commit.

Not built here: on the Bitkit track an iOS branch is not built on this box (no iOS toolchain on Linux), so this review is from the code and from CI. At review time Run Tests, Run Integration Tests and build-local were still pending; SwiftFormat and validate were green.

Merge confidence: 4/5, the unit, integration and build jobs had not finished when I reviewed.

@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, nothing blocking a merge.

@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 45ff9d4.

No new actionable code findings.

No actionable code findings. LDKNode is pinned to 0.7.0-rc.81 in project.pbxproj (exactVersion) and Package.resolved (revision 366d56ef3c735406146ed12a34aba291776d29f6). That revision is the v0.7.0-rc.81 tag. The published LDKNodeFFI.xcframework.zip sha256 is 591ab89d4761ebe84f87e2ea9125f7167f896fd1e4954b0f9eba9fda8b80b800, matching the checksum in that tag's Package.swift. From rc.80 (b6335ecd86e9e9dc4e824dcb4b6065273572ca9d) the library change is src/runtime.rs: when a node is dropped while detached work is still blocked, a reaper thread keeps the Tokio runtime until that work ends. Swift bindings and the app stop and start call sites are unchanged.

Compared with bitkit-android#1999 at 3abadca for the stop/release contract only. Android takes the same rc.81 and still exits the process in the background when its monitor sees detached work. iOS leaves a retrying VSS write that can meet a rebuilt node to a later ldk-node release. bitkit-ios#1276 remains open: listenForEvents keeps each stopped node alive for the rest of the session, so this pin leaves those runtimes in place. That overlap is the existing retention behavior.

Device testing: not performed in this review. The stuck stop cannot be forced in the app, and the author marks journeys and manual tests N/A. I did not run the unit suite. The author reports 4153 tests, 0 failures (5 skipped) on this commit. On this commit, SwiftFormat and validate succeeded; Run Tests, Run Integration Tests, and build-local were still in progress.

Reviewer model: grok-4.7
Reasoning effort: xhigh

@ovitrif

ovitrif commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Auto-merge on: approved by @coreyphillips and @piotr-iohk on this head, no open threads; it merges once the required e2e check finishes green.

@ovitrif
ovitrif enabled auto-merge November 23, 2026 13:53

@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 45ff9d4. Nothing blocking remains.

the reviewers disagree, your call

  • E2E coverage the Gaps section relies on has not run on this head (general). Objection: The checked-in E2E workflow already propagates shard failures to e2e-status. GitHub access failed, so I could not independently verify the PR wording or cited job logs and cannot confirm the claimed coverage mismatch. Answer: I re-checked with gh. The PR's Gaps line says "CI's E2E jobs cover the Lightning flows on this head". The only e2e-tests run on head 45ff9d4 is run 45176623678 (attempt 1), and in its job 137714724070, "Run E2E Tests 1", "2" and "3" each failed opening the Simulator UI (Simulator.app does not exist) and reported Spec Files: 0 passed, 1 failed after 16 s. That left e2e-tests-local and e2e-status at FAILURE, so the rc.81 binary has not been exercised end to end. The objection that e2e-status propagates shard failures is consistent with this rather than a rebuttal. It is a runner fault plus inaccurate QA wording, not a code defect, so it is non-blocking: a rerun on a healthy runner, or rewording the Gaps line, resolves it.

@ovitrif

ovitrif commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

E2E coverage the Gaps section relies on has not run on this head

@coreyphillips Right, the Gaps line was wrong. I reworded it: E2E has not run on this head because of the runner fault, it reruns once the runner is fixed, and the merge waits for it.

@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 45ff9d4. Nothing blocking remains.

addressed

  • E2E coverage the Gaps section relies on has not run on this head. Fixed: The PR body's Gaps section now reads "CI's E2E jobs have not run on this head... They rerun once the runner is fixed, and the merge waits for them". I checked that claim: the master ruleset lists e2e-status as a required status check. Auto-merge is enabled and mergeStateStatus is BLOCKED while e2e-status is FAILURE on 45ff9d4, so the rc.81 binary cannot merge until an E2E rerun passes. "As on every iOS PR today" also holds: e2e runs 45190840591 and 45185181840 on other PRs fail with the same Simulator.app does not exist.

@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 3 new commits (caa0cb1, 2be17dd, 30e8acb). Nothing blocking remains.

@ovitrif

ovitrif commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Reran the failed E2E jobs: the 22:30 UTC run stopped at the merge-checkout check because master moved under it (#1371 merged). No code change.

github-actions Bot added a commit that referenced this pull request Nov 24, 2026
{"kind":"bitkit-retarget-execution-v1","repository":"synonymdev/bitkit-ios","pr":1394,"generation":"45353011056-1","sourceSha":"c52c5938ca2b846c9b9d2fec8152eb9c799f2020","sourceRef":"c52c5938ca2b846c9b9d2fec8152eb9c799f2020","owner":"github-actions[bot]"}
@ovitrif

ovitrif commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Merged master in as 0581a55. Its E2E could not run: GitHub's test merge for this PR stayed on the previous master, and the workflow only tests a merge with the current one. The merge is clean, with no code change.

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

Reviewed 0581a55.

LDKNode moves to 0.7.0-rc.81, pinned to the commit its tag points to. The only code change between rc.80 and rc.81 is ldk-node's runtime: when a stop leaves work running, a reaper thread keeps the runtime alive until that work ends and then shuts it down, instead of shutting it down under the work. No issues found.

Review details

General review
Model: Claude Opus 5.5
Reasoning effort: high

@ovitrif

ovitrif commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Approved at 0581a55 with nothing open; set to merge once the running E2E passes.

@ovitrif
ovitrif merged commit f710f91 into master Nov 24, 2026
20 checks passed
@ovitrif
ovitrif deleted the fix/ldk-node-rc81 branch November 24, 2026 10:13
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.

chore: take the ldk-node runtime shutdown fixes

5 participants