File tree 1 file changed +9
-6
lines changed
simulation/src/LeiosProtocol/Short
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,8 @@ leiosNode tracer cfg followers peers = do
446
446
, pruningThreads
447
447
]
448
448
449
+ -- | After the last vote-receiving slot of each pipeline,
450
+ -- prune all votes from before the last vote-sending slot.
449
451
pruneVoteBuffer ::
450
452
(Monad m , MonadDelay m , MonadTime m , MonadSTM m ) =>
451
453
Tracer m LeiosNodeEvent ->
@@ -455,14 +457,15 @@ pruneVoteBuffer ::
455
457
pruneVoteBuffer _tracer cfg st = go (toEnum 0 )
456
458
where
457
459
go p = do
458
- let last_vote_send = snd $ stageRangeOf cfg. leios p VoteSend
459
- let last_vote_recv = snd $ stageRangeOf cfg. leios p VoteRecv
460
- let pruneTo = succ last_vote_send
461
- _ <- waitNextSlot cfg. slotConfig (succ last_vote_recv )
460
+ let lastVoteSend = snd $ stageRangeOf cfg. leios p VoteSend
461
+ let lastVoteRecv = snd $ stageRangeOf cfg. leios p VoteRecv
462
+ let pruneTo = succ lastVoteSend
463
+ _ <- waitNextSlot cfg. slotConfig (succ lastVoteRecv )
462
464
atomically $ do
463
465
modifyTVar' st. relayVoteState. relayBufferVar $
464
- RB. filter $
465
- \ RB. EntryWithTicket {value} -> (snd value). slot >= pruneTo
466
+ RB. filter $ \ vote ->
467
+ let voteSlot = (snd vote. value). slot
468
+ in voteSlot >= pruneTo
466
469
writeTVar st. prunedVoteStateToVar $! pruneTo
467
470
go (succ p)
468
471
You can’t perform that action at this time.
0 commit comments