@@ -480,16 +480,17 @@ stageRangeOf cfg pl stage =
480480-- in the first iteration (ie @'PipelineNo' 0@)
481481pipelineOf :: forall p . IsPipeline p => LeiosConfig -> Stage p -> SlotNo -> PipelineNo
482482pipelineOf 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
486486
487- err = error $ show (cfg. sliceLength, x, stage, sl)
487+ err = error $ show (cfg. sliceLength, x, stage, sl)
488488
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"
493494
494495forEachPipeline :: (forall p . Stage p ) -> (forall p . IsPipeline p => Stage p -> a ) -> [a ]
495496forEachPipeline s k = [k @ SingleVote s, k @ SplitVote s]
@@ -687,20 +688,18 @@ data EndorseBlocksSnapshot = EndorseBlocksSnapshot
687688--
688689-- IBs that are delivered later than any of these options are discarded,
689690-- 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
693693 -- Propose or Deliver1.
694694 --
695695 -- The node will include IBs that arrived during Propose or Deliver1 in an
696696 -- EB it makes.
697- |
697+ IbDuringProposeOrDeliver1
698+ | -- | The node will include IBs that arrived during Deliver2 in an EB it makes.
698699 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
703701 -- than Endorse.
702+ IbDuringEndorse
704703 deriving (Bounded , Enum , Eq , Ord , Show )
705704
706705-- | Both constraints are inclusive.
@@ -718,16 +717,16 @@ ibWasDeliveredLate cfg slotCfg sl deliveryTime =
718717
719718ibDeliveryStage :: LeiosConfig -> SlotConfig -> SlotNo -> UTCTime -> Maybe IbDeliveryStage
720719ibDeliveryStage
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
731730 p = pipelineOf @ p cfg Propose ibSlot
732731
733732 before sl = deliveryTime < slotTime slotCfg sl
@@ -743,14 +742,14 @@ inputBlocksToEndorse ::
743742 InputBlocksSnapshot ->
744743 [InputBlockId ]
745744inputBlocksToEndorse 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
754753
755754-- | Returns possible EBs to reference from current pipeline EB.
756755endorseBlocksToReference ::
@@ -809,9 +808,9 @@ shouldVoteOnEB cfg@LeiosConfig{voteSendStage} _ slot _buffers _
809808shouldVoteOnEB cfg@ LeiosConfig {voteSendStage = voteSendStage :: Stage p } slotConfig slot buffers ebuffers = cond
810809 where
811810 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
815814 receivedByEndorse =
816815 buffers. validInputBlocks
817816 InputBlocksQuery
0 commit comments