@@ -285,7 +285,7 @@ prop_leashingAttackTimeLimited =
285285 pure $ PointSchedule
286286 { psSchedule = Peers honests advs
287287 , psStartOrder = []
288- , psMinEndTime = timeLimit
288+ , psMinEndTime = addGracePeriodDelay ( length advs) timeLimit
289289 }
290290
291291 takePointsUntil limit = takeWhile ((<= limit) . fst )
@@ -361,7 +361,8 @@ prop_loeStalling =
361361
362362 defaultSchedulerConfig {
363363 scEnableLoE = True ,
364- scEnableCSJ = True
364+ scEnableCSJ = True ,
365+ scEnableBlockFetchTimeouts = False
365366 }
366367
367368 shrinkPeerSchedules
@@ -402,6 +403,7 @@ prop_downtime = forAllGenesisTest
402403 , scEnableLoP = True
403404 , scDowntime = Just 11
404405 , scEnableCSJ = True
406+ , scEnableBlockFetchTimeouts = False
405407 }
406408
407409 shrinkPeerSchedules
@@ -433,7 +435,8 @@ prop_blockFetchLeashingAttack =
433435 defaultSchedulerConfig
434436 { scEnableLoE = True ,
435437 scEnableLoP = True ,
436- scEnableCSJ = True
438+ scEnableCSJ = True ,
439+ scEnableBlockFetchTimeouts = False
437440 }
438441 shrinkPeerSchedules
439442 theProperty
@@ -455,7 +458,7 @@ prop_blockFetchLeashingAttack =
455458 -- Important to shuffle the order in which the peers start, otherwise the
456459 -- honest peer starts first and systematically becomes dynamo.
457460 psStartOrder <- shuffle $ getPeerIds psSchedule'
458- let maxTime = maximum $
461+ let maxTime = addGracePeriodDelay ( length adversaries') $ maximum $
459462 Time 0 : [ pt | s <- honest : adversaries', (pt, _) <- take 1 (reverse s) ]
460463 pure $ PointSchedule {
461464 psSchedule = psSchedule',
@@ -470,6 +473,12 @@ prop_blockFetchLeashingAttack =
470473 isBlockPoint (ScheduleBlockPoint _) = True
471474 isBlockPoint _ = False
472475
476+ -- | Add a delay at the end of tests to account for retention of blocks
477+ -- by adversarial peers in blockfetch. This delay is 10 seconds per
478+ -- adversarial peer.
479+ addGracePeriodDelay :: Int -> Time -> Time
480+ addGracePeriodDelay adversaryCount = addTime (fromIntegral adversaryCount * 10 )
481+
473482disableBoringTimeouts :: GenesisTest blk schedule -> GenesisTest blk schedule
474483disableBoringTimeouts gt =
475484 gt
0 commit comments