cardano-protocol-tpraos-1.4.0.0: Cardano Protocol: Transitional Praos
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Protocol.TPraos.API

Description

Integration between the Shelley ledger and its corresponding (Transitional Praos) protocol.

In particular, this code supports extracting the components of the ledger state needed for protocol execution, both now and in a 2k-slot window.

Synopsis

Documentation

class (Crypto c, Signable (KES c) (BHBody c), Signable (VRF c) Seed) ⇒ PraosCrypto c Source #

Instances

Instances details
PraosCrypto StandardCrypto Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

class (STS (EraRule "TICKF" era), BaseM (EraRule "TICKF" era) ~ ShelleyBase, Environment (EraRule "TICKF" era) ~ (), State (EraRule "TICKF" era) ~ NewEpochState era, Signal (EraRule "TICKF" era) ~ SlotNo, EraGov era) ⇒ GetLedgerView era where Source #

Minimal complete definition

Nothing

Instances

Instances details
GetLedgerView AllegraEra Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

GetLedgerView AlonzoEra Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

GetLedgerView BabbageEra Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

GetLedgerView ConwayEra Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

GetLedgerView MaryEra Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

GetLedgerView ShelleyEra Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

data LedgerView Source #

Data required by the Transitional Praos protocol from the Shelley ledger.

Instances

Instances details
Generic LedgerView Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

Associated Types

type Rep LedgerViewTypeType Source #

Show LedgerView Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

Eq LedgerView Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

NoThunks LedgerView Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

type Rep LedgerView Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

type Rep LedgerView = D1 ('MetaData "LedgerView" "Cardano.Protocol.TPraos.API" "cardano-protocol-tpraos-1.4.0.0-inplace" 'False) (C1 ('MetaCons "LedgerView" 'PrefixI 'True) ((S1 ('MetaSel ('Just "lvD") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UnitInterval) :*: S1 ('MetaSel ('Just "lvExtraEntropy") 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Nonce)) :*: (S1 ('MetaSel ('Just "lvPoolDistr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PoolDistr) :*: (S1 ('MetaSel ('Just "lvGenDelegs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 GenDelegs) :*: S1 ('MetaSel ('Just "lvChainChecks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ChainChecksPParams)))))

mkInitialShelleyLedgerViewFromByronTranslationContextLedgerView Source #

We construct a LedgerView using the Shelley genesis config in the same way as translateToShelleyLedgerState.

Chain state operations

The chain state is an amalgam of the protocol state and the ticked nonce.

data ChainDepState Source #

Constructors

ChainDepState 

Fields

Instances

Instances details
Generic ChainDepState Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

Associated Types

type Rep ChainDepStateTypeType Source #

Show ChainDepState Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

FromCBOR ChainDepState Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

ToCBOR ChainDepState Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

DecCBOR ChainDepState Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

EncCBOR ChainDepState Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

Eq ChainDepState Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

NoThunks ChainDepState Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

type Rep ChainDepState Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

type Rep ChainDepState = D1 ('MetaData "ChainDepState" "Cardano.Protocol.TPraos.API" "cardano-protocol-tpraos-1.4.0.0-inplace" 'False) (C1 ('MetaCons "ChainDepState" 'PrefixI 'True) (S1 ('MetaSel ('Just "csProtocol") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PrtclState) :*: (S1 ('MetaSel ('Just "csTickn") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TicknState) :*: S1 ('MetaSel ('Just "csLabNonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce))))

newtype ChainTransitionError c Source #

Instances

Instances details
Generic (ChainTransitionError c) Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

Associated Types

type Rep (ChainTransitionError c) ∷ TypeType Source #

Crypto c ⇒ Show (ChainTransitionError c) Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

Crypto c ⇒ Eq (ChainTransitionError c) Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

Crypto c ⇒ NoThunks (ChainTransitionError c) Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

type Rep (ChainTransitionError c) Source # 
Instance details

Defined in Cardano.Protocol.TPraos.API

type Rep (ChainTransitionError c) = D1 ('MetaData "ChainTransitionError" "Cardano.Protocol.TPraos.API" "cardano-protocol-tpraos-1.4.0.0-inplace" 'True) (C1 ('MetaCons "ChainTransitionError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty (PredicateFailure (PRTCL c))))))

tickChainDepState Source #

Arguments

Globals 
LedgerView 
Bool

Are we in a new epoch?

ChainDepState 
ChainDepState 

Tick the chain state to a new epoch.

updateChainDepState ∷ ∀ c m. (PraosCrypto c, MonadError (ChainTransitionError c) m) ⇒ GlobalsLedgerViewBHeader c → ChainDepState → m ChainDepState Source #

Update the chain state based upon a new block header.

This also updates the last applied block hash.

reupdateChainDepState ∷ ∀ c. PraosCrypto c ⇒ GlobalsLedgerViewBHeader c → ChainDepStateChainDepState Source #

Re-update the chain state based upon a new block header.

This function does no validation of whether the header is internally valid or consistent with the chain it is being applied to; the caller must ensure that this is valid through having previously applied it.

initialChainDepStateNonceMap (KeyHash 'Genesis) GenDelegPairChainDepState Source #

Construct an initial chain state given an initial nonce and a set of genesis delegates.

checkLeaderValue ∷ ∀ v. VRFAlgorithm v ⇒ OutputVRF v → RationalActiveSlotCoeffBool Source #

Check that the certified VRF output, when used as a natural, is valid for being slot leader.

getLeaderSchedule ∷ (EraPParams era, VRFAlgorithm v, ContextVRF v ~ (), Signable v Seed) ⇒ GlobalsNewEpochState era → ChainDepStateKeyHash 'StakePoolSignKeyVRF v → PParams era → Set SlotNo Source #

Get the (private) leader schedule for this epoch.

Given a private VRF key, returns the set of slots in which this node is eligible to lead.