-
Notifications
You must be signed in to change notification settings - Fork 402
[RFC] move the bolt12 invoice inside HTLCSource::OutboundRoute #3719
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
base: main
Are you sure you want to change the base?
[RFC] move the bolt12 invoice inside HTLCSource::OutboundRoute #3719
Conversation
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
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.
Yea, this all makes sense I think. Sorry to make you undo some of the previous patch.
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
637983d
to
5c25caf
Compare
Thanks Matt! I rebased on the main to fix the commit checks and addressed some of the review comments. We should be good for another round |
✅ Added second reviewer: @wpaulino |
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.
Conceptually looks good, but there's still quite a few FIXMEs left, do you want to address those?
lightning/src/ln/channelmanager.rs
Outdated
@@ -705,7 +707,8 @@ impl core::hash::Hash for HTLCSource { | |||
0u8.hash(hasher); | |||
prev_hop_data.hash(hasher); | |||
}, | |||
HTLCSource::OutboundRoute { path, session_priv, payment_id, first_hop_htlc_msat } => { | |||
// FIXME(vincenzopalazzo): we can ignore the bolt12_invoice here? |
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.
Shouldn't, no.
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.
The basic idea here is that with or without bolt12 the the struct hash should be unique anyway? due we will pay the invoice one time.
However, if we want to add also the bolt12, I think I need to make the bolt12 invoice hashable, which requires some derive macros along the 'hierarchy' of the struct
🔔 1st Reminder Hey @wpaulino! This PR has been waiting for your review. |
Jumping in finishing this tomorrow, sorry for the delay! |
Matt noted during the last round of review the following: >Oof. Sorry I missed this until now. This is not, in fact, "only used for retries", we use it on claims only, in fact. If a user is relying on the event field for PoP, what this can mean is that we can initiate a send, restart with a stale ChannelManager, notice the payment is pending, then when it claims fail to provide the invoice (only the preimage) to the payer. >In practice, to fix this, we'll need to include the PaidBolt12Invoice in the HTLCSource::OutboundRoute, I believe. This commit is trying to store the PaidBolt12Invoice inside the HTLCSource::OutboundRoute, but this is not enough because we have to store the invoice also inside the PendingOutboundPayment. Link: lightningdevkit#3714 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
94cadd5
to
19ba769
Compare
19ba769
to
6af45f9
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3719 +/- ##
==========================================
- Coverage 89.15% 89.10% -0.06%
==========================================
Files 156 157 +1
Lines 123837 123868 +31
Branches 123837 123868 +31
==========================================
- Hits 110408 110373 -35
- Misses 10754 10806 +52
- Partials 2675 2689 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
6af45f9
to
b7ea0de
Compare
Matt noted during the last round of review the following:
This commit is trying to store the PaidBolt12Invoice inside the HTLCSource::OutboundRoute, but this is not enough because we have to store the invoice also inside the PendingOutboundPayment.
Fixes: #3714