-
Notifications
You must be signed in to change notification settings - Fork 110
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(dot/network): Add warp sync spam limiter #4219
Conversation
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.
Looks nice, just a few comments and questions
@jimjbrettj I made some changes to simplify the implementation and turning in into a generic sliding window rate limiter. Can you take a look again please? 🙌 |
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.
LGTM!
@dimartiro yes. You can decrease the peer reputation if you identify a spamming behavior and it will reach a point where the peer will be disconnected, however the peer still can send messages so we should but it in a block list. Maybe we can add a layer between peer reputation and networking to avoid incoming messages from peers disconnected from bad behavior. |
Changes
Add spam limiter for warp sync request handler.
RateLimiter
interface for our request handlersRatelimiter
as part of the warp sync request handlerSlidingWindowRateLimiter
as an implementation forRateLimiter
to cache requests and prevent spamOpen questions
Tests
go test ./dot/network
Issues
Closes: #4216