-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
les: limit LES peer count and improve peer configuration logic #16010
Conversation
44f4ecf
to
f645149
Compare
if ctx.GlobalIsSet(MaxPeersFlag.Name) { | ||
cfg.MaxPeers = ctx.GlobalInt(MaxPeersFlag.Name) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... Looks like if you specify max-peers
, it's not possible to also have lightpeers. Is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still looks to me like it is entirely possible. ETH peer limit is calculated here:
https://github.com/ethereum/go-ethereum/pull/16010/files#diff-e42690942282286ede9e53bbe7b0c248R399
If you explicitly specify maxpeers, ethpeers is still going to be maxpeers-lightpeers (if LES service is enabled, of course). If you don't, the default value is increased by lightpeers so that the number of ETH peers does not change because of enabling server mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, tried it now, specified maxpeers=150 in server mode and I got ETH=50 LES=100 total=150.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
…eum#16010) * les: limit number of LES connections * eth, cmd/utils: light vs max peer configuration logic
…eum#16010) * les: limit number of LES connections * eth, cmd/utils: light vs max peer configuration logic
This PR replaces #15927