| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Network.Protocol.ChainSync.Codec
Synopsis
- codecChainSync :: forall header point tip (m :: Type -> Type). MonadST m => (header -> Encoding) -> (forall s. Decoder s header) -> (point -> Encoding) -> (forall s. Decoder s point) -> (tip -> Encoding) -> (forall s. Decoder s tip) -> Codec (ChainSync header point tip) DeserialiseFailure m ByteString
- codecChainSyncId :: forall header point tip (m :: Type -> Type). Monad m => Codec (ChainSync header point tip) CodecFailure m (AnyMessage (ChainSync header point tip))
- byteLimitsChainSync :: (bytes -> Word) -> ProtocolSizeLimits (ChainSync header point tip) bytes
- timeLimitsChainSync :: ChainSyncIdleTimeout -> ProtocolTimeLimitsWithRnd (ChainSync header point tip)
- maxChainSyncTimeout :: DiffTime
- minChainSyncTimeout :: DiffTime
- data ChainSyncIdleTimeout
Documentation
Arguments
| :: forall header point tip (m :: Type -> Type). MonadST m | |
| => (header -> Encoding) | encode header |
| -> (forall s. Decoder s header) | decode header |
| -> (point -> Encoding) | encode point |
| -> (forall s. Decoder s point) | decode point |
| -> (tip -> Encoding) | encode tip |
| -> (forall s. Decoder s tip) | decode tip |
| -> Codec (ChainSync header point tip) DeserialiseFailure m ByteString |
Codec for chain sync that encodes/decodes headers, points & tips.
NOTE: See wrapCBORinCBOR and unwrapCBORinCBOR if you want to use this
with a header type that has annotations.
codecChainSyncId :: forall header point tip (m :: Type -> Type). Monad m => Codec (ChainSync header point tip) CodecFailure m (AnyMessage (ChainSync header point tip)) Source #
An identity Codec for the ChainSync protocol. It does not do any
serialisation. It keeps the typed messages, wrapped in AnyMessage.
Arguments
| :: (bytes -> Word) | compute size of |
| -> ProtocolSizeLimits (ChainSync header point tip) bytes |
Byte Limits
Arguments
| :: ChainSyncIdleTimeout | idle timeout, the default value
|
| -> ProtocolTimeLimitsWithRnd (ChainSync header point tip) |
Time Limits
| ChainSync State | timeout (s) |
|---|---|
| waitForever (i.e. never times out) |
| shortWait |
| randomly picked using uniform distribution from
the range (,
which corresponds to a chance of an empty streak of slots
between `0.0001%` and `1%` probability. |
| shortWait |
maxChainSyncTimeout :: DiffTime Source #
Chain sync mustReplayTimeout upper bound.
minChainSyncTimeout :: DiffTime Source #
Chain sync mustReplayTimeout lower bound.
data ChainSyncIdleTimeout Source #
ChainSync timeout for the StIdle state, e.g. how long the client can
await for MsgRollForward, MsgRollBackward, MsgIntersectFound or
MsgIntersectNotFound.
Constructors
| ChainSyncIdleTimeout DiffTime | |
| ChainSyncNoIdleTimeout |