ouroboros-consensus-0.21.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.HardFork.Combinator.Serialisation

Description

Serialisation support for the HFC

Synopsis

Documentation

data HardForkNodeToNodeVersion xs where Source #

Constructors

HardForkNodeToNodeDisabledBlockNodeToNodeVersion x → HardForkNodeToNodeVersion (x ': xs)

Disable the HFC

This means that only the first era (x) is supported, and moreover, is compatible with serialisation used if the HFC would not be present at all.

HardForkNodeToNodeEnabledHardForkSpecificNodeToNodeVersionNP WrapNodeToNodeVersion xs → HardForkNodeToNodeVersion xs

Enable the HFC

Serialised values will always include tags inserted by the HFC to distinguish one era from another. We version the hard-fork specific parts with HardForkSpecificNodeToNodeVersion.

data HardForkSpecificNodeToClientVersion Source #

Versioning of the specific additions made by the HFC to the NodeToClient protocols, e.g., the era tag or the hard-fork specific queries.

Instances

Instances details
Bounded HardForkSpecificNodeToClientVersion Source # 
Instance details

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

Enum HardForkSpecificNodeToClientVersion Source # 
Instance details

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

Show HardForkSpecificNodeToClientVersion Source # 
Instance details

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

Eq HardForkSpecificNodeToClientVersion Source # 
Instance details

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

Ord HardForkSpecificNodeToClientVersion Source # 
Instance details

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

data HardForkSpecificNodeToNodeVersion Source #

Versioning of the specific additions made by the HFC to the NodeToNode protocols, e.g., the era tag.

Instances

Instances details
Bounded HardForkSpecificNodeToNodeVersion Source # 
Instance details

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

Enum HardForkSpecificNodeToNodeVersion Source # 
Instance details

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

Show HardForkSpecificNodeToNodeVersion Source # 
Instance details

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

Eq HardForkSpecificNodeToNodeVersion Source # 
Instance details

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

Ord HardForkSpecificNodeToNodeVersion Source # 
Instance details

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

class (CanHardFork xs, All SerialiseConstraintsHFC xs, All (Compose Show EraNodeToClientVersion) xs, All (Compose Eq EraNodeToClientVersion) xs, All (Compose Show WrapNodeToNodeVersion) xs, All (Compose Eq WrapNodeToNodeVersion) xs, All (EncodeDiskDepIx (NestedCtxt Header)) xs, All (DecodeDiskDepIx (NestedCtxt Header)) xs, All HasBinaryBlockInfo xs) ⇒ SerialiseHFC xs where Source #

Conditions required by the HFC to provide serialisation

NOTE: Compatibility between HFC enabled and disabled:

  1. Node-to-node and node-to-client communication is versioned. When the HFC is disabled, we default to the instances for the first era, and so compatibility is preserved by construction.
  2. On-disk storage is not versioned, and here we make no attempt to be compatible between non-HFC and HFC deployments, except for blocks: we define two methods encodeDiskHfcBlock and decodeDiskHfcBlock which are used for on-disk serialisation of blocks. These methods have defaults which can and probably should be used for deployments that use the HFC from the get-go, but for deployments that only later change to use the HFC these functions can be overriden to provide an on-disk storage format for HFC blocks that is compatible with the on-disk storage of blocks from the first era.
  3. The converse is NOT supported. Deployments that use the HFC from the start should not use HardForkNodeToNodeDisabled and/or HardForkNodeToClientDisabled. Doing so would result in opposite compatibility problems: the on-disk block would include the HFC tag, but sending blocks with the HFC disabled suggests that that tag is unexpected. This would then lead to problems with binary streaming, and we do not currently provide any provisions to resolve these.

Minimal complete definition

Nothing