Make payment secret compulsory on new invoices, and assume unknown nodes support TLV onions#4646
Merged
niftynei merged 7 commits intoElementsProject:masterfrom Jul 14, 2021
Conversation
This makes it easier to access (rather than decoding bolt11). Changelog-Added: JSON-RPC: `invoice` now outputs explicit `payment_secret` it its own field. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
They're about to become compulsory. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
04a3948 to
0b885f8
Compare
cdecker
reviewed
Jul 12, 2021
plugins/keysend.c
Outdated
Comment on lines
+312
to
+317
| for (size_t i = 0; i < tal_count(ki->payload->fields); i++) { | ||
| plugin_log(cmd->plugin, LOG_DBG, | ||
| "field[%zu] = %zu:%s", | ||
| i, ki->payload->fields[i].numtype, | ||
| tal_hex(tmpctx, ki->payload->fields[i].value)); | ||
| } |
Member
There was a problem hiding this comment.
Better to add a line saying what we're printing here and indenting slightly, otherwise we have random values appearing in the logs without any context.
Contributor
Author
There was a problem hiding this comment.
Removed, thanks!
cdecker
approved these changes
Jul 12, 2021
It's about to become compulsory. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It's going to be compulsory soon! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
In fact, we make it compulsory, which means if you don't understand it you'll hang up on us! Add some logging for that in future. Changelog-Changed: Protocol: All new invoices require a payment_secret (i.e. modern TLV format onion) Changelog-Changed: Protocol: We can no longer connect to peers which don't support `payment_secret`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This grandfathers in old invoices for the moment. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is in preparation for removing support (next release?). Changelog-Changed: Protocol: We now assume nodes support TLV onions (non-legacy) unless we have a node_announcement which says they don't. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
0b885f8 to
0433cec
Compare
Collaborator
|
ACK 0433cec |
SomberNight
added a commit
to SomberNight/electrum
that referenced
this pull request
Jun 29, 2023
we now require payment_secret both for sending and for receiving (previously was optional for both) see lightning/bolts#898 ACINQ/eclair#1810 ElementsProject/lightning#4646 note: payment_secret depends on var_onion_optin, so that becomes mandatory as well, however this commit does not yet remove the ability of creating legacy onions
SomberNight
added a commit
to SomberNight/electrum
that referenced
this pull request
Jun 29, 2023
we now require payment_secret both for sending and for receiving (previously was optional for both) see lightning/bolts#898 ACINQ/eclair#1810 ElementsProject/lightning#4646 note: payment_secret depends on var_onion_optin, so that becomes mandatory as well, however this commit does not yet remove the ability of creating legacy onions
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.
Most of this work is removing our assumptions that payment_secret is unnecessary (i.e. making us use modern TLV onion for the terminal everywhere!).
We also switch our assumptions about nodes for which we don't have a node_announcement: we assume they do support TLV onions. With the next release, we might be able to remove legacy sending support altogether (and then finally, legacy receive/forward).