| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Cardano.Node
Synopsis
- protocolInfoCardano :: forall c m. (IOLike m, CardanoHardForkConstraints c) => ProtocolParamsByron -> ProtocolParamsShelley c Maybe -> ProtocolParamsAllegra c Maybe -> ProtocolParamsMary c Maybe -> ProtocolParamsTransition ByronBlock (ShelleyBlock (ShelleyEra c)) -> ProtocolParamsTransition (ShelleyBlock (ShelleyEra c)) (ShelleyBlock (AllegraEra c)) -> ProtocolParamsTransition (ShelleyBlock (AllegraEra c)) (ShelleyBlock (MaryEra c)) -> ProtocolInfo m (CardanoBlock c)
- data ProtocolParamsTransition eraFrom eraTo = ProtocolParamsTransition {}
- data ProtocolParamsAllegra c (f :: Type -> Type) = ProtocolParamsAllegra {}
- data ProtocolParamsMary c (f :: Type -> Type) = ProtocolParamsMary {}
- protocolClientInfoCardano :: forall c. EpochSlots -> ProtocolClientInfo (CardanoBlock c)
- type CardanoHardForkConstraints c = (PraosCrypto c, ShelleyBasedEra (ShelleyEra c), ShelleyBasedEra (AllegraEra c), ShelleyBasedEra (MaryEra c), HASH c ~ Blake2b_256, ADDRHASH c ~ Blake2b_224, DSIGN c ~ Ed25519DSIGN)
- newtype MaxMajorProtVer = MaxMajorProtVer {}
- data TriggerHardFork
- pattern CardanoNodeToNodeVersion1 :: BlockNodeToNodeVersion (CardanoBlock c)
- pattern CardanoNodeToNodeVersion2 :: BlockNodeToNodeVersion (CardanoBlock c)
- pattern CardanoNodeToNodeVersion3 :: BlockNodeToNodeVersion (CardanoBlock c)
- pattern CardanoNodeToNodeVersion4 :: BlockNodeToNodeVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion1 :: BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion2 :: BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion3 :: BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion4 :: BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion5 :: BlockNodeToClientVersion (CardanoBlock c)
Documentation
protocolInfoCardano :: forall c m. (IOLike m, CardanoHardForkConstraints c) => ProtocolParamsByron -> ProtocolParamsShelley c Maybe -> ProtocolParamsAllegra c Maybe -> ProtocolParamsMary c Maybe -> ProtocolParamsTransition ByronBlock (ShelleyBlock (ShelleyEra c)) -> ProtocolParamsTransition (ShelleyBlock (ShelleyEra c)) (ShelleyBlock (AllegraEra c)) -> ProtocolParamsTransition (ShelleyBlock (AllegraEra c)) (ShelleyBlock (MaryEra c)) -> ProtocolInfo m (CardanoBlock c) Source #
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
| |
data ProtocolParamsAllegra c (f :: Type -> Type) Source #
Parameters needed to run Allegra
Constructors
| ProtocolParamsAllegra | |
Fields | |
data ProtocolParamsMary c (f :: Type -> Type) Source #
Parameters needed to run Mary
Constructors
| ProtocolParamsMary | |
Fields | |
protocolClientInfoCardano :: forall c. EpochSlots -> ProtocolClientInfo (CardanoBlock c) Source #
type CardanoHardForkConstraints c = (PraosCrypto c, ShelleyBasedEra (ShelleyEra c), ShelleyBasedEra (AllegraEra c), ShelleyBasedEra (MaryEra c), HASH c ~ Blake2b_256, ADDRHASH c ~ Blake2b_224, DSIGN c ~ Ed25519DSIGN) Source #
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.
Constructors
| MaxMajorProtVer | |
Fields | |
Instances
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
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 CardanoNodeToClientVersion3 :: BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled and the Shelley era enabled, but using
ShelleyNodeToClientVersion2 and HardForkSpecificNodeToClientVersion2.
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 # | |
| ShelleyBasedEra era => SerialiseConstraintsHFC (ShelleyBlock era) Source # | |
| 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 ( We encode a
For more details, see: https://github.com/input-output-hk/ouroboros-network/pull/1175#issuecomment-558147194 |
Methods encodeDiskHfcBlock :: CodecConfig (HardForkBlock (CardanoEras c)) -> HardForkBlock (CardanoEras c) -> Encoding Source # decodeDiskHfcBlock :: CodecConfig (HardForkBlock (CardanoEras c)) -> forall s. Decoder s (ByteString -> HardForkBlock (CardanoEras c)) Source # reconstructHfcPrefixLen :: proxy (Header (HardForkBlock (CardanoEras c))) -> PrefixLen Source # reconstructHfcNestedCtxt :: proxy (Header (HardForkBlock (CardanoEras c))) -> ShortByteString -> SizeInBytes -> SomeSecond (NestedCtxt Header) (HardForkBlock (CardanoEras c)) Source # getHfcBinaryBlockInfo :: HardForkBlock (CardanoEras c) -> BinaryBlockInfo Source # estimateHfcBlockSize :: Header (HardForkBlock (CardanoEras c)) -> SizeInBytes Source # | |
| CardanoHardForkConstraints c => SupportedNetworkProtocolVersion (CardanoBlock c) Source # | |
Methods supportedNodeToNodeVersions :: Proxy (CardanoBlock c) -> Map NodeToNodeVersion (BlockNodeToNodeVersion (CardanoBlock c)) Source # supportedNodeToClientVersions :: Proxy (CardanoBlock c) -> Map NodeToClientVersion (BlockNodeToClientVersion (CardanoBlock c)) Source # | |