Ride-The-Lightning / RTL

Ride The Lightning - A full function web browser app for LND, C-Lightning and Eclair
MIT License
731 stars 156 forks source link

Queryroutes function should have an optional source node that's different from the local node #1362

Closed hapablap21 closed 3 months ago

hapablap21 commented 3 months ago

Is your feature request related to a problem? Please describe. When I try to do circular rebalances, I will occasionally get a "no available routes" or something like that

Describe the solution you'd like I would really like it if the queryroutes function allowed an optional source node that's different from mine. I know that I have connections to the two nodes that I want to rebalance through but I can't find another way to determine IF those nodes have another route between them or what it would cost to do that route.

Describe alternatives you've considered I can't think of any other solutions to predetermining routes between arbitrary nodes on the network

Additional context

saubyk commented 3 months ago

Hi @hapablap21 one important concept to understand here is that routing function in Lightning is 'source based routing' i.e. the originator of the payment inspects the graph that it has and determines the path, the payment needs to take based on it's own graph's data. So it wouldn't make sense for queryroute function to take any arbitrary node on the network and try to compute a route from that node's perspective because that node's graph can be different from your node's graph.

Another important thing to understand is that queryroute function is not a probing function, so the cost estimate that it returns for a payment is almost always inaccurate and I wouldn't advise to rely on it too much. You should wait for the probing feature to be made available in LND via https://github.com/lightningnetwork/lnd/pull/8136, which can give you more reliable fee estimates for payments. This feature is expected to land with LND release v0.18.0, although in your specific case i.e circular rebalancing, I doubt it will be directly useful.

Last thing to note, this is not a requirements which RTL can support (queryroute is not a RTL rpc), and for that matter LND as well, so closing this issue here.