Research/Bitcoin Dev Archive / lightning-dev list
Routemap scaling (was: Just in Time Routing (JIT-Routing) and a channel rebalancing heuristic as an add on for improved routing success in BOLT 1.0)
9 messages, Mar 29 to Apr 1, 2019. Started by ZmnSCPxj.
ZmnSCPxj (4), Ariel Lorenzo-Luaces (3), René Pickhardt (2)
Good morning Ariel,
I am forking this thread as my reply is not at all related to the JIT-Routing.
Sent with ProtonMail Secure Email.
Quoted text (1 line)
> Public nodes could advertise channels which don't actually exist directly but are instead hidden paths that the source node doesn't need to know or care about. The fees advertised for these aggregate-channels would be the aggregate fees expected from the sub-route.
Nonexistent channels (i.e. channels that do not have some backing UTXO in the Bitcoin blockchain) are not safe to propagate on the network since they are trivially spammable (i.e. can generate a large number of fake channels to waste network bandwidth).
Quoted text (2 lines)
> I think the biggest gain from this system is that the network can be more abstract. This abstraction allows all possible subsets of public nodes to be a clique since all subsets of nodes can be maximally connected with aggregate-channels as long as the entire network is well connected. > This new property of the network could allow a source node to select a random privacy-clique and rely on payments to be routed along aggregate-channels without the source node needing to compute or even know the exact sub-routes. Futhermore, the source node could exclusively download and listen to the privacy-clique and ignore the rest of the network structure thus reducing the burden of keeping up to date network information.
Let me suggest something else.
As the LN grows, the public routemap becomes larger and larger, until keeping them in a fast in-memory data structure becomes infeasible on cheap hardware. In all likelihood, at some point in the future, users will want to be able to limit the memory consumed by implementations for routemaps.
So, some pruning heuristic is needed, to reduce the resource usage of large routemaps.
A good pruning heuristic is "channel capacity", which can be checked onchain (the value of the UTXO backing the channel is the channel capacity). It is good to keep channels with large capacity in the routemap, because such large channels are more likely to successfully route a payment than smaller channels. So it is reasonable to delete channels with low capacity when the routemap memory is becoming close to full.
It seems to me that s/aggregate-channel/high-capacity-channel/g in your idea would still work. In effect, the high-capacity channel is very likely to successfully route in either direction. But if by chance it falls into a state where it is unable to route in one direction or other, the intermediate node has other, lower-capacity channels that it can use JIT-Routing with to improve the directionality of the high-capacity channel. Nothing in the JIT-Routing idea requires that the rebalancing loop is small, only that a loop exists.
Nodes still need to track their direct channels (so they are implicitly always in the routemap). But payee nodes making BOLT1 invoices could also provide `r` routes in the invoice, with the given routes being from nodes with high-capacity channels, so that even if the intermediate channels are pruned due to low capacity, it is possible to get paid.
Regards, ZmnSCPxj
Dear ZmnSCPxj and fellow lightning developers,
I want to point out two things and make a suggestion for a new gossip message.
Quoted text (8 lines)
A good pruning heuristic is "channel capacity", which can be checked > onchain (the value of the UTXO backing the channel is the channel capacity). > It is good to keep channels with large capacity in the routemap, because > such large channels are more likely to successfully route a payment than > smaller channels. > So it is reasonable to delete channels with low capacity when the routemap > memory is becoming close to full. >
Intuitively (without simulation). I encourage to make that process not deerministic but rather probabilistic. It would be good if everyone had a different set of channels. (which is somewhat achieved with everyone keeping their local view)
Quoted text (3 lines)
Nodes still need to track their direct channels (so they are implicitly > always in the routemap). >
I strongly advice that the local view should be extended. Every node should always track their friends of a friend network. Maybe we could even create a new gossip query message `query_ask_egonetwork` that asks for the egonetwork of a node (the egonetwork are all the direct friends of a node together with their friendships) every node knows at least the nodes in their ego network and over time also the edges between them.
If I was interested in my friend of a friend network I could just send the `query_ask_egonetwork` message to all my peers.
Best Rene
Quoted text (12 lines)
But payee nodes making BOLT1 invoices could also provide `r` routes in the > invoice, with the given routes being from nodes with high-capacity > channels, so that even if the intermediate channels are pruned due to low > capacity, it is possible to get paid. > > Regards, > ZmnSCPxj > _______________________________________________ > Lightning-dev mailing list > Lightning-dev at lists.linuxfoundation.org > https://www.learnbitcoin.com/archive/lists/lightning-dev >
Good morning Rene,
Sent with ProtonMail Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Friday, March 29, 2019 1:54 PM, René Pickhardt <r.pickhardt at googlemail.com> wrote:
Quoted text (9 lines)
> Dear ZmnSCPxj and fellow lightning developers, > > I want to point out two things and make a suggestion for a new gossip message. > > > A good pruning heuristic is "channel capacity", which can be checked onchain (the value of the UTXO backing the channel is the channel capacity). > > It is good to keep channels with large capacity in the routemap, because such large channels are more likely to successfully route a payment than smaller channels. > > So it is reasonable to delete channels with low capacity when the routemap memory is becoming close to full. > > Intuitively (without simulation). I encourage to make that process not deerministic but rather probabilistic. It would be good if everyone had a different set of channels. (which is somewhat achieved with everyone keeping their local view)
At a software engineer point-of-view, probabilistic can be difficult to test. This can be made deterministic by including an RNG seed in the input to this code.
However, let me propose instead, in combination with your later thought:
Quoted text (4 lines)
> > > Nodes still need to track their direct channels (so they are implicitly always in the routemap). > > I strongly advice that the local view should be extended. Every node should always track their friends of a friend network.
Perhaps the pruning rule can be modified to include *distance from self* in addition to channel capacity. The nearer the channel is, the more likely it is retained. The further, the less likely. The larger the channel is, the more likely it is retained. The smaller, the less likely.
The capacity divided by the distance can be used as a sorting key, and if pruning is needed, the smallest "score" is pruned until the routemap fits.
This will lead to everyone having a different set of channels, while being likely to track their friend-of-friend network compared to more distant nodes.
Of course, the pruning itself would affect the distance of the channel to the "self" node. So determinism may be difficult to achieve here anyway.
Regards, ZmnSCPxj
Good morning ZmnSCPxj,
Maybe I oversee something - in that case sorry for spamming the list - but I don't understand how you could know the distance from yourself if you don't know the entire topology? (unless u use it on the pruned view as you suggested)
On the other hand querying for a certain depth would be possible with the suggested `query ask egonetwork` in case for depth 3 one would have to peer with the nodes from the friend of a friend network.
Best Rene
ZmnSCPxj <ZmnSCPxj at protonmail.com> schrieb am Fr., 29. März 2019, 09:47:
Quoted text (62 lines)
> Good morning Rene, > > > Sent with ProtonMail Secure Email. > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > On Friday, March 29, 2019 1:54 PM, René Pickhardt < > r.pickhardt at googlemail.com> wrote: > > > Dear ZmnSCPxj and fellow lightning developers, > > > > I want to point out two things and make a suggestion for a new gossip > message. > > > > > A good pruning heuristic is "channel capacity", which can be checked > onchain (the value of the UTXO backing the channel is the channel capacity). > > > It is good to keep channels with large capacity in the routemap, > because such large channels are more likely to successfully route a payment > than smaller channels. > > > So it is reasonable to delete channels with low capacity when the > routemap memory is becoming close to full. > > > > Intuitively (without simulation). I encourage to make that process not > deerministic but rather probabilistic. It would be good if everyone had a > different set of channels. (which is somewhat achieved with everyone > keeping their local view) > > At a software engineer point-of-view, probabilistic can be difficult to > test. > This can be made deterministic by including an RNG seed in the input to > this code. > > However, let me propose instead, in combination with your later thought: > > > > > > Nodes still need to track their direct channels (so they are > implicitly always in the routemap). > > > > I strongly advice that the local view should be extended. Every node > should always track their friends of a friend network. > > Perhaps the pruning rule can be modified to include *distance from self* > in addition to channel capacity. > The nearer the channel is, the more likely it is retained. > The further, the less likely. > The larger the channel is, the more likely it is retained. > The smaller, the less likely. > > The capacity divided by the distance can be used as a sorting key, and if > pruning is needed, the smallest "score" is pruned until the routemap fits. > > This will lead to everyone having a different set of channels, while being > likely to track their friend-of-friend network compared to more distant > nodes. > > Of course, the pruning itself would affect the distance of the channel to > the "self" node. > So determinism may be difficult to achieve here anyway. > > Regards, > ZmnSCPxj >
Quoted text (1 line)
> I am forking this thread as my reply is not at all related to the JIT-Routing.
Sorry I think my last reply was also getting off subject as well. Thank you for forking the thread
Quoted text (1 line)
> Nonexistent channels (i.e. channels that do not have some backing UTXO in the Bitcoin blockchain) are not safe to propagate on the network since they are trivially spammable (i.e. can generate a large number of fake channels to waste network bandwidth).
I hadn't considered the effect this gossip would have on the network. Definitely nodes should not trust one another to tell the truth about nonexistent channels.
The source node could blindly allow intermediate nodes to create sub-routes to the next hop. But I wouldn't favor this blind routing idea because fee calculations would be a complete guesses.
Quoted text (3 lines)
> A good pruning heuristic is "channel capacity", which can be checked onchain (the value of the UTXO backing the channel is the channel capacity). > It is good to keep channels with large capacity in the routemap, because such large channels are more likely to successfully route a payment than smaller channels. > So it is reasonable to delete channels with low capacity when the routemap memory is becoming close to full.
I'm generally concerned about these heuristics because any time nodes can game a heuristic they will be expected to do so. Gaming a heuristic can be good or bad depending on the side-effects. One side effect of the "channel capacity" heuristic is more reliable payments but another side effect is that low capacity (but possibly reliable) channels are neglected.
Quoted text (7 lines)
> It seems to me that s/aggregate-channel/high-capacity-channel/g in your idea would still work. > In effect, the high-capacity channel is very likely to successfully route in either direction. > But if by chance it falls into a state where it is unable to route in one direction or other, the intermediate node has other, lower-capacity channels that it can use JIT-Routing with to improve the directionality of the high-capacity channel. > Nothing in the JIT-Routing idea requires that the rebalancing loop is small, only that a loop exists. > > Nodes still need to track their direct channels (so they are implicitly always in the routemap). > But payee nodes making BOLT1 invoices could also provide `r` routes in the invoice, with the given routes being from nodes with high-capacity channels, so that even if the intermediate channels are pruned due to low capacity, it is possible to get paid.
Without low capacity channels spontaneous payments would not work. Or they would depend on asking for an invoice under the hood. It feels to me that at some point, someone with complete knowledge of the network needs to be employed.
Cheers Ariel Lorenzo-Luaces
Quoted text (1 line)
> I am forking this thread as my reply is not at all related to the JIT-Routing.
Sorry I think my last reply was also getting off subject as well. Thank you for forking the thread
Quoted text (1 line)
> Nonexistent channels (i.e. channels that do not have some backing UTXO in the Bitcoin blockchain) are not safe to propagate on the network since they are trivially spammable (i.e. can generate a large number of fake channels to waste network bandwidth).
I hadn't considered the effect this gossip would have on the network. Definitely nodes should not trust one another to tell the truth about nonexistent channels.
The source node could blindly allow intermediate nodes to create sub-routes to the next hop. But I wouldn't favor this blind routing idea because fee calculations would be a complete guesses.
Quoted text (3 lines)
> A good pruning heuristic is "channel capacity", which can be checked onchain (the value of the UTXO backing the channel is the channel capacity). > It is good to keep channels with large capacity in the routemap, because such large channels are more likely to successfully route a payment than smaller channels. > So it is reasonable to delete channels with low capacity when the routemap memory is becoming close to full.
I'm generally concerned about these heuristics because any time nodes can game a heuristic they will be expected to do so. Gaming a heuristic can be good or bad depending on the side-effects. One side effect of the "channel capacity" heuristic is more reliable payments but another side effect is that low capacity (but possibly reliable) channels are neglected.
Quoted text (7 lines)
> It seems to me that s/aggregate-channel/high-capacity-channel/g in your idea would still work. > In effect, the high-capacity channel is very likely to successfully route in either direction. > But if by chance it falls into a state where it is unable to route in one direction or other, the intermediate node has other, lower-capacity channels that it can use JIT-Routing with to improve the directionality of the high-capacity channel. > Nothing in the JIT-Routing idea requires that the rebalancing loop is small, only that a loop exists. > > Nodes still need to track their direct channels (so they are implicitly always in the routemap). > But payee nodes making BOLT1 invoices could also provide `r` routes in the invoice, with the given routes being from nodes with high-capacity channels, so that even if the intermediate channels are pruned due to low capacity, it is possible to get paid.
Without low capacity channels spontaneous payments would not work. Or they would depend on asking for an invoice under the hood. It feels to me that at some point, someone with complete knowledge of the network needs to be employed.
Cheers Ariel Lorenzo-Luaces
On Mar 28, 2019, 9:51 PM, at 9:51 PM, ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:
Quoted text (71 lines)
>Good morning Ariel, > >I am forking this thread as my reply is not at all related to the >JIT-Routing. > > >Sent with ProtonMail Secure Email. > >> Public nodes could advertise channels which don't actually exist >directly but are instead hidden paths that the source node doesn't need >to know or care about. The fees advertised for these aggregate-channels >would be the aggregate fees expected from the sub-route. > >Nonexistent channels (i.e. channels that do not have some backing UTXO >in the Bitcoin blockchain) are not safe to propagate on the network >since they are trivially spammable (i.e. can generate a large number of >fake channels to waste network bandwidth). > >> I think the biggest gain from this system is that the network can be >more abstract. This abstraction allows all possible subsets of public >nodes to be a clique since all subsets of nodes can be maximally >connected with aggregate-channels as long as the entire network is well >connected. >> This new property of the network could allow a source node to select >a random privacy-clique and rely on payments to be routed along >aggregate-channels without the source node needing to compute or even >know the exact sub-routes. Futhermore, the source node could >exclusively download and listen to the privacy-clique and ignore the >rest of the network structure thus reducing the burden of keeping up to >date network information. > >Let me suggest something else. > >As the LN grows, the public routemap becomes larger and larger, until >keeping them in a fast in-memory data structure becomes infeasible on >cheap hardware. >In all likelihood, at some point in the future, users will want to be >able to limit the memory consumed by implementations for routemaps. > >So, some pruning heuristic is needed, to reduce the resource usage of >large routemaps. > >A good pruning heuristic is "channel capacity", which can be checked >onchain (the value of the UTXO backing the channel is the channel >capacity). >It is good to keep channels with large capacity in the routemap, >because such large channels are more likely to successfully route a >payment than smaller channels. >So it is reasonable to delete channels with low capacity when the >routemap memory is becoming close to full. > >It seems to me that s/aggregate-channel/high-capacity-channel/g in your >idea would still work. >In effect, the high-capacity channel is very likely to successfully >route in either direction. >But if by chance it falls into a state where it is unable to route in >one direction or other, the intermediate node has other, lower-capacity >channels that it can use JIT-Routing with to improve the directionality >of the high-capacity channel. >Nothing in the JIT-Routing idea requires that the rebalancing loop is >small, only that a loop exists. > >Nodes still need to track their direct channels (so they are implicitly >always in the routemap). >But payee nodes making BOLT1 invoices could also provide `r` routes in >the invoice, with the given routes being from nodes with high-capacity >channels, so that even if the intermediate channels are pruned due to >low capacity, it is possible to get paid. > >Regards, >ZmnSCPxj
Quoted text (1 line)
> I am forking this thread as my reply is not at all related to the JIT-Routing.
Sorry I think my last reply was also getting off subject as well. Thank you for forking the thread
Quoted text (1 line)
> Nonexistent channels (i.e. channels that do not have some backing UTXO in the Bitcoin blockchain) are not safe to propagate on the network since they are trivially spammable (i.e. can generate a large number of fake channels to waste network bandwidth).
I hadn't considered the effect this gossip would have on the network. Definitely nodes should not trust one another to tell the truth about nonexistent channels.
The source node could blindly allow intermediate nodes to create sub-routes to the next hop. But I wouldn't favor this blind routing idea because fee calculations would be a complete guess.
Quoted text (3 lines)
> A good pruning heuristic is "channel capacity", which can be checked onchain (the value of the UTXO backing the channel is the channel capacity). > It is good to keep channels with large capacity in the routemap, because such large channels are more likely to successfully route a payment than smaller channels. > So it is reasonable to delete channels with low capacity when the routemap memory is becoming close to full.
I'm generally concerned about these heuristics because any time nodes can game a heuristic they will be expected to do so. Gaming a heuristic can be good or bad depending on the side-effects. One side effect of the "channel capacity" heuristic is more reliable payments but another side effect is that low capacity (but possibly reliable) channels are neglected
Quoted text (7 lines)
> It seems to me that s/aggregate-channel/high-capacity-channel/g in your idea would still work. > In effect, the high-capacity channel is very likely to successfully route in either direction. > But if by chance it falls into a state where it is unable to route in one direction or other, the intermediate node has other, lower-capacity channels that it can use JIT-Routing with to improve the directionality of the high-capacity channel. > Nothing in the JIT-Routing idea requires that the rebalancing loop is small, only that a loop exists. > > Nodes still need to track their direct channels (so they are implicitly always in the routemap). > But payee nodes making BOLT1 invoices could also provide `r` routes in the invoice, with the given routes being from nodes with high-capacity channels, so that even if the intermediate channels are pruned due to low capacity, it is possible to get paid.
Without low capacity channels spontaneous payments would not work. Or they would depend on asking for an invoice under the hood. It feels to me that at some point, someone with complete knowledge of the network needs to eb employed.
Cheers Ariel Lorenzo-Luaces
Good morning Ariel,
Quoted text (10 lines)
> > A good pruning heuristic is "channel capacity", which can be checked onchain (the value of the UTXO backing the channel is the channel capacity). > > It is good to keep channels with large capacity in the routemap, because such large channels are more likely to successfully route a payment than smaller channels. > > So it is reasonable to delete channels with low capacity when the routemap memory is becoming close to full. > > I'm generally concerned about these heuristics because any time nodes > can game a heuristic they will be expected to do so. > Gaming a heuristic can be good or bad depending on the side-effects. > One side effect of the "channel capacity" heuristic is more reliable > payments but another side effect is that low capacity (but possibly > reliable) channels are neglected
The heuristic is gameable at the cost of devoting more capacity to Lightning. It is also quite incentive-compatible to source nodes with limited storage but which may need to forward arbitrary amounts to arbitrary nodes.
Low capacity channels cannot be used at all if their capacity is below my payment amount, no matter how reliable they may be, unless I do multipart payments, which increases base fee paid.
Quoted text (9 lines)
> > > It seems to me that s/aggregate-channel/high-capacity-channel/g in your idea would still work. > > In effect, the high-capacity channel is very likely to successfully route in either direction. > > But if by chance it falls into a state where it is unable to route in one direction or other, the intermediate node has other, lower-capacity channels that it can use JIT-Routing with to improve the directionality of the high-capacity channel. > > Nothing in the JIT-Routing idea requires that the rebalancing loop is small, only that a loop exists. > > Nodes still need to track their direct channels (so they are implicitly always in the routemap). > > But payee nodes making BOLT1 invoices could also provide `r` routes in the invoice, with the given routes being from nodes with high-capacity channels, so that even if the intermediate channels are pruned due to low capacity, it is possible to get paid. > > Without low capacity channels spontaneous payments would not work.
They would not be prevented a priori, only if all channels it has are too small to be kept in memory by typical source nodes.
If I truly wanted to help such a node, I might make a large capacity channel to it and then send my spontaneous payment.
Quoted text (2 lines)
> Or > they would depend on asking for an invoice under the hood.
Which I think is better for spontaneous payments.
Quoted text (2 lines)
> It feels to me that at some point, someone with complete knowledge of > the network needs to eb employed.
Indeed. See the trampoline payments thread also under discuasion.
Regards, ZmnSCPxj
Good morning Rene,
Quoted text (2 lines)
> > Maybe I oversee something - in that case sorry for spamming the list - but I don't understand how you could know the distance from yourself if you don't know the entire topology? (unless u use it on the pruned view as you suggested)
That is correct, and the reason that it would still lose determinism (and thus be hard to test anyway), as I lamented. At least for a pruning heuristic like you proposed (i.e. probabilistically prune channels) it is possible to make deterministic with a fixed RNG seed.
For instance a node might concatenate its own public key with the short-channel-id (in some fixed byte order) of the channel, hash the concatenation, then use the hash as the seed of an RNG that gives 1 bit, and prune the channel if the bit is cleared (to remove half the channels in the routemap).
Quoted text (2 lines)
> > On the other hand querying for a certain depth would be possible with the suggested `query ask egonetwork` in case for depth 3 one would have to peer with the nodes from the friend of a friend network.
But for this, you would require that every node also keep every channel with depth less than your maximum query amount.
Perhaps for friend-of-friend, it might be sufficient to just query a peer to give its own direct public channels, which it needs to remember anyway. But that is basically only a depth of 2 (if we count depth of 1 as your direct channels).
Regards, ZmnSCPxj