Skip to content

Add config option to set maximum total routing fee #2417

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 8 commits into from
Sep 26, 2023

Conversation

tnull
Copy link
Contributor

@tnull tnull commented Jul 14, 2023

Fixes #2339.
Closes #2596.
Based on #2555.

Currently, users have no means to upper-bound the total fees accruing when finding a route. Here, we add a corresponding field to PaymentParameters which is used to limit the candidate set during path finding.

To this end, we exclude any candidate hops if we find that using them would let the aggregated path routing fees exceed max_total_routeing_fee_msat. Moreover, we return an error if the aggregated fees over all paths of the selected route would surpass max_total_routeing_fee_msat.

@tnull tnull marked this pull request as draft July 14, 2023 15:08
@tnull
Copy link
Contributor Author

tnull commented Jul 14, 2023

Drafting for now as I'm not super happy that we only filter on a per-path basis and then fail entirely if the aggregate route surpasses the routing fee limit. So far experimented with the approach we took for the minimal_value_contribution, i.e., having static per-path quotas, but discarded this as it would for example limit the per-path total fee to max_total_routing_fee_msat/max_path_count, i.e., to only 10% of the given value by default.

I think it's not super bad currently as we already pre-sort and filter routes by their cost/value ratio, which however also includes the penalty. Considering whether it would make sense to, whenever max_total_routing_fee_msat is set, add yet another pre-filtering step that only takes total fees into account to decrease the chances of unnecessarily returning an empty route.

This also currently doesn't account for retries. We might need to track the 'used' fees in a structure similar to InFlightHtlcs.

@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2023

Codecov Report

Attention: 19 lines in your changes are missing coverage. Please review.

Comparison is base (7e7e7a0) 88.83% compared to head (77afeac) 89.68%.
Report is 35 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2417      +/-   ##
==========================================
+ Coverage   88.83%   89.68%   +0.85%     
==========================================
  Files         113      113              
  Lines       84489    89980    +5491     
  Branches    84489    89980    +5491     
==========================================
+ Hits        75052    80696    +5644     
+ Misses       7205     7055     -150     
+ Partials     2232     2229       -3     
Files Coverage Δ
lightning/src/ln/blinded_payment_tests.rs 100.00% <100.00%> (ø)
lightning/src/ln/functional_test_utils.rs 93.62% <ø> (+2.45%) ⬆️
lightning/src/ln/channelmanager.rs 87.68% <50.00%> (+6.55%) ⬆️
lightning-invoice/src/payment.rs 77.30% <33.33%> (-0.26%) ⬇️
lightning/src/ln/payment_tests.rs 98.06% <98.60%> (+0.01%) ⬆️
lightning/src/ln/outbound_payment.rs 90.03% <92.94%> (+1.23%) ⬆️
lightning/src/routing/router.rs 93.73% <93.22%> (+0.10%) ⬆️

... and 17 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

This is fine, I think. I agree we should clean it up later to more aggressively find paths even though our first choice was fee-limited out, but this is certainly better than not having fee limiting.

Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

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

Looks good to me as a first step, given where we're at with the release!

Copy link
Contributor

@alecchendev alecchendev left a comment

Choose a reason for hiding this comment

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

Nice

@tnull tnull force-pushed the 2023-07-max-total-fee branch 3 times, most recently from ed0ade8 to da559d3 Compare July 18, 2023 12:28
@tnull tnull marked this pull request as ready for review July 18, 2023 12:42
@tnull tnull force-pushed the 2023-07-max-total-fee branch 3 times, most recently from c34a4a9 to be27e7f Compare July 18, 2023 14:07
@tnull tnull force-pushed the 2023-07-max-total-fee branch from eaa9435 to 63ed69b Compare July 18, 2023 14:36
@tnull tnull force-pushed the 2023-07-max-total-fee branch from 63ed69b to 804abe6 Compare July 18, 2023 17:20
@valentinewallace
Copy link
Contributor

LGTM after squash

@tnull tnull force-pushed the 2023-07-max-total-fee branch from 804abe6 to 97f07fb Compare July 18, 2023 20:41
@tnull
Copy link
Contributor Author

tnull commented Jul 18, 2023

LGTM after squash

Squashed fixups without further changes.

@tnull tnull force-pushed the 2023-07-max-total-fee branch from 97f07fb to 90ef352 Compare July 20, 2023 13:46
@tnull
Copy link
Contributor Author

tnull commented Jul 20, 2023

Rebased on main to get rid of the CI failure.

@tnull tnull removed this from the 0.0.116 milestone Jul 21, 2023
TheBlueMatt added a commit that referenced this pull request Sep 28, 2023
slanesuke pushed a commit to slanesuke/rust-lightning that referenced this pull request Oct 6, 2023
slanesuke pushed a commit to slanesuke/rust-lightning that referenced this pull request Oct 6, 2023
optout21 pushed a commit to optout21/rust-lightning that referenced this pull request Nov 4, 2023
optout21 pushed a commit to optout21/rust-lightning that referenced this pull request Nov 4, 2023
benthecarman added a commit to benthecarman/rust-lightning that referenced this pull request Nov 8, 2023
In lightningdevkit#2417 support for setting a max fee was added but it is not exposed
when using the `pay_invoice` utility functions. This makes it so the
user can pass in that parameter. One downside is that this removes the
defualt value form before.
shaavan added a commit to shaavan/rust-lightning that referenced this pull request Oct 13, 2024
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
`ManualRoutingParameters` 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`:**

   This field is retained to ensure downgrade support. However, it is removed from
   `InvoiceReceived` since it was never used, thereby helping to clean up the code
   while still supporting downgrading.

2. **Introduction of `route_params_override` 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 added a commit to shaavan/rust-lightning that referenced this pull request Oct 13, 2024
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
`ManualRoutingParameters` 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`:**

   This field is retained to ensure downgrade support. However, it is removed from
   `InvoiceReceived` since it was never used, thereby helping to clean up the code
   while still supporting downgrading.

2. **Introduction of `route_params_override` 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 added a commit to shaavan/rust-lightning that referenced this pull request Oct 15, 2024
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 `UserParameters` 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`:**

   This field is retained to ensure downgrade support. However, it is removed from
   `InvoiceReceived` since it was never used, thereby helping to clean up the code
   while still supporting downgrading.

2. **Introduction of `user_params` 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 added a commit to shaavan/rust-lightning that referenced this pull request Oct 15, 2024
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 `UserParameters` 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`:**

   This field is retained to ensure downgrade support. However, it is removed from
   `InvoiceReceived` since it was never used, thereby helping to clean up the code
   while still supporting downgrading.

2. **Introduction of `user_params` 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 added a commit to shaavan/rust-lightning that referenced this pull request Oct 18, 2024
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 added a commit to shaavan/rust-lightning that referenced this pull request Oct 18, 2024
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 added a commit to shaavan/rust-lightning that referenced this pull request Oct 18, 2024
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 added a commit to shaavan/rust-lightning that referenced this pull request Oct 18, 2024
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).
TheBlueMatt pushed a commit to TheBlueMatt/rust-lightning that referenced this pull request Oct 21, 2024
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 added a commit to shaavan/rust-lightning that referenced this pull request Oct 22, 2024
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 added a commit to shaavan/rust-lightning that referenced this pull request Oct 22, 2024
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 added a commit to shaavan/rust-lightning that referenced this pull request Feb 10, 2025
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 added a commit to shaavan/rust-lightning that referenced this pull request Feb 11, 2025
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 added a commit to shaavan/rust-lightning that referenced this pull request Feb 11, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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 added a commit to shaavan/rust-lightning that referenced this pull request Feb 12, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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 added a commit to shaavan/rust-lightning that referenced this pull request Feb 17, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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 added a commit to shaavan/rust-lightning that referenced this pull request Feb 17, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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 added a commit to shaavan/rust-lightning that referenced this pull request Feb 19, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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 added a commit to shaavan/rust-lightning that referenced this pull request Feb 25, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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).
adi2011 pushed a commit to adi2011/rust-lightning that referenced this pull request Feb 26, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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).
adi2011 pushed a commit to adi2011/rust-lightning that referenced this pull request Feb 27, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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).
adi2011 pushed a commit to adi2011/rust-lightning that referenced this pull request Feb 28, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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).
adi2011 pushed a commit to adi2011/rust-lightning that referenced this pull request Apr 4, 2025
…sConfig`

When Bolt12 payers & builders are called, they creates a new `PendingOutboundPayment`
entry with relevant values that will be used when the corresponding invoice
is received. This update modifies `AwaitingInvoice` & `AwaitingOffer` 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:

 **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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add another test for max_total_routing_fee_msat Allow to set maximum total fees during routing
6 participants