-
Notifications
You must be signed in to change notification settings - Fork 390
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
Expand PaymentClaimable
to include all inbound channel IDs for a payment
#3655
base: main
Are you sure you want to change the base?
Conversation
I've assigned @valentinewallace as a reviewer! |
In the current version, I haven’t included let channel_ids = payment_claimed_event.htlcs.iter().map(|htlc| htlc.channel_id).collect(); That said, let me know if you’d still prefer to include |
Thanks, @shaavan , that is good enough |
👋 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. |
nit: limit commit subject line in 2nd commit to ~50 characters |
Updated from pr3655.01 to pr3655.02 (diff):
|
lightning/src/events/mod.rs
Outdated
// legacy field | ||
// (3, via_channel_id, option), | ||
(4, amount_msat, required), | ||
(5, via_user_channel_id, option), | ||
// legacy field | ||
// (5, via_user_channel_id, option), |
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.
I think we should still write these fields for the sake of users who downgrade (can always write the first item in the vec). Also would be nice to comment in what version the fields became legacy.
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.
Done! pr3655.03
I’ve updated the writing so that we maintain downgrade support.
Haven’t added a comment yet since I’m not sure what the next version number will be 😅 (would it be 0.1.3
?)
Updated from pr3655.02 to pr3655.03 (diff): Changes:
|
Looks good, feel free to squash! Thanks! |
These two utilities will be used in following commit to get all the inbound channel_ids, and user_channel_ids associated with all the parts of a payment.
Updated from pr3655.03 to pr3655.04 (diff): Changes:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3655 +/- ##
==========================================
+ Coverage 89.21% 91.10% +1.89%
==========================================
Files 155 156 +1
Lines 118966 135653 +16687
Branches 118966 135653 +16687
==========================================
+ Hits 106133 123593 +17460
+ Misses 10253 9605 -648
+ Partials 2580 2455 -125 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Looks good, feel free to squash! Thanks!
Awesome — thanks a lot for the review, Val! 🚀
Previously, `channel_id` in `PaymentClaimable` only listed a single inbound channel, which was misleading for MPP payments arriving via multiple channels. To better represent MPP scenarios, this update introduces: - `via_channel_ids`: A list of all inbound channels used in the payment. - `via_user_channel_ids`: The corresponding user-defined channel IDs for each inbound channel. This change ensures a more accurate representation of multi-path payments while maintaining backward compatibility.
Updated from pr3655.04 to pr3655.05 (diff): Changes:
|
/// This will be an empty vector for events created/serialised using LDK version 0.0.112 and prior. | ||
via_channel_ids: Vec<ChannelId>, | ||
/// The `user_channel_id`(s) corresponding to the channels over which the payment was received. | ||
/// This will be an empty vector for HTLC events created/serialised using LDK version 0.0.112 and prior. |
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.
Also note that the list will be incomplete in the case of an MPP payment for versions 0.1.* and below?
|
||
/// Returns the inbound `user_channel_id`s for all HTLCs associated with the payment. | ||
/// | ||
/// Note: This list will be incomplete for HTLCs created using LDK version 0.0.112 or earlier. |
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.
s/0.0.112/0.1 and also note it on the above method?
Resolves #2274
This PR expands
PaymentClaimable
to include all inboundchannel_ids
anduser_channel_ids
associated with a payment.This update ensures a clearer representation of the channels used, especially for MPP payments.