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

Fail closed on manager read errors#1032
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
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