This PR implements the following blacklisting algorithm:
Penalties are divided into 4 categories:
NonDeliveryPenalty - applied when a peer did not deliver requested modifier in time
MisbehaviorPenalty - applied when some modifier delivered by peer appeared to be invalid
SpamPenalty - applied when a peer delivered non-requested modifier
PermanentPenalty - applied to peers conforming to a different protocol (failed to parse message from a peer)
Once some penalty is applied a penalized peer accumulates penaltyScore (varies depending on penalty type: NonDeliveryPenalty - 2; MisbehaviorPenalty - 10; SpamPenalty - 25; PermanentPenalty - ∞; )
Penalties of type 1, 2, 3 are not applied repeatedly within a safe interval (defined by scorex.network.penaltySafeInterval - default: 5m)
Once some peer accumulates critical penalty score (defined by scorex.network.penaltyScoreThreshold - default: 100) it gets banned for some time (defined by scorex.network.temporalBanDuration - default: 60m)
The PermanentPenalty is applied immediately and leads to a permanent ban of a peer
Coverage remained the same at 47.185% when pulling f14d7a1c8bd1b8428ed756b1d1a46ca0dc74d79e on i177_2 into 61389071995059b5fe4fc04d6cf1d04a355d5b81 on master.
Close #177
This PR implements the following blacklisting algorithm: Penalties are divided into 4 categories:
penaltyScore
(varies depending on penalty type:NonDeliveryPenalty
-2
;MisbehaviorPenalty
-10
;SpamPenalty
-25
;PermanentPenalty
-∞
; )scorex.network.penaltySafeInterval
- default: 5m)scorex.network.penaltyScoreThreshold
- default: 100) it gets banned for some time (defined byscorex.network.temporalBanDuration
- default: 60m)