Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Initialization of the BlockFetchConsensusInterface
Synopsis
- data ChainDbView m blk = ChainDbView {
- getCurrentChain ∷ STM m (AnchoredFragment (Header blk))
- getIsFetched ∷ STM m (Point blk → Bool)
- getMaxSlotNo ∷ STM m MaxSlotNo
- addBlockWaitWrittenToDisk ∷ InvalidBlockPunishment m → blk → m Bool
- type SlotForgeTimeOracle m blk = RealPoint blk → STM m UTCTime
- defaultChainDbView ∷ IOLike m ⇒ ChainDB m blk → ChainDbView m blk
- initSlotForgeTimeOracle ∷ ∀ m blk. (IOLike m, BlockSupportsProtocol blk, HasHardForkHistory blk, ConfigSupportsNode blk, IsLedger (LedgerState blk)) ⇒ TopLevelConfig blk → ChainDB m blk → m (SlotForgeTimeOracle m blk)
- mkBlockFetchConsensusInterface ∷ ∀ m peer blk. (IOLike m, BlockSupportsDiffusionPipelining blk, BlockSupportsProtocol blk) ⇒ BlockConfig blk → ChainDbView m blk → STM m (Map peer (AnchoredFragment (Header blk))) → (Header blk → SizeInBytes) → SlotForgeTimeOracle m blk → STM m FetchMode → DiffusionPipeliningSupport → BlockFetchConsensusInterface peer (Header blk) blk m
- readFetchModeDefault ∷ (MonadSTM m, HasHeader blk) ⇒ BlockchainTime m → STM m (AnchoredFragment blk) → STM m UseBootstrapPeers → STM m LedgerStateJudgement → STM m FetchMode
Documentation
data ChainDbView m blk Source #
Abstract over the ChainDB
ChainDbView | |
|
type SlotForgeTimeOracle m blk = RealPoint blk → STM m UTCTime Source #
How to get the wall-clock time of a slot. Note that this is a very
non-trivial operation in the context of the HFC, cf. headerForgeUTCTime
.
defaultChainDbView ∷ IOLike m ⇒ ChainDB m blk → ChainDbView m blk Source #
initSlotForgeTimeOracle ∷ ∀ m blk. (IOLike m, BlockSupportsProtocol blk, HasHardForkHistory blk, ConfigSupportsNode blk, IsLedger (LedgerState blk)) ⇒ TopLevelConfig blk → ChainDB m blk → m (SlotForgeTimeOracle m blk) Source #
Create a HFC-enabled SlotForgeTimeOracle
. Note that its semantics are
rather tricky, cf. headerForgeUTCTime
.
mkBlockFetchConsensusInterface Source #
∷ ∀ m peer blk. (IOLike m, BlockSupportsDiffusionPipelining blk, BlockSupportsProtocol blk) | |
⇒ BlockConfig blk | |
→ ChainDbView m blk | |
→ STM m (Map peer (AnchoredFragment (Header blk))) | |
→ (Header blk → SizeInBytes) | |
→ SlotForgeTimeOracle m blk | Slot forge time, see |
→ STM m FetchMode | See |
→ DiffusionPipeliningSupport | |
→ BlockFetchConsensusInterface peer (Header blk) blk m |
readFetchModeDefault ∷ (MonadSTM m, HasHeader blk) ⇒ BlockchainTime m → STM m (AnchoredFragment blk) → STM m UseBootstrapPeers → STM m LedgerStateJudgement → STM m FetchMode Source #