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

Introduce Retry InvoiceRequest Flow #3010

Merged
merged 4 commits into from
Sep 12, 2024

Commits on Sep 12, 2024

  1. Introduce RetryableInvoiceRequest in AwaitingInvoice

    1. To enable the retry of the Invoice Request message, it's necessary
       to store the essential data required to recreate the message.
    2. A new struct is introduced to manage this data, ensuring the
       InvoiceRequest message can be reliably recreated for retries.
    3. The addition of an `awaiting_invoice` flag allows tracking of
       retryable invoice requests, preventing the need to lock the
       `pending_outbound_payment` mutex.
    shaavan committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    17d80f9 View commit details
    Browse the repository at this point in the history
  2. Introduce enqueue_invoice_request Function

    1. Separate the logic of forming `invoice_request` messages from
       `invoice_request` and `reply_paths` and enqueueing them into a
       separate function.
    2. This logic will be reused in the following commit when reforming
       `invoice_request` messages for retrying.
    shaavan committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    1881f35 View commit details
    Browse the repository at this point in the history
  3. Introduce message_received in ChannelMessageHandler

    - Introduce the `message_received` function to manage the
      behavior when a message is received from any peer.
    - This function is used within `ChannelManager` to retry `InvoiceRequest`
      messages if we haven't received the corresponding invoice yet.
    - This change makes the offer communication robust against sudden
      connection drops where the initial attempt to send the message
      might have failed.
    shaavan committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    5cccee5 View commit details
    Browse the repository at this point in the history
  4. Introduce handle_message_received test

    - Add a test to verify the functionality of the handle_message_received
      function.
    - Ensure the test covers scenarios where InvoiceRequest messages are retried
      for PendingOutboundPayments after a simulated connection loss.
    shaavan committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    b1cd887 View commit details
    Browse the repository at this point in the history