Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Protocol.Praos
Contents
Synopsis
- data family ConsensusConfig p
- data Praos c
- data PraosCannotForge c = PraosCannotForgeKeyNotUsableYet !KESPeriod !KESPeriod
- class (Crypto c, Signable DSIGN (OCertSignable c), Signable (KES c) (HeaderBody c), Signable (VRF c) InputVRF) ⇒ PraosCrypto c
- data PraosFields c toSign = PraosFields {
- praosSignature ∷ SignedKES (KES c) toSign
- praosToSign ∷ toSign
- newtype PraosIsLeader c = PraosIsLeader {}
- data PraosParams = PraosParams {}
- data PraosState = PraosState {}
- data PraosToSign c = PraosToSign {}
- data PraosValidationErr c
- = VRFKeyUnknown !(KeyHash 'StakePool)
- | VRFKeyWrongVRFKey !(KeyHash 'StakePool) !(Hash HASH (VerKeyVRF (VRF c))) !(Hash HASH (VerKeyVRF (VRF c)))
- | VRFKeyBadProof !SlotNo !Nonce !(CertifiedVRF (VRF c) InputVRF)
- | VRFLeaderValueTooBig Natural Rational ActiveSlotCoeff
- | KESBeforeStartOCERT !KESPeriod !KESPeriod
- | KESAfterEndOCERT !KESPeriod !KESPeriod !Word64
- | CounterTooSmallOCERT !Word64 !Word64
- | CounterOverIncrementedOCERT !Word64 !Word64
- | InvalidSignatureOCERT !Word64 !KESPeriod !String
- | InvalidKesSignatureOCERT !Word !Word !Word !Word64 !String
- | NoCounterForKeyHashOCERT !(KeyHash 'BlockIssuer)
- data family Ticked (st ∷ k) ∷ k
- forgePraosFields ∷ (PraosCrypto c, Signable (KES c) toSign, Monad m) ⇒ HotKey c m → CanBeLeader (Praos c) → IsLeader (Praos c) → (PraosToSign c → toSign) → m (PraosFields c toSign)
- praosCheckCanForge ∷ ConsensusConfig (Praos c) → SlotNo → KESInfo → Either (PraosCannotForge c) ()
- doValidateKESSignature ∷ PraosCrypto c ⇒ Word64 → Word64 → Map (KeyHash 'StakePool) IndividualPoolStake → Map (KeyHash 'BlockIssuer) Word64 → HeaderView c → Except (PraosValidationErr c) ()
- doValidateVRFSignature ∷ PraosCrypto c ⇒ Nonce → Map (KeyHash 'StakePool) IndividualPoolStake → ActiveSlotCoeff → HeaderView c → Except (PraosValidationErr c) ()
Documentation
data family ConsensusConfig p Source #
Static configuration required to run the consensus protocol
Every method in the ConsensusProtocol
class takes the consensus
configuration as a parameter, so having this as a data family rather than a
type family resolves most ambiguity.
Defined out of the class so that protocols can define this type without having to define the entire protocol at the same time (or indeed in the same module).
Instances
Instances
Generic (ConsensusConfig (Praos c)) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
Methods from ∷ ConsensusConfig (Praos c) → Rep (ConsensusConfig (Praos c)) x # to ∷ Rep (ConsensusConfig (Praos c)) x → ConsensusConfig (Praos c) # | |||||||||||||||||||||||||||||
PraosCrypto c ⇒ NoThunks (ConsensusConfig (Praos c)) Source # | |||||||||||||||||||||||||||||
PraosCrypto c ⇒ ConsensusProtocol (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
Methods checkIsLeader ∷ ConsensusConfig (Praos c) → CanBeLeader (Praos c) → SlotNo → Ticked (ChainDepState (Praos c)) → Maybe (IsLeader (Praos c)) Source # tickChainDepState ∷ ConsensusConfig (Praos c) → LedgerView (Praos c) → SlotNo → ChainDepState (Praos c) → Ticked (ChainDepState (Praos c)) Source # updateChainDepState ∷ ConsensusConfig (Praos c) → ValidateView (Praos c) → SlotNo → Ticked (ChainDepState (Praos c)) → Except (ValidationErr (Praos c)) (ChainDepState (Praos c)) Source # reupdateChainDepState ∷ ConsensusConfig (Praos c) → ValidateView (Praos c) → SlotNo → Ticked (ChainDepState (Praos c)) → ChainDepState (Praos c) Source # protocolSecurityParam ∷ ConsensusConfig (Praos c) → SecurityParam Source # | |||||||||||||||||||||||||||||
PraosCrypto c ⇒ PraosProtocolSupportsNode (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
Methods getPraosNonces ∷ proxy (Praos c) → ChainDepState (Praos c) → PraosNonces Source # getOpCertCounters ∷ proxy (Praos c) → ChainDepState (Praos c) → Map (KeyHash 'BlockIssuer) Word64 Source # | |||||||||||||||||||||||||||||
TranslateProto (TPraos c) (Praos c) Source # | We can translate between TPraos and Praos, provided:
| ||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods translateLedgerView ∷ Proxy (TPraos c, Praos c) → LedgerView (TPraos c) → LedgerView (Praos c) Source # translateChainDepState ∷ Proxy (TPraos c, Praos c) → ChainDepState (TPraos c) → ChainDepState (Praos c) Source # | |||||||||||||||||||||||||||||
type Rep (ConsensusConfig (Praos c)) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep (ConsensusConfig (Praos c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.12.0.0-inplace" 'False) (C1 ('MetaCons "PraosConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "praosParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PraosParams) :*: S1 ('MetaSel ('Just "praosEpochInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (EpochInfo (Except PastHorizonException))))) | |||||||||||||||||||||||||||||
type CanBeLeader (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
type ChainDepState (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
data ConsensusConfig (Praos c) Source # | Static configuration | ||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
type IsLeader (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
type LedgerView (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
type SelectView (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
type ValidateView (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
type ValidationErr (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
type PraosProtocolSupportsNodeCrypto (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos |
data PraosCannotForge c Source #
Expresses that, whilst we believe ourselves to be a leader for this slot, we are nonetheless unable to forge a block.
Constructors
PraosCannotForgeKeyNotUsableYet | The KES key in our operational certificate can't be used because the current (wall clock) period is before the start period of the key. current KES period. Note: the opposite case, i.e., the wall clock period being after the
end period of the key, is caught when trying to update the key in
|
Instances
Generic (PraosCannotForge c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
Methods from ∷ PraosCannotForge c → Rep (PraosCannotForge c) x # to ∷ Rep (PraosCannotForge c) x → PraosCannotForge c # | |||||
PraosCrypto c ⇒ Show (PraosCannotForge c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods showsPrec ∷ Int → PraosCannotForge c → ShowS # show ∷ PraosCannotForge c → String # showList ∷ [PraosCannotForge c] → ShowS # | |||||
type Rep (PraosCannotForge c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep (PraosCannotForge c) = D1 ('MetaData "PraosCannotForge" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.12.0.0-inplace" 'False) (C1 ('MetaCons "PraosCannotForgeKeyNotUsableYet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESPeriod) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESPeriod))) |
class (Crypto c, Signable DSIGN (OCertSignable c), Signable (KES c) (HeaderBody c), Signable (VRF c) InputVRF) ⇒ PraosCrypto c Source #
Instances
data PraosFields c toSign Source #
Constructors
PraosFields | |
Fields
|
Instances
Generic (PraosFields c toSign) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
Methods from ∷ PraosFields c toSign → Rep (PraosFields c toSign) x # to ∷ Rep (PraosFields c toSign) x → PraosFields c toSign # | |||||
(Show toSign, PraosCrypto c) ⇒ Show (PraosFields c toSign) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods showsPrec ∷ Int → PraosFields c toSign → ShowS # show ∷ PraosFields c toSign → String # showList ∷ [PraosFields c toSign] → ShowS # | |||||
(NoThunks toSign, PraosCrypto c) ⇒ NoThunks (PraosFields c toSign) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||
type Rep (PraosFields c toSign) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep (PraosFields c toSign) = D1 ('MetaData "PraosFields" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.12.0.0-inplace" 'False) (C1 ('MetaCons "PraosFields" 'PrefixI 'True) (S1 ('MetaSel ('Just "praosSignature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SignedKES (KES c) toSign)) :*: S1 ('MetaSel ('Just "praosToSign") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 toSign))) |
newtype PraosIsLeader c Source #
Assembled proof that the issuer has the right to issue a block in the selected slot.
Constructors
PraosIsLeader | |
Fields |
Instances
Generic (PraosIsLeader c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
Methods from ∷ PraosIsLeader c → Rep (PraosIsLeader c) x # to ∷ Rep (PraosIsLeader c) x → PraosIsLeader c # | |||||
PraosCrypto c ⇒ NoThunks (PraosIsLeader c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||
type Rep (PraosIsLeader c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep (PraosIsLeader c) = D1 ('MetaData "PraosIsLeader" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.12.0.0-inplace" 'True) (C1 ('MetaCons "PraosIsLeader" 'PrefixI 'True) (S1 ('MetaSel ('Just "praosIsLeaderVrfRes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CertifiedVRF (VRF c) InputVRF)))) |
data PraosParams Source #
Praos parameters that are node independent
Constructors
PraosParams | |
Fields
|
Instances
Generic PraosParams Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
| |||||
NoThunks PraosParams Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||
type Rep PraosParams Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep PraosParams = D1 ('MetaData "PraosParams" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.12.0.0-inplace" 'False) (C1 ('MetaCons "PraosParams" 'PrefixI 'True) ((S1 ('MetaSel ('Just "praosSlotsPerKESPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: (S1 ('MetaSel ('Just "praosLeaderF") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ActiveSlotCoeff) :*: S1 ('MetaSel ('Just "praosSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SecurityParam))) :*: (S1 ('MetaSel ('Just "praosMaxKESEvo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: (S1 ('MetaSel ('Just "praosMaxMajorPV") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MaxMajorProtVer) :*: S1 ('MetaSel ('Just "praosRandomnessStabilisationWindow") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64))))) |
data PraosState Source #
Praos consensus state.
We track the last slot and the counters for operational certificates, as well as a series of nonces which get updated in different ways over the course of an epoch.
Constructors
PraosState | |
Fields
|
Instances
FromCBOR PraosState Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||
ToCBOR PraosState Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods toCBOR ∷ PraosState → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy PraosState → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PraosState] → Size Source # | |||||
Generic PraosState Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
| |||||
Show PraosState Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods showsPrec ∷ Int → PraosState → ShowS # show ∷ PraosState → String # showList ∷ [PraosState] → ShowS # | |||||
Eq PraosState Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||
NoThunks PraosState Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||
Serialise PraosState Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods encode ∷ PraosState → Encoding Source # decode ∷ Decoder s PraosState Source # encodeList ∷ [PraosState] → Encoding Source # decodeList ∷ Decoder s [PraosState] Source # | |||||
type Rep PraosState Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep PraosState = D1 ('MetaData "PraosState" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.12.0.0-inplace" 'False) (C1 ('MetaCons "PraosState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "praosStateLastSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin SlotNo)) :*: (S1 ('MetaSel ('Just "praosStateOCertCounters") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'BlockIssuer) Word64)) :*: S1 ('MetaSel ('Just "praosStateEvolvingNonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce))) :*: ((S1 ('MetaSel ('Just "praosStateCandidateNonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce) :*: S1 ('MetaSel ('Just "praosStateEpochNonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce)) :*: (S1 ('MetaSel ('Just "praosStateLabNonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce) :*: S1 ('MetaSel ('Just "praosStateLastEpochBlockNonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce))))) | |||||
data Ticked PraosState Source # | |||||
data PraosToSign c Source #
Fields arising from praos execution which must be included in the block signature.
Constructors
PraosToSign | |
Fields
|
Instances
Generic (PraosToSign c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
| |||||
PraosCrypto c ⇒ Show (PraosToSign c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods showsPrec ∷ Int → PraosToSign c → ShowS # show ∷ PraosToSign c → String # showList ∷ [PraosToSign c] → ShowS # | |||||
PraosCrypto c ⇒ NoThunks (PraosToSign c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||
type Rep (PraosToSign c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep (PraosToSign c) = D1 ('MetaData "PraosToSign" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.12.0.0-inplace" 'False) (C1 ('MetaCons "PraosToSign" 'PrefixI 'True) ((S1 ('MetaSel ('Just "praosToSignIssuerVK") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VKey 'BlockIssuer)) :*: S1 ('MetaSel ('Just "praosToSignVrfVK") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VerKeyVRF (VRF c)))) :*: (S1 ('MetaSel ('Just "praosToSignVrfRes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CertifiedVRF (VRF c) InputVRF)) :*: S1 ('MetaSel ('Just "praosToSignOCert") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OCert c))))) |
data PraosValidationErr c Source #
Errors which we might encounter
Constructors
VRFKeyUnknown !(KeyHash 'StakePool) | |
VRFKeyWrongVRFKey !(KeyHash 'StakePool) !(Hash HASH (VerKeyVRF (VRF c))) !(Hash HASH (VerKeyVRF (VRF c))) | |
VRFKeyBadProof !SlotNo !Nonce !(CertifiedVRF (VRF c) InputVRF) | |
VRFLeaderValueTooBig Natural Rational ActiveSlotCoeff | |
KESBeforeStartOCERT !KESPeriod !KESPeriod | |
KESAfterEndOCERT !KESPeriod !KESPeriod !Word64 | |
CounterTooSmallOCERT !Word64 !Word64 | |
CounterOverIncrementedOCERT !Word64 !Word64 | The KES counter has been incremented by more than 1 |
InvalidSignatureOCERT !Word64 !KESPeriod !String | |
InvalidKesSignatureOCERT !Word !Word !Word !Word64 !String | |
NoCounterForKeyHashOCERT !(KeyHash 'BlockIssuer) |
Instances
Generic (PraosValidationErr c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
Methods from ∷ PraosValidationErr c → Rep (PraosValidationErr c) x # to ∷ Rep (PraosValidationErr c) x → PraosValidationErr c # | |||||
PraosCrypto c ⇒ Show (PraosValidationErr c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods showsPrec ∷ Int → PraosValidationErr c → ShowS # show ∷ PraosValidationErr c → String # showList ∷ [PraosValidationErr c] → ShowS # | |||||
PraosCrypto c ⇒ Eq (PraosValidationErr c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods (==) ∷ PraosValidationErr c → PraosValidationErr c → Bool # (/=) ∷ PraosValidationErr c → PraosValidationErr c → Bool # | |||||
PraosCrypto c ⇒ NoThunks (PraosValidationErr c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||
type Rep (PraosValidationErr c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep (PraosValidationErr c) = D1 ('MetaData "PraosValidationErr" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.12.0.0-inplace" 'False) (((C1 ('MetaCons "VRFKeyUnknown" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'StakePool))) :+: C1 ('MetaCons "VRFKeyWrongVRFKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'StakePool)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Hash HASH (VerKeyVRF (VRF c)))) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Hash HASH (VerKeyVRF (VRF c))))))) :+: (C1 ('MetaCons "VRFKeyBadProof" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CertifiedVRF (VRF c) InputVRF)))) :+: (C1 ('MetaCons "VRFLeaderValueTooBig" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ActiveSlotCoeff))) :+: C1 ('MetaCons "KESBeforeStartOCERT" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESPeriod) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESPeriod))))) :+: ((C1 ('MetaCons "KESAfterEndOCERT" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESPeriod) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESPeriod) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64))) :+: (C1 ('MetaCons "CounterTooSmallOCERT" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :+: C1 ('MetaCons "CounterOverIncrementedOCERT" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)))) :+: (C1 ('MetaCons "InvalidSignatureOCERT" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESPeriod) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String))) :+: (C1 ('MetaCons "InvalidKesSignatureOCERT" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)))) :+: C1 ('MetaCons "NoCounterForKeyHashOCERT" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'BlockIssuer))))))) |
data family Ticked (st ∷ k) ∷ k Source #
" Ticked " piece of state, either LedgerState
or ChainDepState
Ticking refers to the passage of time (the ticking of the clock). When a
piece of state is marked as ticked, it means that time-related changes have
been applied to the state. There are exactly two methods in the interface
that do that: tickChainDepState
and
applyChainTickLedgerResult
.
Also note that a successful forecast
must equal
forecastFor
(ledgerViewForecastAt
cfg st)
slot
. Thus a
protocolLedgerView
cfg
(applyChainTick
cfg slot st)LedgerView
can only be projected
from a Ticked
state, but cannot itself be ticked.
Some examples of time related changes:
- Scheduled delegations might have been applied in Byron
- New leader schedule computed for Shelley
- Transition from Byron to Shelley activated in the hard fork combinator.
- Nonces switched out at the start of a new epoch.
Instances
Show (Ticked ()) | |
Bridge m a ⇒ GetTip (Ticked (LedgerState (DualBlock m a))) | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
IsLedger (LedgerState blk) ⇒ GetTip (Ticked (ExtLedgerState blk)) | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked (ExtLedgerState blk) mk → Point (Ticked (ExtLedgerState blk)) Source # | |
(Bridge m a, NoThunks (TxOut (LedgerState m)), NoThunks (TxIn (LedgerState m)), Show (TxOut (LedgerState m)), Show (TxIn (LedgerState m)), Eq (TxOut (LedgerState m)), Ord (TxIn (LedgerState m)), MemPack (TxIn (LedgerState m))) ⇒ HasLedgerTables (Ticked (LedgerState (DualBlock m a))) | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (DualBlock m a)) mk → LedgerTables (Ticked (LedgerState (DualBlock m a))) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (DualBlock m a)) any → LedgerTables (Ticked (LedgerState (DualBlock m a))) mk → Ticked (LedgerState (DualBlock m a)) mk Source # | |
(HasLedgerTables (Ticked (LedgerState blk)), NoThunks (TxOut (LedgerState blk)), NoThunks (TxIn (LedgerState blk)), Show (TxOut (LedgerState blk)), Show (TxIn (LedgerState blk)), Eq (TxOut (LedgerState blk)), Ord (TxIn (LedgerState blk)), MemPack (TxIn (LedgerState blk))) ⇒ HasLedgerTables (Ticked (ExtLedgerState blk)) | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (ExtLedgerState blk) mk → LedgerTables (Ticked (ExtLedgerState blk)) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (ExtLedgerState blk) any → LedgerTables (Ticked (ExtLedgerState blk)) mk → Ticked (ExtLedgerState blk) mk Source # | |
LedgerTablesAreTrivial (Ticked (LedgerState blk)) ⇒ LedgerTablesAreTrivial (Ticked (ExtLedgerState blk)) | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods convertMapKind ∷ ∀ (mk ∷ MapKind) (mk' ∷ MapKind). Ticked (ExtLedgerState blk) mk → Ticked (ExtLedgerState blk) mk' Source # | |
NoThunks (Ticked (LedgerState (DualBlock m a)) mk) | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
Show (Ticked (f a)) ⇒ Show (((Ticked ∷ Type → Type) :.: f) a) | |
NoThunks (Ticked (f a)) ⇒ NoThunks (((Ticked ∷ Type → Type) :.: f) a) | |
data Ticked PraosState Source # | |
data Ticked TPraosState Source # | |
data Ticked () | |
Defined in Ouroboros.Consensus.Ticked | |
data Ticked (HardForkChainDepState xs ∷ Type) | |
data Ticked (HeaderState blk ∷ Type) | |
Defined in Ouroboros.Consensus.HeaderValidation | |
data Ticked (PBftState c ∷ Type) | |
Defined in Ouroboros.Consensus.Protocol.PBFT | |
newtype Ticked (WrapChainDepState blk ∷ Type) | |
Defined in Ouroboros.Consensus.TypeFamilyWrappers | |
type HeaderHash (Ticked l ∷ k) | |
Defined in Ouroboros.Consensus.Ticked | |
type TxIn (Ticked l) | |
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |
type TxOut (Ticked l) | |
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |
data Ticked (LedgerState (HardForkBlock xs) ∷ MapKind → Type) (mk ∷ MapKind) | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger data Ticked (LedgerState (HardForkBlock xs) ∷ MapKind → Type) (mk ∷ MapKind) = TickedHardForkLedgerState {} | |
data Ticked (LedgerState (DualBlock m a) ∷ MapKind → Type) (mk ∷ MapKind) | |
Defined in Ouroboros.Consensus.Ledger.Dual data Ticked (LedgerState (DualBlock m a) ∷ MapKind → Type) (mk ∷ MapKind) = TickedDualLedgerState {} | |
data Ticked (ExtLedgerState blk ∷ MapKind → Type) (mk ∷ MapKind) | |
Defined in Ouroboros.Consensus.Ledger.Extended data Ticked (ExtLedgerState blk ∷ MapKind → Type) (mk ∷ MapKind) = TickedExtLedgerState {
|
forgePraosFields ∷ (PraosCrypto c, Signable (KES c) toSign, Monad m) ⇒ HotKey c m → CanBeLeader (Praos c) → IsLeader (Praos c) → (PraosToSign c → toSign) → m (PraosFields c toSign) Source #
praosCheckCanForge ∷ ConsensusConfig (Praos c) → SlotNo → KESInfo → Either (PraosCannotForge c) () Source #
For testing purposes
doValidateKESSignature ∷ PraosCrypto c ⇒ Word64 → Word64 → Map (KeyHash 'StakePool) IndividualPoolStake → Map (KeyHash 'BlockIssuer) Word64 → HeaderView c → Except (PraosValidationErr c) () Source #
doValidateVRFSignature ∷ PraosCrypto c ⇒ Nonce → Map (KeyHash 'StakePool) IndividualPoolStake → ActiveSlotCoeff → HeaderView c → Except (PraosValidationErr c) () Source #