-
Notifications
You must be signed in to change notification settings - Fork 54
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
GossipSub Rate Limit #920
Merged
Merged
GossipSub Rate Limit #920
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8845e7e
Disconnect peers with too high invalid traffic
diegomrsantos f8ca0f3
Improvements after code review
diegomrsantos 2dcfa1a
Disconnect peers that sent only non-parseable msgs
diegomrsantos 3fec42c
calculate average traffic
diegomrsantos c3ef6d7
fix metrics and add tests
diegomrsantos dfe9fe1
number of bad traffic score peers disconnected
diegomrsantos 6f53761
rename metric and create invalidTrafficRatioThreshold param
diegomrsantos df78830
Disconnect peers which have bad traffic score right after they try to…
diegomrsantos a2ebbad
Improvements after my own review
diegomrsantos e45a32a
Fix metric names and values
diegomrsantos b267cab
Fix sign
diegomrsantos 2bf7fe5
Introduce a useless application byte rate limit
diegomrsantos abbb438
Introduce a rate limit
diegomrsantos 0396724
Add rate limit only to gossipsub
diegomrsantos fc11af4
Decouple decoding and rate limit
diegomrsantos d54b101
Just measure at the beginning instead of disconnecting, for test purp…
diegomrsantos b2f2109
Simplify data size calculation
diegomrsantos 63fa57f
improvements
diegomrsantos 855b770
Use params for rate limit
diegomrsantos 1000bf0
Fixes after code review
diegomrsantos 3ffbb1c
Fix bug
diegomrsantos c7884d5
Make rate limit disable by default if the config isn't provided
diegomrsantos f443a26
Fix test
diegomrsantos 0f1def6
Improve naming
diegomrsantos bfa50dc
Remove procs
diegomrsantos 18f0570
Renaming
diegomrsantos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
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.
This is different from the actual rate limit, it is a config. Adding the Opt makes using
withValue
cleaner.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.
Everything in that structure is a config, it's even named GossipSubParams
And since when do we put the type of a variable in its name?
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.
Done