Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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)), ShelleyCompatible (Praos c) (ConwayEra c), LedgerSupportsProtocol (ShelleyBlock (Praos c) (ConwayEra c)), HASH c ~ Blake2b_256, ADDRHASH c ~ Blake2b_224, DSIGN c ~ Ed25519DSIGN)
- data CardanoHardForkTrigger blk
- newtype CardanoHardForkTriggers where
- CardanoHardForkTriggers { }
- pattern CardanoHardForkTriggers' ∷ c ~ StandardCrypto ⇒ CardanoHardForkTrigger (ShelleyBlock (TPraos c) (ShelleyEra c)) → CardanoHardForkTrigger (ShelleyBlock (TPraos c) (AllegraEra c)) → CardanoHardForkTrigger (ShelleyBlock (TPraos c) (MaryEra c)) → CardanoHardForkTrigger (ShelleyBlock (TPraos c) (AlonzoEra c)) → CardanoHardForkTrigger (ShelleyBlock (Praos c) (BabbageEra c)) → CardanoHardForkTrigger (ShelleyBlock (Praos c) (ConwayEra c)) → CardanoHardForkTriggers
- data CardanoProtocolParams c = CardanoProtocolParams {}
- newtype MaxMajorProtVer = MaxMajorProtVer {}
- data TriggerHardFork
- protocolClientInfoCardano ∷ ∀ c. EpochSlots → ProtocolClientInfo (CardanoBlock c)
- protocolInfoCardano ∷ ∀ c m. (IOLike m, CardanoHardForkConstraints c) ⇒ CardanoProtocolParams c → (ProtocolInfo (CardanoBlock c), m [BlockForging m (CardanoBlock c)])
- pattern CardanoNodeToClientVersion1 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion10 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion11 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion12 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion13 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion14 ∷ BlockNodeToClientVersion (CardanoBlock c)
- pattern CardanoNodeToClientVersion15 ∷ 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)
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)), ShelleyCompatible (Praos c) (ConwayEra c), LedgerSupportsProtocol (ShelleyBlock (Praos c) (ConwayEra c)), HASH c ~ Blake2b_256, ADDRHASH c ~ Blake2b_224, DSIGN c ~ Ed25519DSIGN) Source #
data CardanoHardForkTrigger blk Source #
When to trigger a hard fork to a Cardano era.
CardanoTriggerHardForkAtDefaultVersion | Trigger the hard fork when the ledger protocol version is updated to
the default for that era ( |
CardanoTriggerHardForkAtEpoch EpochNo | Trigger the hard fork at the given epoch. For testing only. Also see
|
Instances
Show (CardanoHardForkTrigger blk) Source # | |
Defined in Ouroboros.Consensus.Cardano.Node showsPrec ∷ Int → CardanoHardForkTrigger blk → ShowS # show ∷ CardanoHardForkTrigger blk → String # showList ∷ [CardanoHardForkTrigger blk] → ShowS # |
newtype CardanoHardForkTriggers Source #
pattern CardanoHardForkTriggers' ∷ c ~ StandardCrypto ⇒ CardanoHardForkTrigger (ShelleyBlock (TPraos c) (ShelleyEra c)) → CardanoHardForkTrigger (ShelleyBlock (TPraos c) (AllegraEra c)) → CardanoHardForkTrigger (ShelleyBlock (TPraos c) (MaryEra c)) → CardanoHardForkTrigger (ShelleyBlock (TPraos c) (AlonzoEra c)) → CardanoHardForkTrigger (ShelleyBlock (Praos c) (BabbageEra c)) → CardanoHardForkTrigger (ShelleyBlock (Praos c) (ConwayEra c)) → CardanoHardForkTriggers |
data CardanoProtocolParams c Source #
Parameters needed to run Cardano.
On the relation between cardanoHardForkTriggers
and cardanoProtocolVersion
:
The cardanoHardForkTriggers
can mention ledger protocol
version versions at which the hard fork will occur. In principle
there is no relation between the versions mentioned in
cardanoProtocolVerson
(if any) and cardanoHardForkTriggers
,
however their relationship might indicate experimental eras or
intra-era hard forks. For instance if the last era in the
CardanoHardForkTriggers
is set to 9 0
, ie:
... :* TriggerHardForkAtVersion (ProtVer (SL.natVersion @9) 0)
Setting cardanoProtocolVersion
to ProtVer (SL.natVersion
8) 0
will mark that last era as experimental because the obsolete node
checks determine that the highest version we support is
8 0@.
If, on the other hand, we would set cardanoProtocolVersion
to
ProtVer (SL.natVersion
10) 0, this indicates that the node is
ready to perform an intra-era hardfork (from version
9 to version
10@).
CardanoProtocolParams | |
|
newtype MaxMajorProtVer Source #
The maximum major protocol version.
This refers to the largest ledger version that this node supports.
Once the ledger protocol version (as reported by the ledger state)
exceeds this version we will consider all blocks invalid. This is
called the "obsolete node check" (see the ObsoleteNode
error
constructor).
Major ledger protocol versions are used to trigger both intra and inter era hard forks, which can potentially change the set of ledger rules that are applied.
Minor ledger protocol versions were intended to signal soft forks but they're currently unused, and they're irrelevant for the consensus logic.
For Cardano mainnet, the Shelley era has major protocol version 2. For more details, see this table
Instances
data TriggerHardFork Source #
The trigger condition that will cause the hard fork transition.
This type is only intended for use as part of a
LedgerCfg
, which means it is "static":
it cannot change during an execution of the node process.
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. |
TriggerHardForkNotDuringThisExecution | Ledger states in this era cannot determine when the hard fork transition will happen. It's crucial to note that this option does not imply that "the era will never end". Instead, the era cannot end within this node process before it restarts with different software and/or configuration for this era. |
Instances
protocolClientInfoCardano ∷ ∀ c. EpochSlots → ProtocolClientInfo (CardanoBlock c) Source #
protocolInfoCardano ∷ ∀ c m. (IOLike m, CardanoHardForkConstraints c) ⇒ CardanoProtocolParams c → (ProtocolInfo (CardanoBlock c), m [BlockForging m (CardanoBlock c)]) Source #
Create a ProtocolInfo
for CardanoBlock
NOTE: For testing and benchmarking purposes, the genesis config can contain
certain data to be registered in the initial ledger state, like initial
staking and funds. These are registered only if the given
CardanoHardForkTriggers
tell us to skip the Byron era and hard fork
directly to Shelley or a later era by using TestXHardForkAtEpoch 0
. When
, no such data must be present.gNetworkId
== Mainnet
PRECONDITION: only a single set of Shelley credentials is allowed when used
for mainnet (check against
).gNetworkId
== Mainnet
SupportedNetworkProtocolVersion
pattern CardanoNodeToClientVersion1 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
We support the sole Byron version with the hard fork disabled.
pattern CardanoNodeToClientVersion10 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
eras enabled Using ShelleyNodeToClientVersion6
for the Shelley-based eras,
which enables new queries.
pattern CardanoNodeToClientVersion11 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
eras enabled, using ShelleyNodeToClientVersion7
for the Shelley-based eras,
which enables new queries.
pattern CardanoNodeToClientVersion12 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
and Conway eras enabled, using ShelleyNodeToClientVersion8
for the
Shelley-based eras.
pattern CardanoNodeToClientVersion13 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
and Conway eras enabled, using ShelleyNodeToClientVersion9
for the
Shelley-based eras.
pattern CardanoNodeToClientVersion14 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
and Conway eras enabled, using ShelleyNodeToClientVersion10
for the
Shelley-based eras.
pattern CardanoNodeToClientVersion15 ∷ BlockNodeToClientVersion (CardanoBlock c) Source #
The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage
and Conway eras enabled, using ShelleyNodeToClientVersion11
for the
Shelley-based eras.
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 using the latest version of Byron and Shelley for each Byron and Shelley era.
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/IntersectMBO/ouroboros-network/pull/1175#issuecomment-558147194 |
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 # | |
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 # |