ouroboros-consensus-0.26.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Node.Serialisation

Description

Serialisation for sending things across the network.

We separate NodeToNode from NodeToClient to be very explicit about what gets sent where.

Unlike in Ouroboros.Consensus.Storage.Serialisation, we don't separate the encoder from the decoder, because the reasons don't apply: we always need both directions and we don't have access to the bytestrings that could be used for the annotations (we use CBOR-in-CBOR in those cases).

Synopsis

Documentation

class SerialiseBlockQueryResult blk (query ∷ Type → k → TypeType) where Source #

How to serialise the result of a block query.

The LocalStateQuery protocol is a node-to-client protocol, hence the NodeToClientVersion argument.

Methods

encodeBlockQueryResult ∷ ∀ (fp ∷ k) result. CodecConfig blk → BlockNodeToClientVersion blk → query blk fp result → result → Encoding Source #

decodeBlockQueryResult ∷ ∀ (fp ∷ k) result. CodecConfig blk → BlockNodeToClientVersion blk → query blk fp result → ∀ s. Decoder s result Source #

class SerialiseNodeToClient blk a where Source #

Serialise a type a so that it can be sent across the network via node-to-client protocol.

Minimal complete definition

Nothing

Instances

Instances details
SerialiseNodeToClient blk TriggerHardFork Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Simple

SerialiseNodeToClient blk (PartialLedgerConfig blk) ⇒ SerialiseNodeToClient blk (WrapPartialLedgerConfig blk) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.PartialConfig

SerialiseNodeToClient blk (ApplyTxErr blk) ⇒ SerialiseNodeToClient blk (WrapApplyTxErr blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseNodeToClient blk (GenTxId blk) ⇒ SerialiseNodeToClient blk (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseNodeToClient blk (LedgerConfig blk) ⇒ SerialiseNodeToClient blk (WrapLedgerConfig blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseNodeToClient blk blk ⇒ SerialiseNodeToClient blk (I blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseNodeToClient blk (SomeBlockQuery (query blk)) ⇒ SerialiseNodeToClient blk ((SomeBlockQuery :.: query) blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) SlotNo Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (PerEraLedgerConfig xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (HardForkLedgerConfig xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (HardForkApplyTxErr xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (Shape xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (SomeBlockQuery (BlockQuery (HardForkBlock xs))) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (GenTx (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (GenTxId (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (Serialised (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

class SerialiseNodeToNode blk a where Source #

Serialise a type a so that it can be sent across network via a node-to-node protocol.

Minimal complete definition

Nothing

Instances

Instances details
SerialiseNodeToNode blk (GenTxId blk) ⇒ SerialiseNodeToNode blk (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseNodeToNode blk blk ⇒ SerialiseNodeToNode blk (I blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (Header (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (GenTx (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (GenTxId (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (SerialisedHeader (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (Serialised (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

class SerialiseResult blk (query ∷ TypeTypeType) where Source #

How to serialise the result of a query.

The LocalStateQuery protocol is a node-to-client protocol, hence the NodeToClientVersion argument.

Methods

encodeResultCodecConfig blk → BlockNodeToClientVersion blk → query blk result → result → Encoding Source #

decodeResultCodecConfig blk → BlockNodeToClientVersion blk → query blk result → ∀ s. Decoder s result Source #

Instances

Instances details
(SerialiseBlockQueryResult blk BlockQuery, Serialise (HeaderHash blk), SerialiseNodeToClient blk (LedgerConfig blk)) ⇒ SerialiseResult blk Query Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Methods

encodeResultCodecConfig blk → BlockNodeToClientVersion blk → Query blk result → result → Encoding Source #

decodeResultCodecConfig blk → BlockNodeToClientVersion blk → Query blk result → ∀ s. Decoder s result Source #

Defaults

defaultEncodeCBORinCBORSerialise a ⇒ a → Encoding Source #

Uses the Serialise instance, but wraps it in CBOR-in-CBOR.

Use this for the SerialiseNodeToNode and/or SerialiseNodeToClient instance of blk and/or Header blk, which require CBOR-in-CBOR to be compatible with the corresponding Serialised instance.

Re-exported for convenience

data Some (f ∷ k → Type) where Source #

Constructors

Some ∷ ∀ {k} (f ∷ k → Type) (a ∷ k). f a → Some f