eclair-mobile icon indicating copy to clipboard operation
eclair-mobile copied to clipboard

route-finding capacity

Open robtex opened this issue 6 years ago • 4 comments

It seems our route-finding algorithm doesn't properly account for available capacity but tries a bit too optimistically to squeeze thru payments. Is that a known issue or do you need more data?

robtex avatar Jul 28 '18 12:07 robtex

We don't have that information, unfortunately. BOLT7 channel_announcements don't include the capacity, we would have to retrieve it from the blockchain for each channel, which is costly (note: those announcements don't even contain the 32B funding txid, instead we use an 8B coordinates of the funding tx in the blockchain).

Actually, for the same reason Eclair Wallet doesn't currently authenticate channel announcements (which includes making sure that a channel announcement is tied to an actual unspent funding tx). It seemed like a reasonable trade-off for the beginning; next step is to authenticate random samples of those announcements (just enough to make sure that a peer doesn't flood us by junk channels), and longer term we plan to use neutrino when it is available.

This is the main part that was stripped down from the "normal" Eclair code base, which of course fully authenticates the announcements and retrieves the capacity in the process. That said, even then we don't use the capacity to filter out routes, that shouldn't be too difficult to add.

pm47 avatar Jul 28 '18 16:07 pm47

Note that another way to look at the problem is for the receiver (which maybe runs on a server and has access to more data) to provides hints about what she thinks are the best routes available. After all she has a strong incentive to help, and this is already supported by BOLT11.

pm47 avatar Jul 28 '18 16:07 pm47

Thank you. Got it... very unfortunate capacity isn't signalled at all by any message. It has annoyed me as well, even though i don't make any mobile clients.

route hints in invoice won't help much since you do not know the potential payers node. it will also easily become huge if you want to provide multiple optional paths and AMP support. imho route hints should be used restrictively, only to announce a few private channels

robtex avatar Jul 28 '18 16:07 robtex

route hints in invoice won't help much since you do not know the potential payers node

Indeed the receiver can't provide a full route, those would just be landmarks à la Flare. I'm pretty sure it would have helped in Andreas' case, but I haven't done any simulations.

imho route hints should be used restrictively, only to announce a few private channels

That is what they were designed for, yes

pm47 avatar Jul 30 '18 08:07 pm47