File tree 3 files changed +9
-17
lines changed
ouroboros-consensus/src/unstable-consensus-testlib/Test
3 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -435,19 +435,7 @@ csjReactions env imm x pid = fmap fixup . \case
435
435
Dynamo pid' clss y _mbQ <- toLazy $ dynamo x
436
436
guard $ pid' == pid
437
437
pure $ case f y of
438
- L. Nothing -> (
439
- CsjState {
440
- dynamo = Nothing
441
- ,
442
- latestJump = latestJump x
443
- ,
444
- nonDynamos = nonDynamos x
445
- ,
446
- queue = queue x
447
- }
448
- ,
449
- [(pid, Disengage )]
450
- )
438
+ L. Nothing -> disengage
451
439
L. Just y' -> (
452
440
CsjState {
453
441
dynamo = Just $ Dynamo pid clss y' Nothing
@@ -605,7 +593,7 @@ csjReactions env imm x pid = fmap fixup . \case
605
593
(Jumped clss (truncCandidate y))
606
594
(nonDynamos x)
607
595
,
608
- queue = snocPerm pid ( queue x)
596
+ queue = queue x
609
597
}
610
598
,
611
599
[(pid, Stop )]
@@ -731,7 +719,9 @@ backfillDynamo (x, msgs) =
731
719
,
732
720
nonDynamos = Map. delete pid (nonDynamos x)
733
721
,
734
- queue = deletePerm pid (queue x)
722
+ queue =
723
+ -- This peer just got picked, so send them to the end.
724
+ snocPerm pid $ deletePerm pid $ queue x
735
725
}
736
726
,
737
727
maybe id (:) ((,) pid <$> mbMsg) msgs
Original file line number Diff line number Diff line change @@ -93,4 +93,5 @@ leftmostInAscSeq f xs =
93
93
LastFalseFirstTrue i _j -> L. Just i
94
94
Uniformly False -> L. Just $ neLength ne - 1
95
95
Uniformly True -> L. Nothing
96
- i <$ guard (q == f (neIndex ne i))
96
+ guard $ q == f (neIndex ne i)
97
+ pure i
Original file line number Diff line number Diff line change @@ -173,7 +173,8 @@ data CsjState pid p a = CsjState {
173
173
-- this set of peers as a last resort.
174
174
latestJump :: ! (Either (Map pid (CsjClientState p a )) (JumpRequest p a ))
175
175
,
176
- -- | The queue for becoming Dynamo
176
+ -- | The queue for becoming Dynamo; it contains the @pid@ of every peer
177
+ -- that is not disengaged
177
178
--
178
179
-- It would be safe for an implementation to break ties randomly instead of
179
180
-- via this queue, but it's nice to not need randomness in the
You can’t perform that action at this time.
0 commit comments