rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

Rebalance route finder

Open TheBlueMatt opened this issue 4 years ago • 10 comments

We should build a second get_route-like method that, instead of seeking to send funds from one node to another, seeks to balance the funds in a set of ChannelDetails objects by routing through a NetworkGraph back to the same node.

TheBlueMatt avatar Jun 18 '21 16:06 TheBlueMatt

Hey, if no one is working on this, may I take a shot at it?

abhik-99 avatar Sep 09 '21 15:09 abhik-99

Go for it! I imagine it will be simplest to refactor the existing get_route into a thin wrapper and a helper which does the work and supports both rebalance and regular route finding (or at least is used to calculate a path from our peer back to us without the to-be-balanced channel being used).

On Sep 9, 2021, at 08:34, Abhik Banerjee @.***> wrote:

 Hey, if no one is working on this, may I take a shot at it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

TheBlueMatt avatar Sep 09 '21 20:09 TheBlueMatt

I was actually thinking about implementing a method for this paper by Rene Pickhardt. But I take it at this time a Just in Time Routing scheme would be favourable? I can follow c-lightning implementation by cdecker.

The thought of giving the user a choice to select the rebalancing option or finding an alternative route sounds good.

abhik-99 avatar Sep 12 '21 17:09 abhik-99

If we want a parallel route finder (which we could totally do) we should support both routefinders for rebalance-route-finding. For rebalancing we probably don’t want something like the Pickhardt route-finding since we don’t really care about reliability, we just care about minimizing fees.

Pickhardt route-finding we may not want to do anytime soon anyway - it is likely too restrictive in terms of requiring base fees and may overpay in fees, we should first experiment with fee-based scoring of the form “I’m willing to pay X extra in fees to have an N% more reliable payment” which is rather simple to implement. That is something Jeff is currently working on.

On Sep 12, 2021, at 10:46, Abhik Banerjee @.***> wrote:

 I was actually thinking about implementing a method for this paper by Rene Pickhardt. But I take it at this time a Just in Time Routing scheme would be favourable? I can follow c-lightning implementation by cdecker.

The thought of giving the user a choice to select the rebalancing option or finding an alternative route sounds good.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

TheBlueMatt avatar Sep 12 '21 19:09 TheBlueMatt

Got it!

abhik-99 avatar Sep 14 '21 03:09 abhik-99

Hey, sorry but I cannot work on this issue at this time. So if anyone is interested, please feel free to take it up.

abhik-99 avatar Dec 09 '21 15:12 abhik-99

I can take a look at this if it is still relevant?

dunxen avatar Mar 28 '22 10:03 dunxen

Yep, go for it! I think there's somewhat less interest in lightning in rebalancing in general but its definitely still something we should support, for users who want it.

TheBlueMatt avatar Mar 28 '22 20:03 TheBlueMatt

Got tied up in Qala.dev stuff, but planning to continue with this in a few days. No ETA though :)

dunxen avatar Apr 28 '22 18:04 dunxen

Almost have a PR up for this for early review

dunxen avatar Jun 02 '22 12:06 dunxen