ouroboros-consensus-shelley-0.1.0.0: Shelley ledger integration in the Ouroboros consensus layer
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Shelley.Node.TPraos

Synopsis

Documentation

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 

Instances

Instances details
Eq MaxMajorProtVer 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Show MaxMajorProtVer 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Generic MaxMajorProtVer 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Associated Types

type Rep MaxMajorProtVerTypeType Source #

NoThunks MaxMajorProtVer 
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Methods

noThunks ∷ Context → MaxMajorProtVerIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → MaxMajorProtVerIO (Maybe ThunkInfo) #

showTypeOfProxy MaxMajorProtVerString #

type Rep MaxMajorProtVer 
Instance details

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 ProtocolParamsMary c Source #

Parameters needed to run Mary

data ProtocolParamsShelleyBased era 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.

The era parameter determines from which era the genesis config will be used.

Constructors

ProtocolParamsShelleyBased 

Fields

data Nonce #

Constructors

Nonce !(Hash Blake2b_256 Nonce) 
NeutralNonce 

Instances

Instances details
Eq Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

(==)NonceNonceBool Source #

(/=)NonceNonceBool Source #

Ord Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

compareNonceNonceOrdering Source #

(<)NonceNonceBool Source #

(<=)NonceNonceBool Source #

(>)NonceNonceBool Source #

(>=)NonceNonceBool Source #

maxNonceNonceNonce Source #

minNonceNonceNonce Source #

Show Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Generic Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Associated Types

type Rep NonceTypeType Source #

Methods

fromNonceRep Nonce x Source #

toRep Nonce x → Nonce Source #

NFData Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

rnfNonce → () Source #

NoThunks Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

noThunks ∷ Context → NonceIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → NonceIO (Maybe ThunkInfo) #

showTypeOfProxy NonceString #

FromCBOR Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

fromCBOR ∷ Decoder s Nonce

labelProxy NonceText

ToCBOR Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

toCBORNonce → Encoding

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Nonce → Size

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Nonce] → Size

FromJSON Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

parseJSON ∷ Value → Parser Nonce

parseJSONList ∷ Value → Parser [Nonce]

ToJSON Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

toJSONNonce → Value

toEncodingNonce → Encoding

toJSONList ∷ [Nonce] → Value

toEncodingList ∷ [Nonce] → Encoding

type Rep Nonce 
Instance details

Defined in Cardano.Ledger.BaseTypes

type Rep Nonce = D1 ('MetaData "Nonce" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-0.1.1.2-0f8a384d5c98b60ea20a3fdc9d9da2de15571cb84b902840358c204c9e610d93" 'False) (C1 ('MetaCons "Nonce" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Hash Blake2b_256 Nonce))) :+: C1 ('MetaCons "NeutralNonce" 'PrefixI 'False) (U1TypeType))

data ProtVer #

Constructors

ProtVer 

Fields

Instances

Instances details
Eq ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

(==)ProtVerProtVerBool Source #

(/=)ProtVerProtVerBool Source #

Ord ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Show ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Generic ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Associated Types

type Rep ProtVerTypeType Source #

Methods

fromProtVerRep ProtVer x Source #

toRep ProtVer x → ProtVer Source #

NFData ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

rnfProtVer → () Source #

NoThunks ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

noThunks ∷ Context → ProtVerIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ProtVerIO (Maybe ThunkInfo) #

showTypeOfProxy ProtVerString #

FromCBOR ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

fromCBOR ∷ Decoder s ProtVer

labelProxy ProtVerText

ToCBOR ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

toCBORProtVer → Encoding

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ProtVer → Size

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ProtVer] → Size

ToCBORGroup ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

toCBORGroupProtVer → Encoding

encodedGroupSizeExpr ∷ (∀ x. ToCBOR x ⇒ Proxy x → Size) → Proxy ProtVer → Size

listLenProtVerWord

listLenBoundProxy ProtVerWord

FromCBORGroup ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

fromCBORGroup ∷ Decoder s ProtVer

FromJSON ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

parseJSON ∷ Value → Parser ProtVer

parseJSONList ∷ Value → Parser [ProtVer]

ToJSON ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

toJSONProtVer → Value

toEncodingProtVer → Encoding

toJSONList ∷ [ProtVer] → Value

toEncodingList ∷ [ProtVer] → Encoding

HasField "_protocolVersion" (RewardSnapShot crypto) ProtVer 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

getField ∷ RewardSnapShot crypto → ProtVer Source #

HasField "_protocolVersion" (FreeVars crypto) ProtVer 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

getField ∷ FreeVars crypto → ProtVer Source #

type Rep ProtVer 
Instance details

Defined in Cardano.Ledger.BaseTypes

type Rep ProtVer = D1 ('MetaData "ProtVer" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-0.1.1.2-0f8a384d5c98b60ea20a3fdc9d9da2de15571cb84b902840358c204c9e610d93" 'False) (C1 ('MetaCons "ProtVer" 'PrefixI 'True) (S1 ('MetaSel ('Just "pvMajor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "pvMinor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)))

data ShelleyGenesis era #

Constructors

ShelleyGenesis 

Fields

Instances

Instances details
Eq (ShelleyGenesis era) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Show (ShelleyGenesis era) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Generic (ShelleyGenesis era) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Associated Types

type Rep (ShelleyGenesis era) ∷ TypeType Source #

Methods

fromShelleyGenesis era → Rep (ShelleyGenesis era) x Source #

toRep (ShelleyGenesis era) x → ShelleyGenesis era Source #

Era era ⇒ NoThunks (ShelleyGenesis era) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

noThunks ∷ Context → ShelleyGenesis era → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ShelleyGenesis era → IO (Maybe ThunkInfo) #

showTypeOfProxy (ShelleyGenesis era) → String #

Era era ⇒ FromCBOR (ShelleyGenesis era) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

fromCBOR ∷ Decoder s (ShelleyGenesis era)

labelProxy (ShelleyGenesis era) → Text

Era era ⇒ ToCBOR (ShelleyGenesis era) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

toCBORShelleyGenesis era → Encoding

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (ShelleyGenesis era) → Size

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyGenesis era] → Size

Era era ⇒ FromJSON (ShelleyGenesis era) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

parseJSON ∷ Value → Parser (ShelleyGenesis era)

parseJSONList ∷ Value → Parser [ShelleyGenesis era]

Era era ⇒ ToJSON (ShelleyGenesis era) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

toJSONShelleyGenesis era → Value

toEncodingShelleyGenesis era → Encoding

toJSONList ∷ [ShelleyGenesis era] → Value

toEncodingList ∷ [ShelleyGenesis era] → Encoding

type Rep (ShelleyGenesis era) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep (ShelleyGenesis era) = D1 ('MetaData "ShelleyGenesis" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-0.1.1.2-0e735aaf8a56222f339701801a898301e7ec3ea862efab2af23989b88b36137d" '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 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 NominalDiffTime)) :*: (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 (ShelleyPParams era)) :*: S1 ('MetaSel ('Just "sgGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'Genesis (Crypto era)) (GenDelegPair (Crypto era))))) :*: (S1 ('MetaSel ('Just "sgInitialFunds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (Addr (Crypto era)) Coin)) :*: S1 ('MetaSel ('Just "sgStaking") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ShelleyGenesisStaking (Crypto era))))))))
type TranslationError (AllegraEra c) ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Allegra.Translation

type TranslationError (AllegraEra c) ShelleyGenesis = Void
type TranslationError (AlonzoEra c) ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Alonzo.Translation

type TranslationError (AlonzoEra c) ShelleyGenesis = Void
type TranslationError (MaryEra c) ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Mary.Translation

type TranslationError (MaryEra c) ShelleyGenesis = Void
type TranslationError (BabbageEra c) ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Babbage.Translation

type TranslationError (BabbageEra c) ShelleyGenesis = Void

data ShelleyGenesisStaking crypto #

Constructors

ShelleyGenesisStaking 

Fields

  • sgsPools ∷ ListMap (KeyHash 'StakePool crypto) (PoolParams crypto)
     
  • sgsStake ∷ ListMap (KeyHash 'Staking crypto) (KeyHash 'StakePool crypto)
     

Instances

Instances details
Eq (ShelleyGenesisStaking crypto) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Show (ShelleyGenesisStaking crypto) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Generic (ShelleyGenesisStaking crypto) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Associated Types

type Rep (ShelleyGenesisStaking crypto) ∷ TypeType Source #

NoThunks (ShelleyGenesisStaking crypto) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

noThunks ∷ Context → ShelleyGenesisStaking crypto → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ShelleyGenesisStaking crypto → IO (Maybe ThunkInfo) #

showTypeOfProxy (ShelleyGenesisStaking crypto) → String #

Crypto crypto ⇒ FromCBOR (ShelleyGenesisStaking crypto) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

fromCBOR ∷ Decoder s (ShelleyGenesisStaking crypto)

labelProxy (ShelleyGenesisStaking crypto) → Text

Crypto crypto ⇒ ToCBOR (ShelleyGenesisStaking crypto) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

toCBORShelleyGenesisStaking crypto → Encoding

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (ShelleyGenesisStaking crypto) → Size

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyGenesisStaking crypto] → Size

Crypto crypto ⇒ FromJSON (ShelleyGenesisStaking crypto) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

parseJSON ∷ Value → Parser (ShelleyGenesisStaking crypto)

parseJSONList ∷ Value → Parser [ShelleyGenesisStaking crypto]

Crypto crypto ⇒ ToJSON (ShelleyGenesisStaking crypto) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

toJSONShelleyGenesisStaking crypto → Value

toEncodingShelleyGenesisStaking crypto → Encoding

toJSONList ∷ [ShelleyGenesisStaking crypto] → Value

toEncodingList ∷ [ShelleyGenesisStaking crypto] → Encoding

type Rep (ShelleyGenesisStaking crypto) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep (ShelleyGenesisStaking crypto) = D1 ('MetaData "ShelleyGenesisStaking" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-0.1.1.2-0e735aaf8a56222f339701801a898301e7ec3ea862efab2af23989b88b36137d" 'False) (C1 ('MetaCons "ShelleyGenesisStaking" 'PrefixI 'True) (S1 ('MetaSel ('Just "sgsPools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'StakePool crypto) (PoolParams crypto))) :*: S1 ('MetaSel ('Just "sgsStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'Staking crypto) (KeyHash 'StakePool crypto)))))

data ShelleyLeaderCredentials c Source #

Constructors

ShelleyLeaderCredentials 

Fields

protocolInfoTPraosShelleyBased ∷ ∀ m era c. (IOLike m, PraosCrypto c, ShelleyCompatible (TPraos c) era, TxLimits (ShelleyBlock (TPraos c) era), c ~ EraCrypto era) ⇒ ProtocolParamsShelleyBased era → TranslationContext era → ProtVerOverrides (ShelleyBlock (TPraos c) era) → ProtocolInfo m (ShelleyBlock (TPraos c) era) Source #

registerGenesisStaking ∷ ∀ era. ShelleyBasedEra era ⇒ ShelleyGenesisStaking (EraCrypto era) → NewEpochState era → NewEpochState era Source #

Register the initial staking information in the NewEpochState.

HERE BE DRAGONS! This function is intended to help in testing.

In production, the genesis should not contain any initial staking.

Any existing staking information is overridden, but the UTxO is left untouched.

TODO adapt and reuse registerGenesisStaking from cardano-ledger-specs.

registerInitialFunds ∷ ∀ era. (ShelleyBasedEra era, HasCallStack) ⇒ Map (Addr (EraCrypto era)) Coin → NewEpochState era → NewEpochState era Source #

Register the initial funds in the NewEpochState.

HERE BE DRAGONS! This function is intended to help in testing.

In production, the genesis should not contain any initial funds.

The given funds are added to the existing UTxO.

PRECONDITION: the given funds must not be part of the existing UTxO. > forall (addr, _) in initialFunds. > Map.notElem (SL.initialFundsPseudoTxIn addr) existingUTxO

PROPERTY: > genesisUTxO genesis > == genesisUTxO' (sgInitialFunds genesis) > == extractUTxO (registerInitialFunds (sgInitialFunds genesis) > NewEpochState)

TODO move to cardano-ledger-specs.

shelleyBlockForging ∷ ∀ m era c. (ShelleyCompatible (TPraos c) era, PraosCrypto c, c ~ EraCrypto era, TxLimits (ShelleyBlock (TPraos c) era), IOLike m) ⇒ TPraosParamsOverrides (ShelleyBlock (TPraos c) era) → ShelleyLeaderCredentials (EraCrypto era) → m (BlockForging m (ShelleyBlock (TPraos c) era)) Source #

Create a BlockForging record for a single era.

In case the same credentials should be shared across multiple Shelley-based eras, use shelleySharedBlockForging.

shelleySharedBlockForging ∷ ∀ m c era. (PraosCrypto c, ShelleyEraWithCrypto c (TPraos c) era, IOLike m) ⇒ HotKey c m → (SlotNo → KESPeriod) → ShelleyLeaderCredentials c → Overrides (ShelleyBlock (TPraos c) era) → BlockForging m (ShelleyBlock (TPraos c) era) Source #

Create a BlockForging record safely using a given Hotkey.

The name of the era (separated by a _) will be appended to each forgeLabel.

validateGenesisShelleyBasedEra era ⇒ ShelleyGenesis era → Either String () Source #

Check the validity of the genesis config. To be used in conjunction with assertWithMsg.