Add a new peer storage format to handle legacy backups#807
Merged
Conversation
pm47
commented
Sep 16, 2025
Comment on lines
+130
to
+132
| runCatching { decrypt(key.value, data.drop(2).toByteArray()) } | ||
| .recoverCatching { decrypt(key.value, data) } | ||
| .map { Serialization.deserialize(it) } |
Member
Author
There was a problem hiding this comment.
This is the same contant as the fun PersistedChannelState.Companion.from() function above, but that function will be deleted once the migration is done, so factoring wasn't worth it.
pm47
added a commit
that referenced
this pull request
Sep 24, 2025
This is a follow-up to #807. Note that we cannot remove some legacy classes such as `EncryptedChannelData`, due to the legacy v2/v3 serialization depending on it.
pm47
added a commit
that referenced
this pull request
Sep 26, 2025
This is a follow-up to #807. Note that we cannot remove some legacy classes such as `EncryptedChannelData`, due to the legacy v2/v3 serialization depending on it.
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.
Our current peer storage data format is
encrypt(list(channel)).We add a new format:
list(encrypt(channel)).This allows handling of legacy proprietary per-channel backups: on the LSP side, we just need to concatenate legacy backups and set that as the peer storage, and then reject channel updates with the legacy backup method (we actually just reject connections from peers that do not support the peer storage backup).
Note that we do not yet remove the "restore from
channel_reestablish" logic, so that we don't have to synchronize the phoenix update with the LSP update.