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

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

Conversation

shaavan
Copy link
Contributor

@shaavan shaavan commented Sep 26, 2024

Partially addresses #3262

  • Introduce a new struct ManualRoutingParameters that optionally takes the parameter to set for routing.
  • Pass it to pay_for_offer to use it along with the invoice's payment parameter to set route parameters.

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, `ManualRoutingParameters`,
that optionally allows users to set additional routing parameters.
In later commits, this struct will be utilized when paying BOLT12 invoices.
When `pay_for_offer` is called, it creates a new `PendingOutboundPayment`
entry with relevant values 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 that all manual routing parameters are available when
finding the payment route.
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 `ManualRoutingParameters`, users gain greater control over the
routing process.
In addition to using PaymentParameters from the invoice, this commit
enables the creation of RouteParameters using the values optionally
set in ManualRoutingParameters.
@shaavan
Copy link
Contributor Author

shaavan commented Sep 26, 2024

Hey @TheBlueMatt @tnull,

A gentle ping! Would love to get your feedback or approach ACK before moving forward with testing and applying a similar approach on the BOLT11 side.

Thanks a lot!

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 89.36170% with 5 lines in your changes missing coverage. Please review.

Project coverage is 89.76%. Comparing base (a0d0f02) to head (271522d).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/routing/router.rs 87.50% 0 Missing and 3 partials ⚠️
lightning/src/ln/channelmanager.rs 75.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3342      +/-   ##
==========================================
+ Coverage   89.65%   89.76%   +0.10%     
==========================================
  Files         126      126              
  Lines      102750   104115    +1365     
  Branches   102750   104115    +1365     
==========================================
+ Hits        92123    93460    +1337     
- Misses       7904     7929      +25     
- Partials     2723     2726       +3     
Flag Coverage Δ
89.76% <89.36%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

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.

1 participant