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 RouteParametersConfig #3342

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Commits on Oct 22, 2024

  1. Introduce RouteParametersConfig

    With the current architecture, `pay_for_offer` only allows setting
    `max_total_routing_fee_msat` as a route parameter. However, it doesn't
    provide users the flexibility to set other important parameters.
    
    This commit introduces a new struct, `RouteParametersConfig`,
    that optionally allows users to set additional routing parameters.
    In later commits, this struct will be utilized when paying BOLT12 invoices.
    shaavan committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    69c3499 View commit details
    Browse the repository at this point in the history
  2. Update AwaitingInvoice to include RouteParametersConfig

    When `pay_for_offer` is called, it creates a new `PendingOutboundPayment`
    entry with relevant values that will be used when the corresponding invoice
    is received. This update modifies `AwaitingInvoice` to include the entire
    `RouteParametersConfig` struct instead of just `max_total_routing_fee_msat`.
    
    This change ensures all manual routing parameters are available when finding
    payment routes.
    
    Decisions & Reasoning:
    1. **Retention of `max_total_routing_fee_msat` in `AwaitingInvoice` &
       `InvoiceReceived`**
    
       This field is retained to ensure downgrade support.
    
    2. **Introduction of `route_params_config` in `InvoiceReceived`:**
    
       This was added for the same reason that `max_total_routing_fee_msat` was originally
       introduced in PR lightningdevkit#2417. The documentation has been updated to reflect this, based
       on [this comment](lightningdevkit@d7e2ff6#r1334619765).
    shaavan committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    583d686 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    db71b52 View commit details
    Browse the repository at this point in the history
  4. Extend pay_for_offer to accept RouteParametersOverride

    This update allows users to call `pay_for_offer` with a set of parameters
    they wish to manually set for routing the corresponding invoice. By
    accepting `RouteParametersOverride`, users gain greater control over the
    routing process.
    shaavan committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    6ccb7b6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2e60588 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a5cd262 View commit details
    Browse the repository at this point in the history
  7. f: fix comment

    shaavan committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    4221929 View commit details
    Browse the repository at this point in the history