Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PraosFetchMode
- data FetchMode
- data BlockFetchConsensusInterface peer header block (m :: Type -> Type) = BlockFetchConsensusInterface {
- readCandidateChains :: STM m (Map peer (AnchoredFragment header))
- readCurrentChain :: STM m (AnchoredFragment header)
- readFetchMode :: STM m FetchMode
- readFetchedBlocks :: STM m (Point block -> Bool)
- mkAddFetchedBlock :: STM m (Point block -> block -> m ())
- readFetchedMaxSlotNo :: STM m MaxSlotNo
- plausibleCandidateChain :: HasCallStack => AnchoredFragment header -> AnchoredFragment header -> Bool
- compareCandidateChains :: HasCallStack => AnchoredFragment header -> AnchoredFragment header -> Ordering
- blockFetchSize :: header -> SizeInBytes
- blockMatchesHeader :: header -> block -> Bool
- headerForgeUTCTime :: FromConsensus header -> STM m UTCTime
- readChainSelStarvation :: STM m ChainSelStarvation
- demoteChainSyncJumpingDynamo :: peer -> m ()
- newtype FromConsensus a = FromConsensus {
- unFromConsensus :: a
- data ChainSelStarvation
- mkReadFetchMode :: Functor m => ConsensusMode -> m LedgerStateJudgement -> m PraosFetchMode -> m FetchMode
Documentation
data PraosFetchMode Source #
FetchModeBulkSync | Use this mode when we are catching up on the chain but are stil well behind. In this mode the fetch logic will optimise for throughput rather than latency. |
FetchModeDeadline | Use this mode for block-producing nodes that have a known deadline to produce a block and need to get the best chain before that. In this mode the fetch logic will optimise for picking the best chain within the given deadline. |
Instances
Show PraosFetchMode Source # | |
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface showsPrec :: Int -> PraosFetchMode -> ShowS # show :: PraosFetchMode -> String # showList :: [PraosFetchMode] -> ShowS # | |
Eq PraosFetchMode Source # | |
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface (==) :: PraosFetchMode -> PraosFetchMode -> Bool # (/=) :: PraosFetchMode -> PraosFetchMode -> Bool # |
The fetch mode that the block fetch logic should use.
data BlockFetchConsensusInterface peer header block (m :: Type -> Type) Source #
The consensus layer functionality that the block fetch logic requires.
These are provided as input to the block fetch by the consensus layer.
BlockFetchConsensusInterface | |
|
newtype FromConsensus a Source #
A new type used to emphasize the precondition of
headerForgeUTCTime
and
blockForgeUTCTime
at each
call site.
At time of writing, the a
is either a header or a block. The headers are
literally from Consensus (ie provided by ChainSync). Blocks, on the other
hand, are indirectly from Consensus: they were fetched only because we
favored the corresponding header that Consensus provided.
Instances
Applicative FromConsensus Source # | |
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface pure :: a -> FromConsensus a # (<*>) :: FromConsensus (a -> b) -> FromConsensus a -> FromConsensus b # liftA2 :: (a -> b -> c) -> FromConsensus a -> FromConsensus b -> FromConsensus c # (*>) :: FromConsensus a -> FromConsensus b -> FromConsensus b # (<*) :: FromConsensus a -> FromConsensus b -> FromConsensus a # | |
Functor FromConsensus Source # | |
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface fmap :: (a -> b) -> FromConsensus a -> FromConsensus b # (<$) :: a -> FromConsensus b -> FromConsensus a # |
data ChainSelStarvation Source #
Whether ChainSel is starved or has been recently.
The bulk sync fetch decision logic needs to decide whether the current focused peer has starved ChainSel recently. This datatype is used to represent this piece of information.
Instances
:: Functor m | |
=> ConsensusMode | |
-> m LedgerStateJudgement | Used for |
-> m PraosFetchMode | Used for |
-> m FetchMode |
Construct readFetchMode
for BlockFetchConsensusInterface
by branching
on the ConsensusMode
.