-
Notifications
You must be signed in to change notification settings - Fork 179
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
[Networking] Handling iHave broken promises (and part-2 of overpromising) spams #4566
[Networking] Handling iHave broken promises (and part-2 of overpromising) spams #4566
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4566 +/- ##
=======================================
Coverage 54.47% 54.47%
=======================================
Files 914 914
Lines 85278 85290 +12
=======================================
+ Hits 46454 46464 +10
- Misses 35239 35242 +3
+ Partials 3585 3584 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…oken-promises-part-2
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.
Looks good. added one comment about parallelizing the tests since they seem to have long waits. long term we should considering adding some functionality to mock the time interface to make these tests more flexible and less likely to be flaky due to timing.
// this threshold to 10 meaning that the first 10 broken promises are ignored. This is to allow for some network churn. | ||
// Also, per hearbeat (i.e., decay interval), the spammer is allowed to send at most 5000 ihave messages (gossip sub parameter) on aggregate, and | ||
// excess messages are dropped (without being counted as broken promises). | ||
func TestGossipSubIHaveBrokenPromises_Below_Threshold(t *testing.T) { |
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.
can this be run with t.Parallel()
? same question for all the other tests
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.
…-part-2' into yahya/6459-ihave-broken-promises-part-2
bors merge |
4566: [Networking] Handling iHave broken promises (and part-2 of overpromising) spams r=yhassanzadeh13 a=yhassanzadeh13 This PR introduces changes to our GossipSub parameter configurations to effectively address and mitigate iHave Broken Promise attacks. An iHave Broken Promise attack is characterized by a peer advertising an iHave (indicating they have a certain message), but failing to respond to the iWant requests for that message. We have fine-tuned the GossipSub parameters, notably `defaultBehaviourPenaltyThreshold`, `defaultBehaviourPenaltyWeight`, and `defaultBehaviourPenaltyDecay` to penalize such behavior more appropriately. The `defaultBehaviourPenaltyThreshold` is set to `10`, meaning we at most tolerate `10` RPCs containing iHave Broken Promises. The `defaultBehaviourPenaltyWeight` applies a penalty when a peer's misbehavior exceeds the threshold. The penalty is applied to the square of the difference between the misbehavior counter and the threshold, to provide a substantial disincentive for malicious peers. If a peer misbehaves more than `sqrt(2) * 10` times the threshold, they will be graylisted or disconnected. The `defaultBehaviourPenaltyDecay` is set to `0.9`, causing the misbehavior counter to decay by `10%` per decay interval. This means that peers have a chance to recover from their previous misbehavior and incentivizes improved behavior in the future. Co-authored-by: Yahya Hassanzadeh <yhassanzadeh13@ku.edu.tr> Co-authored-by: Yahya Hassanzadeh, Ph.D <yhassanzadeh@ieee.org>
Canceled. |
…-part-2' into yahya/6459-ihave-broken-promises-part-2
This PR introduces changes to our GossipSub parameter configurations to effectively address and mitigate iHave Broken Promise attacks. An iHave Broken Promise attack is characterized by a peer advertising an iHave (indicating they have a certain message), but failing to respond to the iWant requests for that message.
We have fine-tuned the GossipSub parameters, notably
defaultBehaviourPenaltyThreshold
,defaultBehaviourPenaltyWeight
, anddefaultBehaviourPenaltyDecay
to penalize such behavior more appropriately.The
defaultBehaviourPenaltyThreshold
is set to10
, meaning we at most tolerate10
RPCs containing iHave Broken Promises. ThedefaultBehaviourPenaltyWeight
applies a penalty when a peer's misbehavior exceeds the threshold. The penalty is applied to the square of the difference between the misbehavior counter and the threshold, to provide a substantial disincentive for malicious peers. If a peer misbehaves more thansqrt(2) * 10
times the threshold, they will be graylisted or disconnected.The
defaultBehaviourPenaltyDecay
is set to0.9
, causing the misbehavior counter to decay by10%
per decay interval. This means that peers have a chance to recover from their previous misbehavior and incentivizes improved behavior in the future.