Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Cardano.Node
Synopsis
- type CardanoHardForkConstraints c = (PraosCrypto c, PraosCrypto c, TranslateProto (TPraos c) (Praos c), ShelleyCompatible (TPraos c) (ShelleyEra c), LedgerSupportsProtocol (ShelleyBlock (TPraos c) (ShelleyEra c)), ShelleyCompatible (TPraos c) (AllegraEra c), LedgerSupportsProtocol (ShelleyBlock (TPraos c) (AllegraEra c)), ShelleyCompatible (TPraos c) (MaryEra c), LedgerSupportsProtocol (ShelleyBlock (TPraos c) (MaryEra c)), ShelleyCompatible (TPraos c) (AlonzoEra c), LedgerSupportsProtocol (ShelleyBlock (TPraos c) (AlonzoEra c)), ShelleyCompatible (Praos c) (BabbageEra c), LedgerSupportsProtocol (ShelleyBlock (Praos c) (BabbageEra c)), HASH c ~ Blake2b_256, ADDRHASH c ~ Blake2b_224, DSIGN c ~ Ed25519DSIGN)
- newtype MaxMajorProtVer = MaxMajorProtVer {}
- data ProtocolParamsAllegra c = ProtocolParamsAllegra {}
- data ProtocolParamsMary c = ProtocolParamsMary {}
- data ProtocolTransitionParamsShelleyBased era = ProtocolTransitionParamsShelleyBased {
- transitionTranslationContext ∷ TranslationContext era
- transitionTrigger ∷ TriggerHardFork
- data TriggerHardFork
- protocolClientInfoCardano ∷ ∀ c. EpochSlots → ProtocolClientInfo (CardanoBlock c)
- protocolInfoCardano ∷ ∀ c m. (IOLike m, CardanoHardForkConstraints c) ⇒ ProtocolParamsByron → ProtocolParamsShelleyBased (ShelleyEra c) → ProtocolParamsShelley c → ProtocolParamsAllegra c → ProtocolParamsMary c → ProtocolParamsAlonzo c → ProtocolParamsBabbage c → ProtocolTransitionParamsShelleyBased (ShelleyEra c) → ProtocolTransitionParamsShelleyBased (AllegraEra c) → ProtocolTransitionParamsShelleyBased (MaryEra c) → ProtocolTransitionParamsShelleyBased (AlonzoEra c) → ProtocolTransitionParamsShelleyBased (BabbageEra c) → ProtocolInfo m (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)
- pattern CardanoNodeToClientVersion6 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion7 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion8 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion9 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToNodeVersion1 ∷ BlockNodeToNodeVersion (CardanoBlock c)
- pattern CardanoNodeToNodeVersion2 ∷ BlockNodeToNodeVersion (CardanoBlock c)
- pattern CardanoNodeToNodeVersion3 ∷ BlockNodeToNodeVersion (CardanoBlock c)
- pattern CardanoNodeToNodeVersion4 ∷ BlockNodeToNodeVersion (CardanoBlock c)
- pattern CardanoNodeToNodeVersion5 ∷ BlockNodeToNodeVersion (CardanoBlock c)
- pattern CardanoNodeToNodeVersion6 ∷ BlockNodeToNodeVersion (CardanoBlock c)
Documentation
type CardanoHardForkConstraints c = (PraosCrypto c, PraosCrypto c, TranslateProto (TPraos c) (Praos c), ShelleyCompatible (TPraos c) (ShelleyEra c), LedgerSupportsProtocol (ShelleyBlock (TPraos c) (ShelleyEra c)), ShelleyCompatible (TPraos c) (AllegraEra c), LedgerSupportsProtocol (ShelleyBlock (TPraos c) (AllegraEra c)), ShelleyCompatible (TPraos c) (MaryEra c), LedgerSupportsProtocol (ShelleyBlock (TPraos c) (MaryEra c)), ShelleyCompatible (TPraos c) (AlonzoEra c), LedgerSupportsProtocol (ShelleyBlock (TPraos c) (AlonzoEra c)), ShelleyCompatible (Praos c) (BabbageEra c), LedgerSupportsProtocol (ShelleyBlock (Praos c) (BabbageEra 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
Eq MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common Methods | |
Show MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common | |
Generic MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common Methods from ∷ MaxMajorProtVer → Rep MaxMajorProtVer x Source # to ∷ Rep MaxMajorProtVer x → MaxMajorProtVer Source # | |
NoThunks MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common Methods noThunks ∷ Context → MaxMajorProtVer → IO (Maybe ThunkInfo) # wNoThunks ∷ Context → MaxMajorProtVer → IO (Maybe ThunkInfo) # | |
type Rep MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common type Rep MaxMajorProtVer = D1 ('MetaData "MaxMajorProtVer" "Ouroboros.Consensus.Protocol.Praos.Common" "ouroboros-consensus-protocol-0.1.0.0-inplace" 'True) (C1 ('MetaCons "MaxMajorProtVer" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMaxMajorProtVer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural))) |
data ProtocolParamsAllegra c Source #
Parameters needed to run Allegra
Constructors
ProtocolParamsAllegra | |
Fields |
data ProtocolParamsMary c Source #
Parameters needed to run Mary
Constructors
ProtocolParamsMary | |
Fields
|
data ProtocolTransitionParamsShelleyBased era Source #
Parameters needed to transition to a Shelley era.
Constructors
ProtocolTransitionParamsShelleyBased | |
Fields
|
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. Note: The HFC logic does not require the trigger version for one era to be the successor of the trigger version for the previous era. |
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
protocolClientInfoCardano ∷ ∀ c. EpochSlots → ProtocolClientInfo (CardanoBlock c) Source #
protocolInfoCardano ∷ ∀ c m. (IOLike m, CardanoHardForkConstraints c) ⇒ ProtocolParamsByron → ProtocolParamsShelleyBased (ShelleyEra c) → ProtocolParamsShelley c → ProtocolParamsAllegra c → ProtocolParamsMary c → ProtocolParamsAlonzo c → ProtocolParamsBabbage c → ProtocolTransitionParamsShelleyBased (ShelleyEra c) → ProtocolTransitionParamsShelleyBased (AllegraEra c) → ProtocolTransitionParamsShelleyBased (MaryEra c) → ProtocolTransitionParamsShelleyBased (AlonzoEra c) → ProtocolTransitionParamsShelleyBased (BabbageEra c) → ProtocolInfo m (CardanoBlock c) Source #
Create a ProtocolInfo
for CardanoBlock
NOTE: the initial staking and funds in the ShelleyGenesis
are ignored,
unless configured to skip the Byron era and hard fork to Shelley or a later
era from the start using TriggerHardForkAtEpoch 0
for testing purposes.
PRECONDITION: only a single set of Shelley credentials is allowed when used
for mainnet (check against
).gNetworkId
shelleyBasedGenesis
SupportedNetworkProtocolVersion
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
.
pattern CardanoNodeToClientVersion6 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, and Mary eras enabled, but
using ShelleyNodeToClientVersion3
for the Shelley-based eras , which
enables new queries.
pattern CardanoNodeToClientVersion7 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, Mary and Alonzo eras enabled
pattern CardanoNodeToClientVersion8 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, Mary and Alonzo eras enabled
Using ShelleyNodeToClientVersion5
for the Shelley-based eras , which
enables new queries.
pattern CardanoNodeToClientVersion9 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
eras enabled Using ShelleyNodeToClientVersion5
for the Shelley-based eras,
which enables new queries.
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 CardanoNodeToNodeVersion5 ∷ BlockNodeToNodeVersion (CardanoBlock c) Source #
The hard fork enabled with the latest Byron version, the Shelley, Allegra, Mary and Alonzo eras enabled.
pattern CardanoNodeToNodeVersion6 ∷ BlockNodeToNodeVersion (CardanoBlock c) Source #
The hard fork enabled with the latest Byron version, the Shelley, Allegra, Mary, Alonzo and Babbage eras enabled.
Orphan instances
SerialiseConstraintsHFC ByronBlock 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)) → ∀ 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 # latestReleasedNodeVersion ∷ Proxy (CardanoBlock c) → (Maybe NodeToNodeVersion, Maybe NodeToClientVersion) Source # |