-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Part 4: offers for non-public nodes, and handling self-pay #7461
Merged
rustyrussell
merged 12 commits into
ElementsProject:master
from
rustyrussell:part4-corner-cases
Jul 18, 2024
Merged
Part 4: offers for non-public nodes, and handling self-pay #7461
rustyrussell
merged 12 commits into
ElementsProject:master
from
rustyrussell:part4-corner-cases
Jul 18, 2024
Conversation
This file contains 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
rustyrussell
force-pushed
the
part4-corner-cases
branch
2 times, most recently
from
July 17, 2024 07:16
bb98944
to
7b4f400
Compare
On my local machine it can run into ratelimiting, because I miscounted the fetchinvoice calls. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
For bolt12, we have blinded paths so we route to the head of the blinded path, which may not be the same as the final payment destination. This matters mainly for detecting self-pay. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Don't refuse, this will happen if we are the head of the blinded path, for example. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
I'm not sure about interface yet, so don't document. It's ugly. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Ideally, we would be able to submit a payment exactly as an incoming HTLC would, but our forwarding and decoding logic is currently very much tied to the HTLC. It would be wonderful to detach that and have an "injectonion" interface which was unwrapped like any other (see "injectonionmessage") which would handle self-pay without any special paths. Since I'm not prepared to rewrite that all now, instead we use an interface to decrypt the first hop if it's us, and use the remainder of the blinded path. Changelog-Fixed: plugins: pay can now pay a bolt12 invoice even if we, ourselves, are the head of the blinded path within it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We use this for invoices published by unannounced nodes: want something very similar for offers, so generalize and expose it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This also lets us test offers and invoices work if we are the start of the blinded path. Changelog-Added: offers: automatically add a blinded path from a peer if we have no public channels, so unannounced nodes can have offers too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…ting invoice. Changelog-Added: offers: we can now self-fetch and self-pay BOLT12 offers and invoices. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We will want to use it in the pay plugin too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: pay can now pay to bolt12 invoices if entry to blinded hop is specified as a short_channel_id (rather than node id). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…cid. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It was only ever expermental, so I don't feel bad about just removing it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Removed: JSON-RPC: `sendonionmessage` (was experimental only, use `injectonionmessage`)
rustyrussell
force-pushed
the
part4-corner-cases
branch
from
July 17, 2024 10:51
7b4f400
to
13adccf
Compare
endothermicdev
approved these changes
Jul 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, I didn't realize sendonionmessage was being ripped out at the end of this. Blinded path handling and self-pay look solid.
ACK 13adccf
Merged
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.
Builds on #7456(Merged!)This handles the corner cases of self-pay, and invoice blinded paths which start from us (this latter is pretty icky, as we need to unwrap one layer which requires our private key, hence a new internal RPC). It also removes the now-unneeded sendonionmessage.