Track in-flight HTLCs across payments when routing (InvoicePayer)
https://github.com/lightningdevkit/rust-lightning/pull/1643
Host: dunxen -
The PR branch HEAD was d03d6a8 at the time of this review club meeting.
Notes
- LDK currently does not track in-flight HTLCs across outstanding payments when it comes to routing. This can be problematic in cases such as retrying payments where some parts failed: We won’t consider the in-flight HTLC to occupy available liquidity across a path and we’d end up reusing such a path on retry even if it does not have enough liquidity for both HTLCs, which is clearly not helpful.
InvoicePayer
(aliased toInvoicePayerUsingTime
) is a utility for paying invoices and sending spontaneous payments which can retry failed payment paths. It wraps aRouter
, aPayer
(whichChannelManager
implements), and other things needed for making payments.- This PR introduces the ability to track in-flight HTLCs accross outstanding payments when routing to solve issues such as the one descirbed above.
Questions
- Did you review the (draft) PR? Concept ACK/nACK?
- This is the first time we’re digging deeper into LDK’s payment logic and the
lightning-invoice
crate, so firstly, what is the point of thelightning-invoice
crate and what functionality does it provide? - In the
payment
module, what is the purpose of theInvoicePayer
struct and how arePayer
andRouter
involved when making payments. - How and where does this PR propose tracking the amounts for currently in-flight HTLCs? How are these amounts considered when making payments?
- On what conditions/events will we stop tracking the amounts for these HTLCs. What does “stop tracking” mean here?
- TODO: Something around discussion about restarts.