@@ -480,16 +480,17 @@ stageRangeOf cfg pl stage =
480
480
-- in the first iteration (ie @'PipelineNo' 0@)
481
481
pipelineOf :: forall p . IsPipeline p => LeiosConfig -> Stage p -> SlotNo -> PipelineNo
482
482
pipelineOf cfg stage sl =
483
- maybe err cnv $ stageStart cfg stage sl minBound
484
- where
485
- cnv = toEnum . (`div` cfg. sliceLength) . fromEnum
483
+ maybe err cnv $ stageStart cfg stage sl minBound
484
+ where
485
+ cnv = toEnum . (`div` cfg. sliceLength) . fromEnum
486
486
487
- err = error $ show (cfg. sliceLength, x, stage, sl)
487
+ err = error $ show (cfg. sliceLength, x, stage, sl)
488
488
489
- x :: String
490
- x = case cfg of LeiosConfig {pipeline} -> case pipeline of
491
- SingSingleVote -> " SingleVote"
492
- SingSplitVote -> " SplitVote"
489
+ x :: String
490
+ x = case cfg of
491
+ LeiosConfig {pipeline} -> case pipeline of
492
+ SingSingleVote -> " SingleVote"
493
+ SingSplitVote -> " SplitVote"
493
494
494
495
forEachPipeline :: (forall p . Stage p ) -> (forall p . IsPipeline p => Stage p -> a ) -> [a ]
495
496
forEachPipeline s k = [k @ SingleVote s, k @ SplitVote s]
@@ -687,20 +688,18 @@ data EndorseBlocksSnapshot = EndorseBlocksSnapshot
687
688
--
688
689
-- IBs that are delivered later than any of these options are discarded,
689
690
-- ignored.
690
- data IbDeliveryStage =
691
- IbDuringProposeOrDeliver1
692
- -- ^ The node will not vote for an EB that excludes IBs that arrived during
691
+ data IbDeliveryStage
692
+ = -- | The node will not vote for an EB that excludes IBs that arrived during
693
693
-- Propose or Deliver1.
694
694
--
695
695
-- The node will include IBs that arrived during Propose or Deliver1 in an
696
696
-- EB it makes.
697
- |
697
+ IbDuringProposeOrDeliver1
698
+ | -- | The node will include IBs that arrived during Deliver2 in an EB it makes.
698
699
IbDuringDeliver2
699
- -- ^ The node will include IBs that arrived during Deliver2 in an EB it makes.
700
- |
701
- IbDuringEndorse
702
- -- ^ The node will not vote for an EB that includes IBs that arrived later
700
+ | -- | The node will not vote for an EB that includes IBs that arrived later
703
701
-- than Endorse.
702
+ IbDuringEndorse
704
703
deriving (Bounded , Enum , Eq , Ord , Show )
705
704
706
705
-- | Both constraints are inclusive.
@@ -718,16 +717,16 @@ ibWasDeliveredLate cfg slotCfg sl deliveryTime =
718
717
719
718
ibDeliveryStage :: LeiosConfig -> SlotConfig -> SlotNo -> UTCTime -> Maybe IbDeliveryStage
720
719
ibDeliveryStage
721
- cfg@ LeiosConfig {pipeline = _ :: SingPipeline p }
722
- slotCfg
723
- ibSlot
724
- deliveryTime
725
- | before loPropose = Nothing -- TODO future blocks?
726
- | before loDeliver2 = Just IbDuringProposeOrDeliver1
727
- | before loEndorse = Just IbDuringDeliver2
728
- | before (succ hiEndorse) = Just IbDuringEndorse
729
- | otherwise = Nothing -- TODO late blocks?
730
- where
720
+ cfg@ LeiosConfig {pipeline = _ :: SingPipeline p }
721
+ slotCfg
722
+ ibSlot
723
+ deliveryTime
724
+ | before loPropose = Nothing -- TODO future blocks?
725
+ | before loDeliver2 = Just IbDuringProposeOrDeliver1
726
+ | before loEndorse = Just IbDuringDeliver2
727
+ | before (succ hiEndorse) = Just IbDuringEndorse
728
+ | otherwise = Nothing -- TODO late blocks?
729
+ where
731
730
p = pipelineOf @ p cfg Propose ibSlot
732
731
733
732
before sl = deliveryTime < slotTime slotCfg sl
@@ -743,14 +742,14 @@ inputBlocksToEndorse ::
743
742
InputBlocksSnapshot ->
744
743
[InputBlockId ]
745
744
inputBlocksToEndorse cfg@ LeiosConfig {pipeline = _ :: SingPipeline p } current buffer =
746
- buffer. validInputBlocks
747
- InputBlocksQuery
748
- { generatedBetween = (lo, hi)
749
- , receivedBy = IbDuringDeliver2
750
- }
751
- where
752
- hi = pipelineOf @ p cfg Endorse current
753
- lo = if cfg. lateIbInclusion then pipelineMonus hi 2 else hi
745
+ buffer. validInputBlocks
746
+ InputBlocksQuery
747
+ { generatedBetween = (lo, hi)
748
+ , receivedBy = IbDuringDeliver2
749
+ }
750
+ where
751
+ hi = pipelineOf @ p cfg Endorse current
752
+ lo = if cfg. lateIbInclusion then pipelineMonus hi 2 else hi
754
753
755
754
-- | Returns possible EBs to reference from current pipeline EB.
756
755
endorseBlocksToReference ::
@@ -809,9 +808,9 @@ shouldVoteOnEB cfg@LeiosConfig{voteSendStage} _ slot _buffers _
809
808
shouldVoteOnEB cfg@ LeiosConfig {voteSendStage = voteSendStage :: Stage p } slotConfig slot buffers ebuffers = cond
810
809
where
811
810
generatedBetween = (lo, hi)
812
- where
813
- hi = pipelineOf @ p cfg voteSendStage slot
814
- lo = if cfg. lateIbInclusion then pipelineMonus hi 2 else hi
811
+ where
812
+ hi = pipelineOf @ p cfg voteSendStage slot
813
+ lo = if cfg. lateIbInclusion then pipelineMonus hi 2 else hi
815
814
receivedByEndorse =
816
815
buffers. validInputBlocks
817
816
InputBlocksQuery
0 commit comments