Catch exceptions during peer storage deserialization#843
Merged
Conversation
sstone
requested changes
Dec 30, 2025
Member
sstone
left a comment
There was a problem hiding this comment.
There should be a simple test that highlights what was missed.
In some cases, the peer storage we receive could be empty or truncated. We want to be safe and correctly catch every exception possible when deserializing, because we don't want the app to crash and the user to be stuck.
7f1b39e to
19a48f8
Compare
Member
Author
|
It's actually really hard to properly cover in unit tests (fuzzing would be great here) and there were very few existing tests, but I added two cases (empty backup and corrupted backup) in the last push, which fail without the fix. |
sstone
approved these changes
Dec 30, 2025
sstone
added a commit
to ACINQ/phoenix
that referenced
this pull request
Dec 31, 2025
Includes: - a fix for uncaught deserialization errors (see ACINQ/lightning-kmp#843) - a update to bitcoin-kmp with a change to taproot tweaks (see ACINQ/bitcoin-kmp#170)
dpad85
pushed a commit
to ACINQ/phoenix
that referenced
this pull request
Jan 5, 2026
Includes: - a fix for uncaught deserialization errors (see ACINQ/lightning-kmp#843) - a update to bitcoin-kmp with a change to taproot tweaks (see ACINQ/bitcoin-kmp#170)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some cases, the peer storage we receive could be empty or truncated. We want to be safe and correctly catch every exception possible when deserializing, because we don't want the app to crash and the user to be stuck.