Skip to content

eth: allow changing maxPeers on the fly #31973

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cskiraly
Copy link
Contributor

@cskiraly cskiraly commented Jun 5, 2025

Allow setting maxPeers on-the-fly.

This PR makes sure maxPeers can be changed in every module that has logic based on it.

In its current form, if maxPeers is reduced, this is not enforced immediately. It will be reached slowly by the dropper. We could eventually add a flag to force-drop. In my code I've done this externally, after calling SetMaxPeers.

@fjl
Copy link
Contributor

fjl commented Jun 5, 2025

Please ensure there is no data race. You can try with go build -race ./cmd/geth and go test -race.

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.

2 participants