-
Notifications
You must be signed in to change notification settings - Fork 407
Calculate InFlightHtlcs
based on information in ChannelManager
#1830
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
Calculate InFlightHtlcs
based on information in ChannelManager
#1830
Conversation
we probably need to rework the testing strategy for |
Concept ACK with caveats discussed offline about testing and payment cache. |
d5c8465
to
30d7805
Compare
@@ -1729,66 +1589,6 @@ mod tests { | |||
}); | |||
} | |||
|
|||
#[test] |
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.
we no longer populate inflight path information based on events, so there is probably no need to have tests for this any longer.
30d7805
to
2806be6
Compare
rebased to resolve conflict in |
Codecov ReportBase: 90.61% // Head: 90.97% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1830 +/- ##
==========================================
+ Coverage 90.61% 90.97% +0.36%
==========================================
Files 90 91 +1
Lines 47623 50202 +2579
Branches 47623 50202 +2579
==========================================
+ Hits 43152 45670 +2518
- Misses 4471 4532 +61
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Looking good!
thanks for the review @valentinewallace! I'll make the changes. additional note: I'm going to be writing an additional tests to make sure HTLCs in holding cells are calculated when producing |
853282a
to
673d36f
Compare
Resolved review comments, added a functional test in 673d36f to check if holding cells HTLCs show up in |
lightning/src/ln/channelmanager.rs
Outdated
/// Gets inflight HTLC information by processing pending outbound `HTLCSource`s that are in | ||
/// our channels. |
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 document the usage, because IIRC this isn't intended to be used for users to view their in-flight payments, just for routing purposes? Lmk if I'm off there
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.
Yeah, that's correct. We'll work on an API for viewing pending payments in a follow-up PR, since we think it may need a different solution.
I'll add a little bit more context here to make its intended use more explicit.
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.
@valentinewallace I added a comment to specify that we use this information for pathfinding, but let me know if it can be better :)
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.
LGTM, otherwise.
673d36f
to
2c8fdd3
Compare
2c8fdd3
to
8449c71
Compare
Needs rebase as well, sorry! |
8449c71
to
7d6b109
Compare
@valentinewallace thanks for pointing that out -- rebased! |
7d6b109
to
b51db04
Compare
b51db04
to
3e8926d
Compare
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.
LGTM, feel free to take or leave nits
3e8926d
to
fd4792a
Compare
@valentinewallace nits very much appreciated :) thanks! |
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.
Will let @jkczyz review + merge.
In c70bd1f, we implemented tracking HTLCs by adding path information for pending HTLCs to `InvoicePayer`’s `payment_cache` when receiving specific events. Since we can now track inflight HTLCs entirely within ChannelManager, there is no longer a need for this to exist.
3136d73
fd4792a
to
3136d73
Compare
Follow-up of #1643 (comment).
Currently, we populate path information about payments we attempt to send/retry in
InvoicePayer
'spayment_cache
. It allows us to compute anInFlightHtlcs
struct that we pass to the router so that its values can be considered when routing.This PR introduces an improvement since
ChannelManager
actually knows about changing liquidity information since it produces the payment events thatInvoicePayer
relies on to populate path information inpayment_cache