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

les: limit LES peer count and improve peer configuration logic #16010

Merged
merged 2 commits into from
Feb 5, 2018

Conversation

zsfelfoldi
Copy link
Contributor

This PR replaces #15927

@zsfelfoldi zsfelfoldi requested a review from karalabe as a code owner February 2, 2018 12:54
if ctx.GlobalIsSet(MaxPeersFlag.Name) {
cfg.MaxPeers = ctx.GlobalInt(MaxPeersFlag.Name)
} else {
Copy link
Contributor

@holiman holiman Feb 2, 2018

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@zsfelfoldi zsfelfoldi added this to the 1.8.0 milestone Feb 3, 2018
Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

SGTM

@karalabe karalabe merged commit c3f238d into ethereum:master Feb 5, 2018
prestonvanloon pushed a commit to prestonvanloon/go-ethereum that referenced this pull request Apr 2, 2018
…eum#16010)

* les: limit number of LES connections

* eth, cmd/utils: light vs max peer configuration logic
mariameda pushed a commit to NiluPlatform/go-nilu that referenced this pull request Aug 23, 2018
…eum#16010)

* les: limit number of LES connections

* eth, cmd/utils: light vs max peer configuration logic
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