Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- 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
- blockForgeUTCTime :: FromConsensus block -> STM m UTCTime
- newtype FromConsensus a = FromConsensus {
- unFromConsensus :: a
Documentation
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. |
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 # |