@@ -21,6 +21,7 @@ func getConfigsByRound() []config.ProcessConfigByRound {
2121 NumFloodingRoundsSlowReacting : 2 ,
2222 NumFloodingRoundsFastReacting : 3 ,
2323 NumFloodingRoundsOutOfSpecs : 4 ,
24+ MaxConsecutiveRoundsOfRatingDecrease : 600 ,
2425 },
2526 {
2627 EnableRound : 1 ,
@@ -30,6 +31,7 @@ func getConfigsByRound() []config.ProcessConfigByRound {
3031 NumFloodingRoundsSlowReacting : 20 ,
3132 NumFloodingRoundsFastReacting : 30 ,
3233 NumFloodingRoundsOutOfSpecs : 40 ,
34+ MaxConsecutiveRoundsOfRatingDecrease : 6000 ,
3335 },
3436 }
3537}
@@ -152,6 +154,20 @@ func TestNewProcessConfigsByEpoch(t *testing.T) {
152154 require .True (t , strings .Contains (err .Error (), "NumFloodingRoundsOutOfSpecs" ))
153155 })
154156
157+ t .Run ("should return error for invalid max consecutive rounds of rating decrease value" , func (t * testing.T ) {
158+ t .Parallel ()
159+
160+ confByEpoch := []config.ProcessConfigByEpoch {
161+ {EnableEpoch : 0 , MaxMetaNoncesBehind : 15 },
162+ }
163+ confByRound := getConfigsByRound ()
164+ confByRound [0 ].MaxConsecutiveRoundsOfRatingDecrease = 0
165+
166+ pce , err := configs .NewProcessConfigsHandler (confByEpoch , confByRound , & epochNotifier.RoundNotifierStub {})
167+ require .Nil (t , pce )
168+ require .ErrorIs (t , err , process .ErrZeroMaxConsecutiveRoundsOfRatingDecrease )
169+ })
170+
155171 t .Run ("should work" , func (t * testing.T ) {
156172 t .Parallel ()
157173
@@ -199,6 +215,7 @@ func TestProcessConfigsByEpoch_Getters(t *testing.T) {
199215 NumFloodingRoundsSlowReacting : 2 ,
200216 NumFloodingRoundsFastReacting : 3 ,
201217 NumFloodingRoundsOutOfSpecs : 4 ,
218+ MaxConsecutiveRoundsOfRatingDecrease : 600 ,
202219 },
203220 {EnableRound : 1 ,
204221 MaxRoundsWithoutNewBlockReceived : 11 ,
@@ -209,6 +226,7 @@ func TestProcessConfigsByEpoch_Getters(t *testing.T) {
209226 NumFloodingRoundsSlowReacting : 20 ,
210227 NumFloodingRoundsFastReacting : 30 ,
211228 NumFloodingRoundsOutOfSpecs : 40 ,
229+ MaxConsecutiveRoundsOfRatingDecrease : 6000 ,
212230 },
213231 }
214232
0 commit comments