@@ -111,6 +111,10 @@ data LeiosConfig = forall p. IsPipeline p => LeiosConfig
111111 , variant :: LeiosVariant
112112 , headerDiffusionTime :: NominalDiffTime
113113 -- ^ Δ_{hdr}.
114+ , leiosLateIbInclusion :: Bool
115+ -- ^ Whether an EB also includes IBs from the two previous iterations.
116+ --
117+ -- TODO Merely one previous iteration if 'pipeline' is 'SingleVote'?
114118 , pipelinesToReferenceFromEB :: Int
115119 -- ^ how many older pipelines to reference from an EB when `variant = Full`.
116120 , votingFrequencyPerStage :: Double
@@ -147,6 +151,7 @@ convertConfig disk =
147151 , cleanupPolicies = disk. cleanupPolicies
148152 , variant = disk. leiosVariant
149153 , headerDiffusionTime = realToFrac $ durationMsToDiffTime disk. leiosHeaderDiffusionTimeMs
154+ , leiosLateIbInclusion = disk. leiosLateIbInclusion
150155 , pipelinesToReferenceFromEB =
151156 if disk. leiosVariant == Full
152157 then
@@ -285,6 +290,7 @@ delaysAndSizesAsFull cfg@LeiosConfig{pipeline, voteSendStage} =
285290 , cleanupPolicies = cfg. cleanupPolicies
286291 , variant = cfg. variant
287292 , headerDiffusionTime = cfg. headerDiffusionTime
293+ , leiosLateIbInclusion = cfg. leiosLateIbInclusion
288294 , pipelinesToReferenceFromEB = cfg. pipelinesToReferenceFromEB
289295 , activeVotingStageLength = cfg. activeVotingStageLength
290296 , votingFrequencyPerStage = cfg. votingFrequencyPerStage
@@ -671,14 +677,20 @@ inputBlocksToEndorse ::
671677 InputBlocksSnapshot ->
672678 [InputBlockId ]
673679inputBlocksToEndorse cfg@ LeiosConfig {pipeline = _ :: SingPipeline p } current buffer = fromMaybe [] $ do
674- generatedBetween <- stageRange @ p cfg Endorse current Propose
675- receivedBy <- stageEnd @ p cfg Endorse current Deliver2
676- pure $
677- buffer. validInputBlocks
678- InputBlocksQuery
679- { generatedBetween
680- , receivedBy
681- }
680+ let each sl = do
681+ generatedBetween <- stageRange @ p cfg Endorse sl Propose
682+ receivedBy <- stageEnd @ p cfg Endorse sl Deliver2
683+ pure $
684+ buffer. validInputBlocks
685+ InputBlocksQuery
686+ { generatedBetween
687+ , receivedBy
688+ }
689+ let capL = fromIntegral cfg. sliceLength
690+ oldest =
691+ if not cfg. leiosLateIbInclusion then current
692+ else current - min current (2 * capL)
693+ concat <$> mapM each [ oldest, oldest + capL .. current ]
682694
683695-- | Returns possible EBs to reference from current pipeline EB.
684696endorseBlocksToReference ::
0 commit comments