Prefer direct routes when paying. - #2144
Conversation
|
I'm in the process of moving pay out to a plugin, but I think that we should be addressing this by fixing routing. Perhaps our fuzz is too large or default risk is too low and it's overriding the natural bias towards direct channels? |
renepickhardt
left a comment
There was a problem hiding this comment.
While I like this improvement and while I think the feature should be part of clightning I thought the entire pay and route handling was supposed to be externalized to a pay plugin? Would still ACK this. Could not find any suspecious looking code
|
Oh sorry had this tab open in my browser and oversaw the comment by @rustyrussell |
The intent is to try direct channels first because:
Fuzz parameter is used to give widely divergent random routes to prevent the same third parties (those trying to bias us towards them by greatly reducing their fees and connecting to as many nodes as they can) from being used over and over. Thus I think we should have a separate preference for a direct channel if possible, but retain high fuzz. An alternative is: Provide local channel balance information and etc to gossipd, and have |
The bias seems to be very tiny: Lines 359 to 364 in d7e233e I note also that Lines 347 to 357 in d7e233e The key point here is that But the first hop from the source is always 0-fee. So I propose to modify it so that if the half-chan is from the source of the route, Thus, the direct route will have a very strong total cost compared to other routes, and I shall try to find time to make this alternate solution. |
|
Since @rustyrussell is planning to write the |
|
If the modification to Regarding plugins, can plugins receive multiple command requests even while an existing command response has not been returned yet? It would be trivial to DoS such a service if multiple P.S. The plugin system can indeed pass multiple commands to the same plugin simultaneously. However, it seems the |
|
Closes #2168 |
Github seems to only auto-close if these statements are in the first message in the thread. |
@ZmnSCPxj pointed out that we sometimes select indirect routes when a direct route is available. This is because the riskfactor is so small that it gets overwhelmed in practice by our fuzzing of fees. There were several proposed fixes, but it does imply in general that a riskfactor of 1 is too low for the network. This patch changes the default and updates the recommendation in the getroute man page. Closes: ElementsProject#2168 Closes: ElementsProject#2144 Fixes: ElementsProject#2119 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Closes: #2168