Skip to content

Support paying static invoices #3140

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

Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
732ee14
Tweak debug_assert message for parsed onion messages.
valentinewallace Jul 12, 2024
a3216ac
Add MessageContext for async payments.
valentinewallace Jul 10, 2024
e162278
Pass context into held_htlc_available message handling.
valentinewallace Jul 10, 2024
3d5d64a
Store AsyncPaymentsMessages for later sending
valentinewallace Jun 13, 2024
cff6e34
Support checking that a static invoice matches an outbound invreq.
valentinewallace Jun 13, 2024
ad63a70
Support creating PaymentParameters from static invoices.
valentinewallace Jun 13, 2024
c3ed4a2
Store async payment data in PendingOutboundPayment.
valentinewallace Jul 10, 2024
7fb16ea
Pass full message context into ChanMan blinded path util.
valentinewallace Jul 10, 2024
c976e4c
Release pending async payments to PeerManager.
valentinewallace Aug 29, 2024
b6f4479
Support initiating an async payment to a static invoice.
valentinewallace Aug 29, 2024
28269a7
DRY handling when initiating payment to BOLT 12 invoice.
valentinewallace Aug 29, 2024
e4d7681
Error on static invoice with unknown required features.
valentinewallace Aug 29, 2024
8569830
Set max path len on receipt of static invoice.
valentinewallace Aug 29, 2024
69356e7
Split off send_payment_for_bolt12_invoice_internal util.
valentinewallace Sep 4, 2024
0297a1e
Support sending async payments as an always-online sender.
valentinewallace Sep 4, 2024
985e6ac
Timeout expired outbound async payments.
valentinewallace Jun 20, 2024
6d415b1
Support abandoning pending outbound async payments.
valentinewallace Jun 20, 2024
7dd1787
Correct docs on payment id in RecentPaymentDetails.
valentinewallace Aug 20, 2024
c4f3e25
Don't trigger manager persistence on unexpected release_htlc message.
valentinewallace Aug 29, 2024
5a7f523
Rename Payment{Hash,Id} hmac creation/verification methods for offers.
valentinewallace Sep 5, 2024
615eefb
Verify inbound ReleaseHeldHtlc messages via hmac.
valentinewallace Sep 5, 2024
26d1582
Add new Bolt12PaymentError for failed blinded path creation.
valentinewallace Sep 6, 2024
4bcf53e
Document PendingOutboundPayment::{Static}InvoiceReceived semantics.
valentinewallace Sep 10, 2024
6e27aec
Remove payment_release_secret from async payments messages.
valentinewallace Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Document PendingOutboundPayment::{Static}InvoiceReceived semantics.
While these variants may sound similar, they are very different. One is so
temporary it's never even persisted to disk, the other is a state we will stay
in for hours or days. See added docs for more info.
  • Loading branch information
valentinewallace committed Sep 13, 2024
commit 4bcf53e597543ece3684cd49ce1afa4331ce59ff
7 changes: 7 additions & 0 deletions lightning/src/ln/outbound_payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ pub(crate) enum PendingOutboundPayment {
max_total_routing_fee_msat: Option<u64>,
retryable_invoice_request: Option<RetryableInvoiceRequest>
},
// This state will never be persisted to disk because we transition from `AwaitingInvoice` to
// `Retryable` atomically within the `ChannelManager::total_consistency_lock`. Useful to avoid
// holding the `OutboundPayments::pending_outbound_payments` lock during pathfinding.
InvoiceReceived {
payment_hash: PaymentHash,
retry_strategy: Retry,
// Note this field is currently just replicated from AwaitingInvoice but not actually
// used anywhere.
max_total_routing_fee_msat: Option<u64>,
},
// This state applies when we are paying an often-offline recipient and another node on the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these comments not being added in the same commit that adds StaticInvoiceReceived? Also, presumably they should be doc comments (for those who look at internal docs, or use an IDE...though it doesn't matter to me).

// network served us a static invoice on the recipient's behalf in response to our invoice
// request. As a result, once a payment gets in this state it will remain here until the recipient
// comes back online, which may take hours or even days.
StaticInvoiceReceived {
payment_hash: PaymentHash,
keysend_preimage: PaymentPreimage,
Expand Down