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

Mark ChannelManager::send_payment_with_route as deprecated and take Route by value #3224

Conversation

TheBlueMatt
Copy link
Collaborator

We probably should have done this long ago a release or two after
adding send_payment, but we didn't and the second best time is
now.

send_payment_with_route has particularly hard to use retry
semantics that make it unsuitable for real use. Once we get the
last of our users off of it, we'll want to remove it (or at least
mark it test-only), but we should start by deprecating it.

Now that ChannelManager::send_payment_with_route is deprecated,
we don't care too much about making it as effecient as possible, so
there's not much cost to making it take Route by value. This
avoids bindings being unsure if the by-reference Route passed
needs to outlive the ChannelManager itself or if it only needs to
outlive the method call, creating some call overhead by forcing a
Route::clone, but avoiding a memory leak.

@TheBlueMatt TheBlueMatt added this to the 0.0.124 milestone Aug 4, 2024
We probably should have done this long ago a release or two after
adding `send_payment`, but we didn't and the second best time is
now.

`send_payment_with_route` has particularly hard to use retry
semantics that make it unsuitable for real use. Once we get the
last of our users off of it, we'll want to remove it (or at least
mark it test-only), but we should start by deprecating it.
@TheBlueMatt TheBlueMatt force-pushed the 2024-08-deprecate-send_payment branch from 536e68a to b7d0a25 Compare August 4, 2024 17:52
Now that `ChannelManager::send_payment_with_route` is deprecated,
we don't care too much about making it as effecient as possible, so
there's not much cost to making it take `Route` by value. This
avoids bindings being unsure if the by-reference `Route` passed
needs to outlive the `ChannelManager` itself or if it only needs to
outlive the method call, creating some call overhead by forcing a
`Route::clone`, but avoiding a memory leak.
@TheBlueMatt TheBlueMatt force-pushed the 2024-08-deprecate-send_payment branch from b7d0a25 to 753a7ac Compare August 4, 2024 18:16
Copy link

codecov bot commented Aug 4, 2024

Codecov Report

Attention: Patch coverage is 99.35065% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.75%. Comparing base (8c1b3d1) to head (753a7ac).
Report is 12 commits behind head on main.

Files Patch % Lines
lightning/src/ln/functional_test_utils.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3224   +/-   ##
=======================================
  Coverage   89.75%   89.75%           
=======================================
  Files         122      122           
  Lines      101791   101791           
  Branches   101791   101791           
=======================================
+ Hits        91360    91362    +2     
+ Misses       7748     7746    -2     
  Partials     2683     2683           

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

@valentinewallace valentinewallace merged commit 3071bbb into lightningdevkit:main Aug 5, 2024
17 of 21 checks passed
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.

2 participants