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

feat: add udp packet ratelimiting #8406

Merged
merged 2 commits into from
May 27, 2024
Merged

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented May 27, 2024

Introduces a simple form of ip based rate limiting for discv4

this solution is very primitive and targets 1req/s which is decreased every 30s tick.

There are some caveats here, if there's a DoS attacker that constantly sends new messages at a higher rate then this peer will effectively be ignored indefinitely.

@mattsse mattsse added the A-discv4 Related to discv4 discovery label May 27, 2024
@mattsse mattsse requested a review from fgimenez May 27, 2024 10:52
Copy link
Member

@fgimenez fgimenez left a comment

Choose a reason for hiding this comment

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

lgtm!

crates/net/discv4/src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Federico Gimenez <fgimenez@users.noreply.github.com>
@mattsse mattsse enabled auto-merge May 27, 2024 11:29
@mattsse mattsse added this pull request to the merge queue May 27, 2024
Merged via the queue into main with commit 2e47e9f May 27, 2024
31 checks passed
@mattsse mattsse deleted the matt/add-some-form-of-rate-limiting branch May 27, 2024 12:49
loocapro pushed a commit to loocapro/reth that referenced this pull request May 27, 2024
Co-authored-by: Federico Gimenez <fgimenez@users.noreply.github.com>
mw2000 pushed a commit to mw2000/reth that referenced this pull request Jun 5, 2024
Co-authored-by: Federico Gimenez <fgimenez@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-discv4 Related to discv4 discovery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants