Skip to content
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

Include invoice requests in async payment onions #3207

Merged

Commits on Oct 24, 2024

  1. Configuration menu
    Copy the full SHA
    cdc0c3b View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. Add new PaymentFailureReason::BlindedPathCreationFailed

    RouteNotFound did not fit here because that error is reserved for failing to
    find a route for a payment, whereas here we are failing to create a blinded
    path back to ourselves..
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    3945bf8 View commit details
    Browse the repository at this point in the history
  2. Update docs for PaymentFailureReason::RouteNotFound

    Since we started using this error in send_payment_for_bolt12_invoice, this
    error type is no longer only used on retry but also on initial send.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    88d689a View commit details
    Browse the repository at this point in the history
  3. Prefix AsyncPaymentsMessageHandler methods with handle_*

    "Release" is overloaded in the trait's release_pending_messages method, since
    the latter releases pending async payments onion messages to the peer manager,
    vs the release_held_htlc method handles the release_held_htlc onion message by
    attempting to send an HTLC to the recipient.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    2ff6524 View commit details
    Browse the repository at this point in the history
  4. Stop taking &self in outbound_payments' create_inbound_payment

    The method doesn't actually use its &self parameter, and this makes it more
    obvious that we aren't going to deadlock by calling the method if the
    outbound_payments lock is already acquired.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    639446a View commit details
    Browse the repository at this point in the history
  5. Support encoding invreqs in outbound onion payloads

    Per BOLTs PR 1149, when paying a static invoice we need to include our original
    invoice request in the HTLC onion since the recipient wouldn't have received it
    previously.
    
    We use an experimental TLV type for this new onion payload field, since the
    spec is still not merged in the BOLTs.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    a80af56 View commit details
    Browse the repository at this point in the history
  6. Support including invreqs when building onion payloads

    Add a new invoice request parameter to onion_utils::build_onion_payloads.
    As of this commit it will always be passed in as None, to be updated in future
    commits.
    
    Per BOLTs PR 1149, when paying a static invoice we need to include our original
    invoice request in the HTLC onion since the recipient wouldn't have received it
    previously.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    9b3e307 View commit details
    Browse the repository at this point in the history
  7. Support including invreqs when building payment onions

    Add a new invoice request parameter to onion_utils::create_payment_onion. As of
    this commit it will always be passed in as None, to be updated in future
    commits.
    
    Per BOLTs PR 1149, when paying a static invoice we need to include our original
    invoice request in the HTLC onion since the recipient wouldn't have received it
    previously.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    6a42453 View commit details
    Browse the repository at this point in the history
  8. Support including invreqs when paying to a route

    Add a new invoice request parameter to outbound_payments and channelmanager
    send-to-route internal utils. As of this commit the invreq will always be
    passed in as None, to be updated in future commits.
    
    Per BOLTs PR 1149, when paying a static invoice we need to include our original
    invoice request in the HTLC onion since the recipient wouldn't have received it
    previously.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    fead88f View commit details
    Browse the repository at this point in the history
  9. Store invreqs in StaticInvoiceReceived outbound payments

    When transitioning outbound payments from AwaitingInvoice to
    StaticInvoiceReceived, include the invreq in the new state's outbound payment
    storage for future inclusion in an async payment onion.
    
    Per BOLTs PR 1149, when paying a static invoice we need to include our original
    invoice request in the HTLC onion since the recipient wouldn't have received it
    previously.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    520ae0b View commit details
    Browse the repository at this point in the history
  10. Include invreq in payment onion when sending async payments

    Past commits have set us up to include invoice requests in outbound async
    payment onions. Here we actually pull the invoice request from where it's
    stored in outbound_payments and pass it into the correct utility for inclusion
    in the onion on initial send.
    
    Per BOLTs PR 1149, when paying a static invoice we need to include our original
    invoice request in the HTLC onion since the recipient wouldn't have received it
    previously.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    925a0cb View commit details
    Browse the repository at this point in the history
  11. Include invreq in payment onion when retrying async payments

    While in the last commit we began including invoice requests in async payment
    onions on initial send, further work is needed to include them on retry. Here
    we begin storing invreqs in our retry data, and pass them along for inclusion
    in the onion on payment retry.
    
    Per BOLTs PR 1149, when paying a static invoice we need to include our original
    invoice request in the HTLC onion since the recipient wouldn't have received it
    previously.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    d574de9 View commit details
    Browse the repository at this point in the history
  12. Factor invoice requests into payment path length limiting

    Async payments include the original invoice request in the payment onion.
    Since invreqs may include blinded paths, it's important to factor them into our
    max path length calculations since they may take up a significant portion of
    the 1300-byte onion.
    valentinewallace committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    34e710e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    240dd0a View commit details
    Browse the repository at this point in the history