Repository navigation
Conversation
…2 KB Follow-up to lightningnetwork#9. The invoice stored as a payment's request was the caller's string after TrimSpace only; bolt12.Decode accepts '+' continuations and unknown odd TLVs, so an invoice padded by its issuer could run to megabytes and every listpayments page holding it would carry them. It is now re-encoded from its bytes (the same signed TLVs, so still the issuer's signature over what was paid) and not kept at all above MaxStoredInvoice (32 KB; BOLT 11 tops out near 7 KB).
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.
Follow-up to #9, from your review there.
The invoice kept as the payment's request is now re-encoded from its decoded bytes (no
+continuations or whitespace; the same TLVs, so the issuer's signature still covers it), and it isn't stored at all aboveMaxStoredInvoice(32 KB, against ~7 KB for BOLT 11). That keepslistpaymentspages bounded when an issuer pads its invoice.Applied on both paths (fetched from an offer and passed as
invoice). Test:TestStoredInvoiceinlnrpc/offersrpc(-tags offersrpc).