Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Shelley.Node
Contents
Synopsis
- newtype MaxMajorProtVer = MaxMajorProtVer {}
- data ProtocolParamsShelleyBased c = ProtocolParamsShelleyBased {}
- data Nonce
- = Nonce !(Hash Blake2b_256 Nonce)
- | NeutralNonce
- data ProtVer = ProtVer {}
- data ShelleyGenesis = ShelleyGenesis {
- sgSystemStart ∷ !UTCTime
- sgNetworkMagic ∷ !Word32
- sgNetworkId ∷ !Network
- sgActiveSlotsCoeff ∷ !PositiveUnitInterval
- sgSecurityParam ∷ !(NonZero Word64)
- sgEpochLength ∷ !EpochSize
- sgSlotsPerKESPeriod ∷ !Word64
- sgMaxKESEvolutions ∷ !Word64
- sgSlotLength ∷ !NominalDiffTimeMicro
- sgUpdateQuorum ∷ !Word64
- sgMaxLovelaceSupply ∷ !Word64
- sgProtocolParams ∷ !(PParams ShelleyEra)
- sgGenDelegs ∷ !(Map (KeyHash 'Genesis) GenDelegPair)
- sgInitialFunds ∷ ListMap Addr Coin
- sgStaking ∷ ShelleyGenesisStaking
- data ShelleyGenesisStaking = ShelleyGenesisStaking {}
- emptyGenesisStaking ∷ ShelleyGenesisStaking
- data ShelleyLeaderCredentials c = ShelleyLeaderCredentials {}
- protocolClientInfoShelley ∷ ProtocolClientInfo (ShelleyBlock proto era)
- protocolInfoShelley ∷ (IOLike m, ShelleyCompatible (TPraos c) ShelleyEra, TxLimits (ShelleyBlock (TPraos c) ShelleyEra)) ⇒ ShelleyGenesis → ProtocolParamsShelleyBased c → ProtVer → (ProtocolInfo (ShelleyBlock (TPraos c) ShelleyEra), m [BlockForging m (ShelleyBlock (TPraos c) ShelleyEra)])
- protocolInfoTPraosShelleyBased ∷ ∀ m era c. (IOLike m, ShelleyCompatible (TPraos c) era, TxLimits (ShelleyBlock (TPraos c) era)) ⇒ ProtocolParamsShelleyBased c → TransitionConfig era → ProtVer → (ProtocolInfo (ShelleyBlock (TPraos c) era), m [BlockForging m (ShelleyBlock (TPraos c) era)])
- validateGenesis ∷ ShelleyGenesis → Either String ()
Documentation
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
Constructors
MaxMajorProtVer | |
Fields |
Instances
data ProtocolParamsShelleyBased c Source #
Parameters common to all Shelley-based ledgers.
When running a chain with multiple Shelley-based eras, in addition to the
per-era protocol parameters, one value of ProtocolParamsShelleyBased
will
be needed, which is shared among all Shelley-based eras.
Constructors
ProtocolParamsShelleyBased | |
Fields
|
Evolving nonce type.
Constructors
Nonce !(Hash Blake2b_256 Nonce) | |
NeutralNonce | Identity element |
Instances
FromJSON Nonce | |||||
ToJSON Nonce | |||||
FromCBOR Nonce | |||||
ToCBOR Nonce | |||||
DecCBOR Nonce | |||||
EncCBOR Nonce | |||||
NFData Nonce | |||||
Defined in Cardano.Ledger.BaseTypes | |||||
Generic Nonce | |||||
Defined in Cardano.Ledger.BaseTypes Associated Types
| |||||
Show Nonce | |||||
Eq Nonce | |||||
Ord Nonce | |||||
NoThunks Nonce | |||||
type Rep Nonce | |||||
Defined in Cardano.Ledger.BaseTypes type Rep Nonce = D1 ('MetaData "Nonce" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.17.0.0-77289d2491543e49ba265e9e82ae6a1425b4270a4bc8ca146d7209dffa15abb4" 'False) (C1 ('MetaCons "Nonce" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Hash Blake2b_256 Nonce))) :+: C1 ('MetaCons "NeutralNonce" 'PrefixI 'False) (U1 ∷ Type → Type)) |
Instances
FromJSON ProtVer | |||||
ToJSON ProtVer | |||||
FromCBOR ProtVer | |||||
ToCBOR ProtVer | |||||
DecCBOR ProtVer | |||||
EncCBOR ProtVer | |||||
DecCBORGroup ProtVer | |||||
Defined in Cardano.Ledger.BaseTypes Methods | |||||
EncCBORGroup ProtVer | |||||
ToPlutusData ProtVer | |||||
Defined in Cardano.Ledger.Plutus.ToPlutusData | |||||
NFData ProtVer | |||||
Defined in Cardano.Ledger.BaseTypes | |||||
Generic ProtVer | |||||
Defined in Cardano.Ledger.BaseTypes Associated Types
| |||||
Show ProtVer | |||||
Eq ProtVer | |||||
Ord ProtVer | |||||
NoThunks ProtVer | |||||
type Rep ProtVer | |||||
Defined in Cardano.Ledger.BaseTypes type Rep ProtVer = D1 ('MetaData "ProtVer" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.17.0.0-77289d2491543e49ba265e9e82ae6a1425b4270a4bc8ca146d7209dffa15abb4" 'False) (C1 ('MetaCons "ProtVer" 'PrefixI 'True) (S1 ('MetaSel ('Just "pvMajor") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Version) :*: S1 ('MetaSel ('Just "pvMinor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural))) |
data ShelleyGenesis Source #
Shelley genesis information
Note that this is needed only for a pure Shelley network, hence it being defined here rather than in its own module. In mainnet, Shelley will transition naturally from Byron, and thus will never have its own genesis information.
Constructors
ShelleyGenesis | |
Fields
|
Instances
FromJSON ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis Methods parseJSON ∷ Value → Parser ShelleyGenesis Source # | |||||
ToJSON ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis Methods toJSON ∷ ShelleyGenesis → Value Source # toEncoding ∷ ShelleyGenesis → Encoding Source # toJSONList ∷ [ShelleyGenesis] → Value Source # | |||||
FromCBOR ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis | |||||
ToCBOR ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis Methods toCBOR ∷ ShelleyGenesis → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ShelleyGenesis → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyGenesis] → Size Source # | |||||
DecCBOR ShelleyGenesis | Genesis are always encoded with the version of era they are defined in. | ||||
Defined in Cardano.Ledger.Shelley.Genesis | |||||
EncCBOR ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis Methods encCBOR ∷ ShelleyGenesis → Encoding Source # encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy ShelleyGenesis → Size Source # encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyGenesis] → Size Source # | |||||
Generic ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis Associated Types
| |||||
Show ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis Methods showsPrec ∷ Int → ShelleyGenesis → ShowS # show ∷ ShelleyGenesis → String # showList ∷ [ShelleyGenesis] → ShowS # | |||||
Eq ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis Methods (==) ∷ ShelleyGenesis → ShelleyGenesis → Bool # (/=) ∷ ShelleyGenesis → ShelleyGenesis → Bool # | |||||
NoThunks ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis | |||||
type Rep ShelleyGenesis | |||||
Defined in Cardano.Ledger.Shelley.Genesis type Rep ShelleyGenesis = D1 ('MetaData "ShelleyGenesis" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.16.0.0-c1008874f8b6847f8def90e1ee957acbea6233f4640506a80b63d2db757c701e" 'False) (C1 ('MetaCons "ShelleyGenesis" 'PrefixI 'True) (((S1 ('MetaSel ('Just "sgSystemStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTCTime) :*: (S1 ('MetaSel ('Just "sgNetworkMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word32) :*: S1 ('MetaSel ('Just "sgNetworkId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network))) :*: ((S1 ('MetaSel ('Just "sgActiveSlotsCoeff") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PositiveUnitInterval) :*: S1 ('MetaSel ('Just "sgSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 (NonZero Word64))) :*: (S1 ('MetaSel ('Just "sgEpochLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 EpochSize) :*: S1 ('MetaSel ('Just "sgSlotsPerKESPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64)))) :*: (((S1 ('MetaSel ('Just "sgMaxKESEvolutions") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgSlotLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTimeMicro)) :*: (S1 ('MetaSel ('Just "sgUpdateQuorum") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgMaxLovelaceSupply") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64))) :*: ((S1 ('MetaSel ('Just "sgProtocolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams ShelleyEra)) :*: S1 ('MetaSel ('Just "sgGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'Genesis) GenDelegPair))) :*: (S1 ('MetaSel ('Just "sgInitialFunds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap Addr Coin)) :*: S1 ('MetaSel ('Just "sgStaking") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShelleyGenesisStaking)))))) |
data ShelleyGenesisStaking Source #
Genesis Shelley staking configuration.
This allows us to configure some initial stake pools and delegation to them, in order to test Praos in a static configuration, without requiring on-chain registration and delegation.
For simplicity, pools defined in the genesis staking do not pay deposits for their registration.
Constructors
ShelleyGenesisStaking | |
Fields
|
Instances
FromJSON ShelleyGenesisStaking | |||||
Defined in Cardano.Ledger.Shelley.Genesis | |||||
ToJSON ShelleyGenesisStaking | |||||
Defined in Cardano.Ledger.Shelley.Genesis | |||||
DecCBOR ShelleyGenesisStaking | |||||
Defined in Cardano.Ledger.Shelley.Genesis | |||||
EncCBOR ShelleyGenesisStaking | |||||
Defined in Cardano.Ledger.Shelley.Genesis Methods encCBOR ∷ ShelleyGenesisStaking → Encoding Source # encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy ShelleyGenesisStaking → Size Source # encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyGenesisStaking] → Size Source # | |||||
Monoid ShelleyGenesisStaking | |||||
Semigroup ShelleyGenesisStaking | |||||
Generic ShelleyGenesisStaking | |||||
Defined in Cardano.Ledger.Shelley.Genesis Associated Types
Methods from ∷ ShelleyGenesisStaking → Rep ShelleyGenesisStaking x # | |||||
Show ShelleyGenesisStaking | |||||
Defined in Cardano.Ledger.Shelley.Genesis Methods showsPrec ∷ Int → ShelleyGenesisStaking → ShowS # show ∷ ShelleyGenesisStaking → String # showList ∷ [ShelleyGenesisStaking] → ShowS # | |||||
Eq ShelleyGenesisStaking | |||||
Defined in Cardano.Ledger.Shelley.Genesis Methods (==) ∷ ShelleyGenesisStaking → ShelleyGenesisStaking → Bool # (/=) ∷ ShelleyGenesisStaking → ShelleyGenesisStaking → Bool # | |||||
NoThunks ShelleyGenesisStaking | |||||
Defined in Cardano.Ledger.Shelley.Genesis | |||||
type Rep ShelleyGenesisStaking | |||||
Defined in Cardano.Ledger.Shelley.Genesis type Rep ShelleyGenesisStaking = D1 ('MetaData "ShelleyGenesisStaking" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.16.0.0-c1008874f8b6847f8def90e1ee957acbea6233f4640506a80b63d2db757c701e" 'False) (C1 ('MetaCons "ShelleyGenesisStaking" 'PrefixI 'True) (S1 ('MetaSel ('Just "sgsPools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'StakePool) PoolParams)) :*: S1 ('MetaSel ('Just "sgsStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'Staking) (KeyHash 'StakePool))))) |
emptyGenesisStaking ∷ ShelleyGenesisStaking Source #
Empty genesis staking
data ShelleyLeaderCredentials c Source #
Constructors
ShelleyLeaderCredentials | |
Fields
|
protocolClientInfoShelley ∷ ProtocolClientInfo (ShelleyBlock proto era) Source #
protocolInfoShelley ∷ (IOLike m, ShelleyCompatible (TPraos c) ShelleyEra, TxLimits (ShelleyBlock (TPraos c) ShelleyEra)) ⇒ ShelleyGenesis → ProtocolParamsShelleyBased c → ProtVer → (ProtocolInfo (ShelleyBlock (TPraos c) ShelleyEra), m [BlockForging m (ShelleyBlock (TPraos c) ShelleyEra)]) Source #
protocolInfoTPraosShelleyBased Source #
Arguments
∷ ∀ m era c. (IOLike m, ShelleyCompatible (TPraos c) era, TxLimits (ShelleyBlock (TPraos c) era)) | |
⇒ ProtocolParamsShelleyBased c | |
→ TransitionConfig era | |
→ ProtVer | see |
→ (ProtocolInfo (ShelleyBlock (TPraos c) era), m [BlockForging m (ShelleyBlock (TPraos c) era)]) |
validateGenesis ∷ ShelleyGenesis → Either String () Source #
Check the validity of the genesis config. To be used in conjunction with
assertWithMsg
.
Orphan instances
ShelleyCompatible proto era ⇒ BlockSupportsMetrics (ShelleyBlock proto era) Source # | |
Methods isSelfIssued ∷ BlockConfig (ShelleyBlock proto era) → Header (ShelleyBlock proto era) → WhetherSelfIssued Source # | |
ConsensusProtocol proto ⇒ BlockSupportsSanityCheck (ShelleyBlock proto era) Source # | |
Methods configAllSecurityParams ∷ TopLevelConfig (ShelleyBlock proto era) → NonEmpty SecurityParam Source # | |
(ShelleyCompatible proto era, LedgerSupportsProtocol (ShelleyBlock proto era), BlockSupportsSanityCheck (ShelleyBlock proto era), TxLimits (ShelleyBlock proto era), SerialiseNodeToClientConstraints (ShelleyBlock proto era), Crypto (ProtoCrypto proto)) ⇒ RunNode (ShelleyBlock proto era) Source # | |