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

p2p: limit the number of routines(to handle new peers) during peer discovery #883

Closed
vgonkivs opened this issue Jul 5, 2022 · 1 comment

Comments

@vgonkivs
Copy link
Member

vgonkivs commented Jul 5, 2022

Initially proposed by @Wondertan :

We need to limit the number of possible routines. Some adversaries could create bots advertising them as "full" which would eventually over spawn the number of routines. The problem would also be visible on big networks in normal operation, but it is still there.

The easiest solution: just do a buffered throttling channel. Write to it once handling started and read on the finish. This way the buffer of the chan would be a limit of concurrent routines/handlers/connectors.
A bit more work, while more efficient is to preallocate a limited number of workers who rcv handling jobs from findPeers.

Supplement for #599

@Wondertan
Copy link
Member

We rewrote discovery, and we now have a goroutine limit there, so closing

#2117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

No branches or pull requests

2 participants