Skip to content

Fail closed on manager read errors - #1032

Merged
tnull merged 1 commit into
lightningdevkit:mainfrom
tnull:2026-08-fail-channel-manager-read
Aug 12, 2026
Merged

tnull merged 1 commit into
lightningdevkit:mainfrom
tnull:2026-08-fail-channel-manager-read

Conversation

@tnull

@tnull tnull commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Only a missing ChannelManager should create a fresh node. Propagate other storage errors so transient failures cannot replace live channel state with an empty manager.

Fixes #1026

Only a missing ChannelManager should create a fresh node. Propagate
other storage errors so transient failures cannot replace live channel
state with an empty manager.

Fixes lightningdevkit#1026

Co-Authored-By: HAL 9000
@tnull tnull added this to the 0.8 milestone Aug 7, 2026
@ldk-reviews-bot

ldk-reviews-bot commented Aug 7, 2026 •

Copy link
Copy Markdown

I've assigned @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Comment thread src/builder.rs
if let Ok(reader) = channel_manager_bytes_res {
let channel_manager_bytes = match channel_manager_bytes_res {
Ok(reader) => Some(reader),
Err(e) if e.kind() == lightning::io::ErrorKind::NotFound => None,

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.

Hmm, okay. I don't love reintroducing the assumption that the ErrorKind is "correct", but at worst we just refuse to start and the developer fixes their KVStore cause it should be obvious during development. Also I dunno how else to fix this so 🤷‍♂️

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, well, NotFound is at least part of the KVStore API contract.

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 we removed that when we fixed MonitorUpdatingPersister to no longer rely on it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No we removed that when we fixed MonitorUpdatingPersister to no longer rely on it.

Uh, but that's actually bad, as we do lean on it in LDK Node in several places. NotFound is always a special value for KVStores, irrespective of whether MonitorUpdatingPersister now returns it or not. We should re-add it then.

@tnull
tnull merged commit 5e4197b into lightningdevkit:main Aug 12, 2026
39 of 70 checks passed
joemphilips added a commit to joemphilips/cdk that referenced this pull request Nov 11, 2026
ldk-node 0.7.0 marks an in-flight outbound payment Failed when an
inbound HTLC uses the same payment hash. cdk-ldk-node reports that
status as a failed melt. A melt requester who holds the HTLC of their
own invoice and keysends the same hash to the mint could thus release
the melt proofs and then settle the HTLC.

ldk-node 0.7.1 fixes these bugs:
- an inbound HTLC that reuses an outbound payment hash no longer fails
  the outbound payment (lightningdevkit/ldk-node#1157);
- a late PaymentFailed no longer overwrites a succeeded payment
  (lightningdevkit/ldk-node#1065);
- a ChannelManager read error stops the build instead of starting a
  fresh node (lightningdevkit/ldk-node#1032).

lightning 0.2.8 (with lightning-liquidity, lightning-transaction-sync
and lightning-persister 0.2.8, and lightning-invoice 0.34.2) fixes:
- a malicious BOLT11 route hint that removes channels from the graph
  (lightningdevkit/rust-lightning#5503);
- an MPP startup panic after a channel monitor is archived (#5528);
- a ChannelManager that fails to load after several payments to one
  hash (#5541);
- anchor commitments held back when the fee-bump input cannot be
  funded (4825c089e);
- 64-byte transactions skipped in Esplora sync (#5559).

Only these six packages change in Cargo.lock and Cargo.lock.msrv.
cargo update also re-resolved unrelated multi-version range
dependencies, so those edges keep their earlier versions. The other
LDK crates are already at their latest compatible releases. The
workspace floors now require the fixed versions, so a regenerated lock
cannot select the vulnerable ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDmqYFNSovaSho9M89aXC9
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.

ChannelManager read errors start a fresh node

3 participants