Open domZippilli opened 1 month ago
How many do y'all want? I'm of half a mind to just 10x it and call it a day.
Today, 2500 -- tomorrow, THE WORLD!
We currently run a fork with 2500. This is presently plenty of headroom, but I might want to tweak it down...
right. depending on the node's purpose and planned usage, a node operator might want to configure this to be higher or lower. Given how this impacts resource usage, it makes sense for this to be a tunable parameter.
Given how this impacts resource usage, it makes sense for this to be a tunable parameter.
I'm not entirely sure that it does impact resource usage that much. The maximum number of pre-funded channels definitely does, but no-channel peers are incredibly cheap (in ChannelManager
). They may cost bandwidth for gossip, but IMO that is best dealt with at the gossip layer, not in the peer count limit.
no-channel peers are incredibly cheap
Well, would no limit at all be better?
The options I can think of are (1) no limit, (2) a one-size-fits-all limit, or (3) a customizable limit with a sensible default.
Well, would no limit at all be better?
I mean, there is some cost, just not a hell of a lot. Not sure that actually no limit is the right answer given there is some non-zero cost, even if its tiny.
The MAX_NO_CHANNEL_PEERS constant provides helpful protection from an excessive number of peer connections, but as a constant, isn't user modifiable. The desired number of non-channel peers may vary depending on the application, so here we make it configurable.