Skip to content

Catch channel data deserialisation failures#774

Closed
dpad85 wants to merge 2 commits intomasterfrom
catch-channel-data-error
Closed

Catch channel data deserialisation failures#774
dpad85 wants to merge 2 commits intomasterfrom
catch-channel-data-error

Conversation

@dpad85
Copy link
Member

@dpad85 dpad85 commented Nov 4, 2025

Local channel data may not be readable, e.g. if the serialisation support for the format used has been dropped in lightning-kmp. This will crash the app. We should instead ignore local channels data when that happens (falling back to the peer backup), and log the error.

Channel data may not be readable, e.g. if the serialization support has been
dropped in lightning-kmp. If so, we ignore the local data and log the error.
@dpad85 dpad85 requested a review from pm47 November 4, 2025 13:45
CREATE TABLE local_channels (
channel_id BLOB AS ByteVector32 NOT NULL PRIMARY KEY,
data BLOB AS PersistedChannelState NOT NULL,
data BLOB NOT NULL,
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't immediately assume the data can be decoded anymore, so that we can catch and log decoding errors.


listLocalChannels:
SELECT data FROM local_channels WHERE is_closed=0;
SELECT channel_id, data FROM local_channels WHERE is_closed=0;
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding the channel_id here allows us to reuse in listLocalChannels the mapChannelData already used by getChannel. Also, lets us log the id of the faulty channel.

@dpad85
Copy link
Member Author

dpad85 commented Nov 4, 2025

Superseded by #775.

@dpad85 dpad85 closed this Nov 4, 2025
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.

2 participants