Skip to content

Renepay use getroutes #8049

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

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Lagrang3
Copy link
Collaborator

@Lagrang3 Lagrang3 commented Feb 4, 2025

This PR removes the MCF code from renepay. Routes are computed using getroutes instead.

Depends on #7985 (merged)
Replaces #7633 (closed)
It would be nice to have on top of #7963 (closed) "temporary layers" and #8072 (merged) "bias stacking".

UPD.
Also #8129 (merged) "Big fake channels" would be nice to have.

@Lagrang3 Lagrang3 marked this pull request as draft February 4, 2025 08:58
@Lagrang3 Lagrang3 force-pushed the renepay-use-askrene branch 3 times, most recently from 1062510 to b2fcf5f Compare February 10, 2025 10:14
@Lagrang3 Lagrang3 force-pushed the renepay-use-askrene branch 3 times, most recently from ac2e0b1 to c2925cf Compare February 20, 2025 07:45
@Lagrang3 Lagrang3 force-pushed the renepay-use-askrene branch from 304bf67 to 313aecf Compare February 27, 2025 10:12
Changelog-Added: renepay: use external call to [askrene-]getroutes instead of computing routes internally.

Signed-off-by: Lagrang3 <[email protected]>
Use askrene API to account for route-hints and blinded paths.

Changelog-None.

Signed-off-by: Lagrang3 <[email protected]>
Changelog-None.

Signed-off-by: Lagrang3 <[email protected]>
The execution of the failure notification makes calls to askrene to
disable or bias channels that have returned weird errors.

Changelog-None.

Signed-off-by: Lagrang3 <[email protected]>
Changelog-None.

Signed-off-by: Lagrang3 <[email protected]>
Remove unnecessary rpc call to waitblockheight at the default payment's
ending.

Changelog-None.

Signed-off-by: Lagrang3 <[email protected]>
Changelog-None.

Signed-off-by: Lagrang3 <[email protected]>
Changelog-None.

Signed-off-by: Lagrang3 <[email protected]>
Remove the MCF solver from renepay.
Offload the route computation on askrene.

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
Use plugin_get_data API and make less use of the access to the global
plugin state when possible.

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
Sending requests with batches allow us to avoid race conditions
when the payment plugin goes to the next state before the sendpay RPC
have not yet completed.

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
Use askrene-reserve API to lock-in the liquidity of the channels in use
for pending payment route.

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
Use askrene-unreserve to remove reserved liquidity associated with
routes that have completed, either by success or failure.

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
Make extensive use of rpc batches so that we ensure all request have
been processed before the notification is closed as handled.

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
Use askrene-inform-channel to update the knowledge of the liquidity when
a payment attempt fails.

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
Splig send routes into two steps:
1. reserve liquidity,
2. call sendpay

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
struct rpcaction: encapsulates the concept of an RPC action,
ie. an RPC call object.
It can be attached to an rpcbatch.

Changelog-None.

Signed-off-by: Lagrang3 <[email protected]>
Calling askrene-unreserve using rpcActions.
Either:
- after geting a fail notification,
- or success notification,
- or if the route destructor is called.

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
@Lagrang3 Lagrang3 force-pushed the renepay-use-askrene branch 2 times, most recently from 2f08e74 to fbe8092 Compare March 4, 2025 07:07
@Lagrang3 Lagrang3 marked this pull request as ready for review March 4, 2025 07:08
@Lagrang3 Lagrang3 force-pushed the renepay-use-askrene branch 3 times, most recently from 3ea171c to a8edf18 Compare March 4, 2025 07:52
@Lagrang3 Lagrang3 requested a review from cdecker as a code owner March 5, 2025 06:43
@Lagrang3
Copy link
Collaborator Author

Lagrang3 commented Mar 5, 2025

@rustyrussell: I would like to file a complain. The test "Update examples in doc schemas" is overzealous about the
command outputs. Now that I've added a new "renepay" persistent layer to askrene, we may have as result
of the command askrene-listlayers two possible orderings {"layers": ["xpay", "renepay"]} or
{"layers": ["renepay", "xpay"]}, and both are correct. But not one order is guaranteed.
The only solutions I see are either:

  • ignore "Update examples in doc schemas", the code is perfectly fine,
  • or to follow the rules of "Update examples in doc schemas", and add extra code to sort the listlayers output in a definite order just to be able to pass the tests,
  • or check the examples' outputs with other than just git diff.

UPD: I will not use a global "renepay" layer, instead I will use "xpay", it is a good choice I think, because
every piece of knowledge learnt from either the use of xpay and renepay will be available for both plugins.

- skip test on local htlc max limits which is not supported by askrene, on privacy
  leak issue.
- skip very extreme flow cases, where sats per HTLC in reserve must be taken
  into account.
- adjust the expected error response for messages coming from askrene.
- on getroutes failure return a command fail with the same error code as
  getroutes response.

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
@Lagrang3 Lagrang3 force-pushed the renepay-use-askrene branch from bbd3ea4 to 8274c63 Compare March 5, 2025 07:35
Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
@Lagrang3 Lagrang3 force-pushed the renepay-use-askrene branch from 8274c63 to 4c9bbe5 Compare March 5, 2025 07:53
that broke because of layers created by renepay

Changelog-None

Signed-off-by: Lagrang3 <[email protected]>
@Lagrang3 Lagrang3 force-pushed the renepay-use-askrene branch from 4c9bbe5 to 2facae2 Compare March 5, 2025 11:08
This was referenced Mar 11, 2025
@Lagrang3 Lagrang3 marked this pull request as draft May 15, 2025 08:49
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