Fix payment onion payload decode #1659
Merged
valentinewallace merged 3 commits intolightningdevkit:mainfrom Aug 15, 2022
Merged
Fix payment onion payload decode #1659valentinewallace merged 3 commits intolightningdevkit:mainfrom
valentinewallace merged 3 commits intolightningdevkit:mainfrom
Conversation
e9c1787 to
15074bd
Compare
TheBlueMatt
previously approved these changes
Aug 9, 2022
Collaborator
|
(New) CI failures are due to rust-lang/libc#2866 |
dunxen
previously approved these changes
Aug 15, 2022
Contributor
|
LGTM! Out of curiosity: should this |
tnull
reviewed
Aug 15, 2022
Contributor
Author
Yup, exactly! That fix was needed for #1652 (and covered by the tests added) so I stuck it in there. |
Prior to this change, we could have failed to decode a valid payload of size >253. This is because we were decoding the length (a BigSize, big-endian) as a VarInt (little-endian). Found in lightningdevkit#1652.
As observed by @wpaulino, this struct encodes its bytes as big-endian, therefore it's a BigSize, not a VarInt.
dfbebbf
15074bd to
dfbebbf
Compare
dunxen
approved these changes
Aug 15, 2022
TheBlueMatt
approved these changes
Aug 15, 2022
Contributor
Ah, thought so! |
tnull
approved these changes
Aug 15, 2022
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.
Prior to this change, we could have failed to decode a valid payload of size >253. This is because we were decoding the length (a BigSize, big-endian) as a VarInt (little-endian).
Plus some minor cleanups. Pair-debugged with @wpaulino.