Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add max_no_channel_peers to UserConfig #3382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

domZippilli
Copy link
Contributor

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.

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.
@TheBlueMatt
Copy link
Collaborator

How many do y'all want? I'm of half a mind to just 10x it and call it a day.

@domZippilli
Copy link
Contributor Author

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...

@br0thersharp
Copy link

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.

@@ -869,6 +871,13 @@ pub struct UserConfig {
/// [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
pub manually_handle_bolt12_invoices: bool,
/// The maximum number of non-channel peers that we will accept. Once this number of non-channel
/// peers is reached, we will not accept any new non-channel peer connectionss. This could mean
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// peers is reached, we will not accept any new non-channel peer connectionss. This could mean
/// peers is reached, we will not accept any new non-channel peer connections. This could mean

@arik-so arik-so self-requested a review October 24, 2024 18:40
@TheBlueMatt
Copy link
Collaborator

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.

@domZippilli
Copy link
Contributor Author

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.

@TheBlueMatt
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants