-
Notifications
You must be signed in to change notification settings - Fork 359
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
Include invoice requests in async payment onions #3207
Open
valentinewallace
wants to merge
13
commits into
lightningdevkit:main
Choose a base branch
from
valentinewallace:2024-07-invreq-in-onion
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Include invoice requests in async payment onions #3207
valentinewallace
wants to merge
13
commits into
lightningdevkit:main
from
valentinewallace:2024-07-invreq-in-onion
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3207 +/- ##
==========================================
- Coverage 89.64% 89.62% -0.02%
==========================================
Files 126 126
Lines 102676 102705 +29
Branches 102676 102705 +29
==========================================
+ Hits 92043 92053 +10
- Misses 7909 7926 +17
- Partials 2724 2726 +2 ☔ View full report in Codecov by Sentry. |
valentinewallace
force-pushed
the
2024-07-invreq-in-onion
branch
from
July 31, 2024 17:53
dca3ac9
to
f02d149
Compare
valentinewallace
force-pushed
the
2024-07-invreq-in-onion
branch
from
August 20, 2024 20:29
f02d149
to
6c56443
Compare
valentinewallace
force-pushed
the
2024-07-invreq-in-onion
branch
2 times, most recently
from
September 3, 2024 21:28
c202e04
to
e3ae4c1
Compare
valentinewallace
force-pushed
the
2024-07-invreq-in-onion
branch
from
September 12, 2024 16:25
e3ae4c1
to
4d0da54
Compare
Needs rebase. |
valentinewallace
force-pushed
the
2024-07-invreq-in-onion
branch
from
September 18, 2024 14:38
4d0da54
to
1350979
Compare
We already log the error in ChannelManager::handle_message.
RouteNotFound did not fit here because that error is reserved for failing to find a route for a payment, whereas here we are failing to create a blinded path back to ourselves..
Since we started using this error in send_payment_for_bolt12_invoice, this error type is no longer only used on retry but also on initial send.
"Release" is overloaded in the trait's release_pending_messages method, since the latter releases pending async payments onion messages to the peer manager, vs the release_held_htlc method handles the release_held_htlc onion message by attempting to send an HTLC to the recipient.
Per <lightning/bolts#1149>, when paying a static invoice we need to include our original invoice request in the HTLC onion since the recipient wouldn't have received it previously. We use an experimental TLV type for this new onion payload field, since the spec is still not merged in the BOLTs.
Add a new invoice request parameter to onion_utils::build_onion_payloads. As of this commit it will always be passed in as None, to be updated in future commits. Per <lightning/bolts#1149>, when paying a static invoice we need to include our original invoice request in the HTLC onion since the recipient wouldn't have received it previously.
Add a new invoice request parameter to onion_utils::create_payment_onion. As of this commit it will always be passed in as None, to be updated in future commits. Per <lightning/bolts#1149>, when paying a static invoice we need to include our original invoice request in the HTLC onion since the recipient wouldn't have received it previously.
Add a new invoice request parameter to outbound_payments and channelmanager send-to-route internal utils. As of this commit the invreq will always be passed in as None, to be updated in future commits. Per <lightning/bolts#1149>, when paying a static invoice we need to include our original invoice request in the HTLC onion since the recipient wouldn't have received it previously.
When transitioning outbound payments from AwaitingInvoice to StaticInvoiceReceived, include the invreq in the new state's outbound payment storage for future inclusion in an async payment onion. Per <lightning/bolts#1149>, when paying a static invoice we need to include our original invoice request in the HTLC onion since the recipient wouldn't have received it previously.
Past commits have set us up to include invoice requests in outbound async payment onions. Here we actually pull the invoice request from where it's stored in outbound_payments and pass it into the correct utility for inclusion in the onion on initial send. Per <lightning/bolts#1149>, when paying a static invoice we need to include our original invoice request in the HTLC onion since the recipient wouldn't have received it previously.
While in the last commit we began including invoice requests in async payment onions on initial send, further work is needed to include them on retry. Here we begin storing invreqs in our retry data, and pass them along for inclusion in the onion on payment retry. Per <lightning/bolts#1149>, when paying a static invoice we need to include our original invoice request in the HTLC onion since the recipient wouldn't have received it previously.
Async payments include the original invoice request in the payment onion. Since invreqs may include blinded paths, it's important to factor them into our max path length calculations since they may take up a significant portion of the 1300-byte onion.
valentinewallace
force-pushed
the
2024-07-invreq-in-onion
branch
from
September 18, 2024 15:33
1350979
to
b5ccb98
Compare
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.
Title. Implements the sending-side of the final commit of lightning/bolts#1149.
Based on #3140.