ouroboros-consensus-cardano-0.1.0.0: The instantation of the Ouroboros consensus layer used by Cardano
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Cardano.Node

Synopsis

Documentation

data ProtocolParamsTransition eraFrom eraTo Source #

Parameters needed to transition between two eras.

The two eras are phantom type parameters of this type to avoid mixing up multiple ProtocolParamsTransitions

Constructors

ProtocolParamsTransition 

Fields

  • transitionLowerBound :: Maybe EpochNo

    Lower bound on first epoch of eraTo

    Setting this to Just when a true lower bound is known may particularly improve performance of bulk syncing. For example, for the transition from Byron to Shelley, Just 208 would be sound for the Cardano mainnet, since we know now that the Shelley era began in epoch 208.

    The Nothing case is useful for test and possible alternative nets.

  • transitionTrigger :: TriggerHardFork
     

data ProtocolParamsAllegra c (f :: Type -> Type) Source #

Parameters needed to run Allegra

data ProtocolParamsMary c (f :: Type -> Type) Source #

Parameters needed to run Mary

newtype MaxMajorProtVer Source #

The maximum major protocol version.

Must be at least the current major protocol version. For Cardano mainnet, the Shelley era has major protocol verison 2.

Instances

Instances details
Eq MaxMajorProtVer 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

Show MaxMajorProtVer 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

Generic MaxMajorProtVer 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

Associated Types

type Rep MaxMajorProtVer :: Type -> Type #

NoThunks MaxMajorProtVer 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

type Rep MaxMajorProtVer 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

type Rep MaxMajorProtVer = D1 ('MetaData "MaxMajorProtVer" "Ouroboros.Consensus.Shelley.Protocol" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'True) (C1 ('MetaCons "MaxMajorProtVer" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMaxMajorProtVer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))

data TriggerHardFork Source #

The trigger condition that will cause the hard fork transition.

Constructors

TriggerHardForkAtVersion !Word16

Trigger the transition when the on-chain protocol major version (from the ledger state) reaches this number.

TriggerHardForkAtEpoch !EpochNo

For testing only, trigger the transition at a specific hard-coded epoch, irrespective of the ledger state.

TriggerHardForkNever

Never trigger a hard fork

Instances

Instances details
Show TriggerHardFork Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.CanHardFork

Generic TriggerHardFork Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.CanHardFork

Associated Types

type Rep TriggerHardFork :: Type -> Type #

NoThunks TriggerHardFork Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.CanHardFork

type Rep TriggerHardFork Source # 
Instance details

Defined in Ouroboros.Consensus.Cardano.CanHardFork

type Rep TriggerHardFork = D1 ('MetaData "TriggerHardFork" "Ouroboros.Consensus.Cardano.CanHardFork" "ouroboros-consensus-cardano-0.1.0.0-7Nmjb1YtTWmH6zdQxPRhTh" 'False) (C1 ('MetaCons "TriggerHardForkAtVersion" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word16)) :+: (C1 ('MetaCons "TriggerHardForkAtEpoch" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo)) :+: C1 ('MetaCons "TriggerHardForkNever" 'PrefixI 'False) (U1 :: Type -> Type)))

SupportedNetworkProtocolVersion

pattern CardanoNodeToNodeVersion1 :: BlockNodeToNodeVersion (CardanoBlock c) Source #

We support only Byron V1 with the hard fork disabled, as no other versions have been released before the hard fork

pattern CardanoNodeToNodeVersion2 :: BlockNodeToNodeVersion (CardanoBlock c) Source #

The hard fork enabled with the latest Byron version and the Shelley era enabled.

pattern CardanoNodeToNodeVersion3 :: BlockNodeToNodeVersion (CardanoBlock c) Source #

The hard fork enabled with the latest Byron version, the Shelley and Allegra eras enabled.

pattern CardanoNodeToNodeVersion4 :: BlockNodeToNodeVersion (CardanoBlock c) Source #

The hard fork enabled with the latest Byron version, the Shelley, Allegra, and Mary eras enabled.

pattern CardanoNodeToClientVersion1 :: BlockNodeToClientVersion (CardanoBlock c) Source #

We support the sole Byron version with the hard fork disabled.

pattern CardanoNodeToClientVersion2 :: BlockNodeToClientVersion (CardanoBlock c) Source #

The hard fork enabled and the Shelley era enabled.

pattern CardanoNodeToClientVersion4 :: BlockNodeToClientVersion (CardanoBlock c) Source #

The hard fork enabled, and the Shelley and Allegra eras enabled.

We don't bother with ShelleyNodeToClientVersion1 and HardForkSpecificNodeToClientVersion1.

pattern CardanoNodeToClientVersion5 :: BlockNodeToClientVersion (CardanoBlock c) Source #

The hard fork enabled, and the Shelley, Allegra, and Mary eras enabled.

We don't bother with ShelleyNodeToClientVersion1.

Orphan instances

SerialiseConstraintsHFC ByronBlock Source # 
Instance details

ShelleyBasedEra era => SerialiseConstraintsHFC (ShelleyBlock era) Source # 
Instance details

CardanoHardForkConstraints c => SerialiseHFC (CardanoEras c) Source #

Important: we need to maintain binary compatibility with Byron blocks, as they are already stored on disk.

We also want to be able to efficiently detect (without having to peek far ahead) whether we're dealing with a Byron or Shelley block, so that we can invoke the right decoder. We plan to have a few more hard forks after Shelley (Goguen, Basho, Voltaire), so we want a future-proof envelope for distinguishing the different block types, i.e., a byte indicating the era.

Byron does not provide such an envelope. However, a Byron block is a CBOR 2-tuple with the first element being a tag (Word: 0 = EBB; 1 = regular block) and the second being the payload. We can easily extend this encoding format with support for Shelley, Goguen, etc.

We encode a CardanoBlock as the same CBOR 2-tuple as a Byron block, but we use the tags after 1 for the hard forks after Byron:

  1. Byron EBB
  2. Byron regular block
  3. Shelley block
  4. Allegra block
  5. Mary block
  6. Goguen block
  7. etc.

For more details, see: https://github.com/input-output-hk/ouroboros-network/pull/1175#issuecomment-558147194

Instance details

CardanoHardForkConstraints c => SupportedNetworkProtocolVersion (CardanoBlock c) Source # 
Instance details