Add adaptive advert flood rate limiter to repeater#2544
Closed
ViezeVingertjes wants to merge 1 commit into
Closed
Conversation
64b2d4b to
fd3e171
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an adaptive rate limiter on advert forwarding so one node cannot flood the mesh with bogus or abusive adverts. Bursts are still allowed when traffic is normal; the cap tightens when someone tries to hammer fake adverts.
That max rises and falls with recent traffic so normal use still gets through, but floods hit the cap fast and the rest is dropped until the next window.
Kept CLI changes minimal, on by default for happy neighbors.
get advert.ratelimitset advert.ratelimit {on/off}Context:
Most (intentional) abuse we had so far was spamming fake adverts, as it's one of the easiest things one (claude) can make apparantly. I tried to keep it as small/simple as possible, while still putting a brake on it, so it doesnt flood further into the mesh.
The EWMA config could be added to CLI perhaps as future improvement, with perhaps some kind of stats/status command, but left that out of scope for now.