ouroboros-network-0.1.0.0: A networking layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Protocol.ChainSync.Codec

Synopsis

Documentation

codecChainSync ∷ ∀ header point tip m. MonadST m ⇒ (header → Encoding) → (∀ s. Decoder s header) → (point → Encoding) → (∀ s. Decoder s point) → (tip → Encoding) → (∀ s. Decoder s tip) → Codec (ChainSync header point tip) DeserialiseFailure m ByteString Source #

Codec for chain sync that encodes/decodes headers

NOTE: See wrapCBORinCBOR and unwrapCBORinCBOR if you want to use this with a header type that has annotations.

codecChainSyncId ∷ ∀ header point tip m. 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.

byteLimitsChainSync ∷ ∀ bytes header point tip. (bytes → Word) → ProtocolSizeLimits (ChainSync header point tip) bytes Source #

Byte Limits

timeLimitsChainSync ∷ ∀ header point tip. ChainSyncTimeoutProtocolTimeLimits (ChainSync header point tip) Source #

Time Limits

'TokIdle'               'waitForever' (ie never times out)
'TokNext TokCanAwait'   the given 'canAwaitTimeout'
'TokNext TokMustReply'  the given 'mustReplyTimeout'
'TokIntersect'          the given 'intersectTimeout'

data ChainSyncTimeout Source #

Configurable timeouts

These are configurable for at least the following reasons.

o So that deployment and testing can use different values.

o So that a net running Praos can better cope with streaks of empty slots. (See input-output-hk/ouroboros-network#2245.)