Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Network.BlockFetch.ConsensusInterface
Contents
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
- readChainComparison :: STM m (WithFingerprint (ChainComparison header))
- blockFetchSize :: header -> SizeInBytes
- blockMatchesHeader :: header -> block -> Bool
- headerForgeUTCTime :: header -> UTCTime
- readChainSelStarvation :: STM m ChainSelStarvation
- demoteChainSyncJumpingDynamo :: peer -> m ()
- data ChainSelStarvation
- data ChainComparison header = ChainComparison {
- plausibleCandidateChain :: HasCallStack => AnchoredFragment header -> AnchoredFragment header -> Bool
- compareCandidateChains :: HasCallStack => AnchoredFragment header -> AnchoredFragment header -> Ordering
- mkReadFetchMode :: Functor m => ConsensusMode -> m LedgerStateJudgement -> m PraosFetchMode -> m FetchMode
- data WithFingerprint a = WithFingerprint {
- forgetFingerprint :: !a
- getFingerprint :: !Fingerprint
- newtype Fingerprint = Fingerprint Word64
- initialWithFingerprint :: a -> WithFingerprint a
Documentation
data PraosFetchMode Source #
Constructors
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 Methods showsPrec :: Int -> PraosFetchMode -> ShowS # show :: PraosFetchMode -> String # showList :: [PraosFetchMode] -> ShowS # | |
Eq PraosFetchMode Source # | |
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface Methods (==) :: PraosFetchMode -> PraosFetchMode -> Bool # (/=) :: PraosFetchMode -> PraosFetchMode -> Bool # |
The fetch mode that the block fetch logic should use.
Constructors
FetchModeGenesis | |
PraosFetchMode PraosFetchMode |
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.
Constructors
BlockFetchConsensusInterface | |
Fields
|
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.
Constructors
ChainSelStarvationOngoing | |
ChainSelStarvationEndedAt Time |
Instances
data ChainComparison header Source #
Constructors
ChainComparison | |
Fields
|
Arguments
:: Functor m | |
=> ConsensusMode | |
-> m LedgerStateJudgement | Used for |
-> m PraosFetchMode | Used for |
-> m FetchMode |
Construct readFetchMode
for BlockFetchConsensusInterface
by branching
on the ConsensusMode
.
Utilities
data WithFingerprint a Source #
Store a value together with its Fingerprint
.
Constructors
WithFingerprint | |
Fields
|
Instances
Functor WithFingerprint Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface Methods fmap :: (a -> b) -> WithFingerprint a -> WithFingerprint b # (<$) :: a -> WithFingerprint b -> WithFingerprint a # | |||||
Generic (WithFingerprint a) Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface Associated Types
Methods from :: WithFingerprint a -> Rep (WithFingerprint a) x # to :: Rep (WithFingerprint a) x -> WithFingerprint a # | |||||
Show a => Show (WithFingerprint a) Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface Methods showsPrec :: Int -> WithFingerprint a -> ShowS # show :: WithFingerprint a -> String # showList :: [WithFingerprint a] -> ShowS # | |||||
NoThunks a => NoThunks (WithFingerprint a) Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface Methods noThunks :: Context -> WithFingerprint a -> IO (Maybe ThunkInfo) # wNoThunks :: Context -> WithFingerprint a -> IO (Maybe ThunkInfo) # showTypeOf :: Proxy (WithFingerprint a) -> String # | |||||
type Rep (WithFingerprint a) Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface type Rep (WithFingerprint a) = D1 ('MetaData "WithFingerprint" "Ouroboros.Network.BlockFetch.ConsensusInterface" "ouroboros-network-api-0.16.0.0-inplace" 'False) (C1 ('MetaCons "WithFingerprint" 'PrefixI 'True) (S1 ('MetaSel ('Just "forgetFingerprint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "getFingerprint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Fingerprint))) |
newtype Fingerprint Source #
Simple type that can be used to indicate some value (without/only with an
expensive Eq
instance) changed.
Constructors
Fingerprint Word64 |
Instances
Enum Fingerprint Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface Methods succ :: Fingerprint -> Fingerprint # pred :: Fingerprint -> Fingerprint # toEnum :: Int -> Fingerprint # fromEnum :: Fingerprint -> Int # enumFrom :: Fingerprint -> [Fingerprint] # enumFromThen :: Fingerprint -> Fingerprint -> [Fingerprint] # enumFromTo :: Fingerprint -> Fingerprint -> [Fingerprint] # enumFromThenTo :: Fingerprint -> Fingerprint -> Fingerprint -> [Fingerprint] # | |||||
Generic Fingerprint Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface Associated Types
| |||||
Show Fingerprint Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface Methods showsPrec :: Int -> Fingerprint -> ShowS # show :: Fingerprint -> String # showList :: [Fingerprint] -> ShowS # | |||||
Eq Fingerprint Source # | |||||
NoThunks Fingerprint Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface Methods noThunks :: Context -> Fingerprint -> IO (Maybe ThunkInfo) # wNoThunks :: Context -> Fingerprint -> IO (Maybe ThunkInfo) # showTypeOf :: Proxy Fingerprint -> String # | |||||
type Rep Fingerprint Source # | |||||
Defined in Ouroboros.Network.BlockFetch.ConsensusInterface type Rep Fingerprint = D1 ('MetaData "Fingerprint" "Ouroboros.Network.BlockFetch.ConsensusInterface" "ouroboros-network-api-0.16.0.0-inplace" 'True) (C1 ('MetaCons "Fingerprint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
initialWithFingerprint :: a -> WithFingerprint a Source #
Attach
to the given value. When the underlying Fingerprint
0a
is
changed, the Fingerprint
must be updated to a new unique value (e.g. via
succ
).