| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Protocol.Praos
Contents
Description
Praos with no extensions.
Synopsis
- data family ConsensusConfig p
- data family LeiosOnly proto a ∷ Type → Type
- type VoidUnlessLeios proto = LeiosOnly proto Void
- type WhenLeios proto = LeiosOnly proto ()
- data Praos c
- class (Crypto c, PolyPraosCrypto (Praos c) c) ⇒ PraosCrypto c
- type PraosLedgerView c = PolyPraosLedgerView (Praos c)
- type PraosState c = PolyPraosState (Praos c)
- type PraosValidateView c = PolyPraosValidateView (Praos c) c
- type PraosValidationErr c = PolyPraosValidationErr (Praos c) c
- class (Crypto c, Signable DSIGN (OCertSignable c), Signable (VRF c) InputVRF, Signable (KES c) (Signed (ShelleyProtocolHeader proto))) ⇒ PolyPraosCrypto proto c
- data PolyPraosState proto = PraosState {
- praosStateLastSlot ∷ !(WithOrigin SlotNo)
- praosStateOCertCounters ∷ !(Map (KeyHash 'BlockIssuer) Word64)
- praosStateEvolvingNonce ∷ !Nonce
- praosStateCandidateNonce ∷ !Nonce
- praosStateEpochNonce ∷ !Nonce
- praosStatePreviousEpochNonce ∷ !Nonce
- praosStateLabNonce ∷ !Nonce
- praosStateLastEpochBlockNonce ∷ !Nonce
- praosStateLeiosAnnouncement ∷ !(WhenLeios proto (Either WhyNotCertifiable LeiosAnnouncement))
- data PolyPraosValidationErr proto 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)
- | LeiosCertWithoutAnnouncement !(VoidUnlessLeios proto ()) !WhyNotCertifiable !(WithOrigin SlotNo) !SlotNo
- | LeiosCertTooYoung !(VoidUnlessLeios proto ()) !SlotNo !SlotNo !SlotNo
- | LeiosEbTooBig !(VoidUnlessLeios proto ()) !Word32 !Word32
- data PraosCannotForge c = PraosCannotForgeKeyNotUsableYet !KESPeriod !KESPeriod
- data PraosFields c toSign = PraosFields {
- praosSignature ∷ SignedKES (KES c) toSign
- praosToSign ∷ toSign
- newtype PraosIsLeader c = PraosIsLeader {}
- data PraosParams = PraosParams {}
- data PraosToSign c = PraosToSign {}
- type SerialisePraosState proto = (Typeable proto, Applicative (WhenLeios proto), Traversable (WhenLeios proto))
- data family Ticked (st ∷ k) ∷ k
- checkIsLeaderPolyPraos ∷ PolyPraosCrypto proto c ⇒ PraosParams → PraosCanBeLeader c → SlotNo → Ticked (PolyPraosState proto) → Maybe (PraosIsLeader c)
- forgePraosFields ∷ (Crypto c, Signable (KES c) toSign, Monad m) ⇒ HotKey c m → PraosCanBeLeader c → PraosIsLeader c → (PraosToSign c → toSign) → m (PraosFields c toSign)
- getOpCertCountersPolyPraos ∷ PolyPraosState proto → Map (KeyHash 'BlockIssuer) Word64
- getPraosNoncesPolyPraos ∷ PolyPraosState proto → PraosNonces
- leiosContextFreeHeaderChecks ∷ (Applicative (WhenLeios proto), Foldable (WhenLeios proto), TypeSwitch (LeiosOnly proto)) ⇒ PolyPraosLedgerView proto → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto c) ()
- praosCheckCanForge ∷ PraosParams → SlotNo → KESInfo → Either (PraosCannotForge c) ()
- reupdateChainDepStatePolyPraos ∷ Functor (WhenLeios proto) ⇒ PraosParams → EpochInfo (Except PastHorizonException) → PolyPraosValidateView proto c → SlotNo → Ticked (PolyPraosState proto) → PolyPraosState proto
- updateChainDepStatePolyPraos ∷ (PolyPraosCrypto proto c, Applicative (WhenLeios proto), Foldable (WhenLeios proto), TypeSwitch (LeiosOnly proto)) ⇒ PraosParams → EpochInfo (Except PastHorizonException) → PolyPraosValidateView proto c → SlotNo → Ticked (PolyPraosState proto) → Except (PolyPraosValidationErr proto c) (PolyPraosState proto)
- tickChainDepStatePolyPraos ∷ Functor (WhenLeios proto) ⇒ EpochInfo (Except PastHorizonException) → PolyPraosLedgerView proto → SlotNo → PolyPraosState proto → Ticked (PolyPraosState proto)
- validateKESSignature ∷ PolyPraosCrypto proto c ⇒ PraosParams → PolyPraosLedgerView proto → Map (KeyHash 'BlockIssuer) Word64 → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto c) ()
- validateVRFSignature ∷ PolyPraosCrypto proto c ⇒ Nonce → PolyPraosLedgerView proto → ActiveSlotCoeff → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto c) ()
- doValidateKESSignature ∷ PolyPraosCrypto proto c ⇒ Word64 → Word64 → Map (KeyHash 'StakePool) IndividualPoolStake → Map (KeyHash 'BlockIssuer) Word64 → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto c) ()
- doValidateVRFSignature ∷ PolyPraosCrypto proto c ⇒ Nonce → Map (KeyHash 'StakePool) IndividualPoolStake → ActiveSlotCoeff → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto 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).
TODO See the TODO about this misnomer at
topLevelConfigProtocol.
Instances
data family LeiosOnly proto a ∷ Type → Type Source #
a for the protocols without Leios, and b for the ones with it.
One such family per extension, which is what keeps every type that mentions
one indexed by proto alone. Its two intended uses:
VoidUnlessLeios proto ()gates a constructor, since the protocols without Leios cannot build it.WhenLeios proto agates a field, which those protocols have but cannot put anything in.
Instances
| TypeSwitch (LeiosOnly (Praos c)) Source # | |||||
| TypeSwitch (LeiosOnly (Praos2 c)) Source # | |||||
| TypeSwitch (LeiosOnly (TPraos c)) Source # | |||||
| () ~ a ⇒ Applicative (LeiosOnly (Praos c) a) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods pure ∷ a0 → LeiosOnly (Praos c) a a0 # (<*>) ∷ LeiosOnly (Praos c) a (a0 → b) → LeiosOnly (Praos c) a a0 → LeiosOnly (Praos c) a b # liftA2 ∷ (a0 → b → c0) → LeiosOnly (Praos c) a a0 → LeiosOnly (Praos c) a b → LeiosOnly (Praos c) a c0 # (*>) ∷ LeiosOnly (Praos c) a a0 → LeiosOnly (Praos c) a b → LeiosOnly (Praos c) a b # (<*) ∷ LeiosOnly (Praos c) a a0 → LeiosOnly (Praos c) a b → LeiosOnly (Praos c) a a0 # | |||||
| Applicative (LeiosOnly (Praos2 c) a) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos2 Methods pure ∷ a0 → LeiosOnly (Praos2 c) a a0 # (<*>) ∷ LeiosOnly (Praos2 c) a (a0 → b) → LeiosOnly (Praos2 c) a a0 → LeiosOnly (Praos2 c) a b # liftA2 ∷ (a0 → b → c0) → LeiosOnly (Praos2 c) a a0 → LeiosOnly (Praos2 c) a b → LeiosOnly (Praos2 c) a c0 # (*>) ∷ LeiosOnly (Praos2 c) a a0 → LeiosOnly (Praos2 c) a b → LeiosOnly (Praos2 c) a b # (<*) ∷ LeiosOnly (Praos2 c) a a0 → LeiosOnly (Praos2 c) a b → LeiosOnly (Praos2 c) a a0 # | |||||
| () ~ a ⇒ Applicative (LeiosOnly (TPraos c) a) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.TPraos Methods pure ∷ a0 → LeiosOnly (TPraos c) a a0 # (<*>) ∷ LeiosOnly (TPraos c) a (a0 → b) → LeiosOnly (TPraos c) a a0 → LeiosOnly (TPraos c) a b # liftA2 ∷ (a0 → b → c0) → LeiosOnly (TPraos c) a a0 → LeiosOnly (TPraos c) a b → LeiosOnly (TPraos c) a c0 # (*>) ∷ LeiosOnly (TPraos c) a a0 → LeiosOnly (TPraos c) a b → LeiosOnly (TPraos c) a b # (<*) ∷ LeiosOnly (TPraos c) a a0 → LeiosOnly (TPraos c) a b → LeiosOnly (TPraos c) a a0 # | |||||
| Functor (LeiosOnly (Praos c) a) Source # | |||||
| Functor (LeiosOnly (Praos2 c) a) Source # | |||||
| Functor (LeiosOnly (TPraos c) a) Source # | |||||
| Foldable (LeiosOnly (Praos c) a) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods fold ∷ Monoid m ⇒ LeiosOnly (Praos c) a m → m # foldMap ∷ Monoid m ⇒ (a0 → m) → LeiosOnly (Praos c) a a0 → m # foldMap' ∷ Monoid m ⇒ (a0 → m) → LeiosOnly (Praos c) a a0 → m # foldr ∷ (a0 → b → b) → b → LeiosOnly (Praos c) a a0 → b # foldr' ∷ (a0 → b → b) → b → LeiosOnly (Praos c) a a0 → b # foldl ∷ (b → a0 → b) → b → LeiosOnly (Praos c) a a0 → b # foldl' ∷ (b → a0 → b) → b → LeiosOnly (Praos c) a a0 → b # foldr1 ∷ (a0 → a0 → a0) → LeiosOnly (Praos c) a a0 → a0 # foldl1 ∷ (a0 → a0 → a0) → LeiosOnly (Praos c) a a0 → a0 # toList ∷ LeiosOnly (Praos c) a a0 → [a0] # null ∷ LeiosOnly (Praos c) a a0 → Bool # length ∷ LeiosOnly (Praos c) a a0 → Int # elem ∷ Eq a0 ⇒ a0 → LeiosOnly (Praos c) a a0 → Bool # maximum ∷ Ord a0 ⇒ LeiosOnly (Praos c) a a0 → a0 # minimum ∷ Ord a0 ⇒ LeiosOnly (Praos c) a a0 → a0 # | |||||
| Foldable (LeiosOnly (Praos2 c) a) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos2 Methods fold ∷ Monoid m ⇒ LeiosOnly (Praos2 c) a m → m # foldMap ∷ Monoid m ⇒ (a0 → m) → LeiosOnly (Praos2 c) a a0 → m # foldMap' ∷ Monoid m ⇒ (a0 → m) → LeiosOnly (Praos2 c) a a0 → m # foldr ∷ (a0 → b → b) → b → LeiosOnly (Praos2 c) a a0 → b # foldr' ∷ (a0 → b → b) → b → LeiosOnly (Praos2 c) a a0 → b # foldl ∷ (b → a0 → b) → b → LeiosOnly (Praos2 c) a a0 → b # foldl' ∷ (b → a0 → b) → b → LeiosOnly (Praos2 c) a a0 → b # foldr1 ∷ (a0 → a0 → a0) → LeiosOnly (Praos2 c) a a0 → a0 # foldl1 ∷ (a0 → a0 → a0) → LeiosOnly (Praos2 c) a a0 → a0 # toList ∷ LeiosOnly (Praos2 c) a a0 → [a0] # null ∷ LeiosOnly (Praos2 c) a a0 → Bool # length ∷ LeiosOnly (Praos2 c) a a0 → Int # elem ∷ Eq a0 ⇒ a0 → LeiosOnly (Praos2 c) a a0 → Bool # maximum ∷ Ord a0 ⇒ LeiosOnly (Praos2 c) a a0 → a0 # minimum ∷ Ord a0 ⇒ LeiosOnly (Praos2 c) a a0 → a0 # | |||||
| Foldable (LeiosOnly (TPraos c) a) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.TPraos Methods fold ∷ Monoid m ⇒ LeiosOnly (TPraos c) a m → m # foldMap ∷ Monoid m ⇒ (a0 → m) → LeiosOnly (TPraos c) a a0 → m # foldMap' ∷ Monoid m ⇒ (a0 → m) → LeiosOnly (TPraos c) a a0 → m # foldr ∷ (a0 → b → b) → b → LeiosOnly (TPraos c) a a0 → b # foldr' ∷ (a0 → b → b) → b → LeiosOnly (TPraos c) a a0 → b # foldl ∷ (b → a0 → b) → b → LeiosOnly (TPraos c) a a0 → b # foldl' ∷ (b → a0 → b) → b → LeiosOnly (TPraos c) a a0 → b # foldr1 ∷ (a0 → a0 → a0) → LeiosOnly (TPraos c) a a0 → a0 # foldl1 ∷ (a0 → a0 → a0) → LeiosOnly (TPraos c) a a0 → a0 # toList ∷ LeiosOnly (TPraos c) a a0 → [a0] # null ∷ LeiosOnly (TPraos c) a a0 → Bool # length ∷ LeiosOnly (TPraos c) a a0 → Int # elem ∷ Eq a0 ⇒ a0 → LeiosOnly (TPraos c) a a0 → Bool # maximum ∷ Ord a0 ⇒ LeiosOnly (TPraos c) a a0 → a0 # minimum ∷ Ord a0 ⇒ LeiosOnly (TPraos c) a a0 → a0 # | |||||
| Traversable (LeiosOnly (Praos c) a) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods traverse ∷ Applicative f ⇒ (a0 → f b) → LeiosOnly (Praos c) a a0 → f (LeiosOnly (Praos c) a b) # sequenceA ∷ Applicative f ⇒ LeiosOnly (Praos c) a (f a0) → f (LeiosOnly (Praos c) a a0) # mapM ∷ Monad m ⇒ (a0 → m b) → LeiosOnly (Praos c) a a0 → m (LeiosOnly (Praos c) a b) # sequence ∷ Monad m ⇒ LeiosOnly (Praos c) a (m a0) → m (LeiosOnly (Praos c) a a0) # | |||||
| Traversable (LeiosOnly (Praos2 c) a) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos2 Methods traverse ∷ Applicative f ⇒ (a0 → f b) → LeiosOnly (Praos2 c) a a0 → f (LeiosOnly (Praos2 c) a b) # sequenceA ∷ Applicative f ⇒ LeiosOnly (Praos2 c) a (f a0) → f (LeiosOnly (Praos2 c) a a0) # mapM ∷ Monad m ⇒ (a0 → m b) → LeiosOnly (Praos2 c) a a0 → m (LeiosOnly (Praos2 c) a b) # sequence ∷ Monad m ⇒ LeiosOnly (Praos2 c) a (m a0) → m (LeiosOnly (Praos2 c) a a0) # | |||||
| Traversable (LeiosOnly (TPraos c) a) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.TPraos Methods traverse ∷ Applicative f ⇒ (a0 → f b) → LeiosOnly (TPraos c) a a0 → f (LeiosOnly (TPraos c) a b) # sequenceA ∷ Applicative f ⇒ LeiosOnly (TPraos c) a (f a0) → f (LeiosOnly (TPraos c) a a0) # mapM ∷ Monad m ⇒ (a0 → m b) → LeiosOnly (TPraos c) a a0 → m (LeiosOnly (TPraos c) a b) # sequence ∷ Monad m ⇒ LeiosOnly (TPraos c) a (m a0) → m (LeiosOnly (TPraos c) a a0) # | |||||
| Eq a ⇒ Eq (LeiosOnly (Praos c) a b) Source # | |||||
| Eq b ⇒ Eq (LeiosOnly (Praos2 c) a b) Source # | |||||
| Eq a ⇒ Eq (LeiosOnly (TPraos c) a b) Source # | |||||
| Generic (LeiosOnly (Praos c) a b) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
| |||||
| Generic (LeiosOnly (Praos2 c) a b) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos2 Associated Types
| |||||
| Generic (LeiosOnly (TPraos c) a b) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.TPraos Associated Types
| |||||
| Show a ⇒ Show (LeiosOnly (Praos c) a b) Source # | |||||
| Show b ⇒ Show (LeiosOnly (Praos2 c) a b) Source # | |||||
| Show a ⇒ Show (LeiosOnly (TPraos c) a b) Source # | |||||
| NoThunks a ⇒ NoThunks (LeiosOnly (Praos c) a b) Source # | |||||
| NoThunks b ⇒ NoThunks (LeiosOnly (Praos2 c) a b) Source # | |||||
| NoThunks a ⇒ NoThunks (LeiosOnly (TPraos c) a b) Source # | |||||
| newtype LeiosOnly (Praos c) a b Source # | Praos is not Leios, so it holds the left alternative. | ||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||
| newtype LeiosOnly (Praos2 c) a b Source # | This protocol is Leios, so it holds the right alternative. | ||||
Defined in Ouroboros.Consensus.Protocol.Praos2 | |||||
| newtype LeiosOnly (TPraos c) a b Source # | TPraos has no Leios fields. | ||||
Defined in Ouroboros.Consensus.Protocol.TPraos | |||||
| type Rep (LeiosOnly (Praos c) a b) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep (LeiosOnly (Praos c) a b) = D1 ('MetaData "LeiosOnly" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-5.0.0.0-inplace-protocol" 'True) (C1 ('MetaCons "PraosLacksLeios" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
| type Rep (LeiosOnly (Praos2 c) a b) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Praos2 type Rep (LeiosOnly (Praos2 c) a b) = D1 ('MetaData "LeiosOnly" "Ouroboros.Consensus.Protocol.Praos2" "ouroboros-consensus-5.0.0.0-inplace-protocol" 'True) (C1 ('MetaCons "Praos2HasLeios" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b))) | |||||
| type Rep (LeiosOnly (TPraos c) a b) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.TPraos type Rep (LeiosOnly (TPraos c) a b) = D1 ('MetaData "LeiosOnly" "Ouroboros.Consensus.Protocol.TPraos" "ouroboros-consensus-5.0.0.0-inplace-protocol" 'True) (C1 ('MetaCons "TPraosLacksLeios" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
type VoidUnlessLeios proto = LeiosOnly proto Void Source #
The constructor use of LeiosOnly: inhabited only when the protocol has
Leios.
type WhenLeios proto = LeiosOnly proto () Source #
The field use of LeiosOnly: present only when the protocol has Leios.
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) # | |||||||||||||||||||||||||||||
| Crypto c ⇒ NoThunks (ConsensusConfig (Praos c)) Source # | |||||||||||||||||||||||||||||
| PraosCrypto c ⇒ LeiosProtocol (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods getLeiosAnnouncement ∷ proxy (Praos c) → ValidateView (Praos c) → Maybe LeiosAnnouncement Source # validateLeiosAnnouncement ∷ ConsensusConfig (Praos c) → ValidateView (Praos c) → SlotNo → Ticked (ChainDepState (Praos c)) → Except (ValidationErr (Praos c)) OCINStaleness Source # getLeiosLedgerView ∷ proxy (Praos c) → LedgerView (Praos c) → Maybe LeiosLedgerView 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 # | |||||||||||||||||||||||||||||
| HasMaxMajorProtVer (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods protoMaxMajorPV ∷ ConsensusConfig (Praos c) → MaxMajorProtVer 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 # | |||||||||||||||||||||||||||||
| TypeSwitch (LeiosOnly (Praos c)) Source # | |||||||||||||||||||||||||||||
| PolyPraosCrypto (Praos StandardCrypto) StandardCrypto Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
| ForecastToPolyPraosLedgerView (Praos c) era Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods forecastToPolyPraosLedgerView ∷ ∀ (t ∷ Timeline). EraForecast era ⇒ Forecast t era → PolyPraosLedgerView (Praos c) Source # | |||||||||||||||||||||||||||||
| TranslateProto (Praos c) (Praos c) era Source # | Crossing between eras that both run this protocol changes nothing. | ||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods translateLedgerView ∷ Proxy (Praos c, Praos c, era) → TranslationContext era → LedgerView (Praos c) → LedgerView (Praos c) Source # translateChainDepState ∷ Proxy (Praos c, Praos c, era) → ChainDepState (Praos c) → ChainDepState (Praos c) Source # | |||||||||||||||||||||||||||||
| TranslationContext era ~ DijkstraGenesis ⇒ TranslateProto (Praos c) (Praos2 c) era Source # | Crossing from Praos into Praos with Leios. Everything carries over unchanged; the Leios fields merely have to be introduced. Nothing has been announced, since no header of the protocol being left could have carried an announcement. The Leios parameters come from the Dijkstra genesis. The committee is empty: none is seated until a stake snapshot rotation within the new era, beyond any forecast from the old one. | ||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos2 Methods translateLedgerView ∷ Proxy (Praos c, Praos2 c, era) → TranslationContext era → LedgerView (Praos c) → LedgerView (Praos2 c) Source # translateChainDepState ∷ Proxy (Praos c, Praos2 c, era) → ChainDepState (Praos c) → ChainDepState (Praos2 c) Source # | |||||||||||||||||||||||||||||
| TranslateProto (TPraos c) (Praos c) era Source # | We can translate between TPraos and Praos, provided:
| ||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods translateLedgerView ∷ Proxy (TPraos c, Praos c, era) → TranslationContext era → LedgerView (TPraos c) → LedgerView (Praos c) Source # translateChainDepState ∷ Proxy (TPraos c, Praos c, era) → ChainDepState (TPraos c) → ChainDepState (Praos c) Source # | |||||||||||||||||||||||||||||
| () ~ a ⇒ Applicative (LeiosOnly (Praos c) a) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods pure ∷ a0 → LeiosOnly (Praos c) a a0 # (<*>) ∷ LeiosOnly (Praos c) a (a0 → b) → LeiosOnly (Praos c) a a0 → LeiosOnly (Praos c) a b # liftA2 ∷ (a0 → b → c0) → LeiosOnly (Praos c) a a0 → LeiosOnly (Praos c) a b → LeiosOnly (Praos c) a c0 # (*>) ∷ LeiosOnly (Praos c) a a0 → LeiosOnly (Praos c) a b → LeiosOnly (Praos c) a b # (<*) ∷ LeiosOnly (Praos c) a a0 → LeiosOnly (Praos c) a b → LeiosOnly (Praos c) a a0 # | |||||||||||||||||||||||||||||
| Functor (LeiosOnly (Praos c) a) Source # | |||||||||||||||||||||||||||||
| Foldable (LeiosOnly (Praos c) a) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods fold ∷ Monoid m ⇒ LeiosOnly (Praos c) a m → m # foldMap ∷ Monoid m ⇒ (a0 → m) → LeiosOnly (Praos c) a a0 → m # foldMap' ∷ Monoid m ⇒ (a0 → m) → LeiosOnly (Praos c) a a0 → m # foldr ∷ (a0 → b → b) → b → LeiosOnly (Praos c) a a0 → b # foldr' ∷ (a0 → b → b) → b → LeiosOnly (Praos c) a a0 → b # foldl ∷ (b → a0 → b) → b → LeiosOnly (Praos c) a a0 → b # foldl' ∷ (b → a0 → b) → b → LeiosOnly (Praos c) a a0 → b # foldr1 ∷ (a0 → a0 → a0) → LeiosOnly (Praos c) a a0 → a0 # foldl1 ∷ (a0 → a0 → a0) → LeiosOnly (Praos c) a a0 → a0 # toList ∷ LeiosOnly (Praos c) a a0 → [a0] # null ∷ LeiosOnly (Praos c) a a0 → Bool # length ∷ LeiosOnly (Praos c) a a0 → Int # elem ∷ Eq a0 ⇒ a0 → LeiosOnly (Praos c) a a0 → Bool # maximum ∷ Ord a0 ⇒ LeiosOnly (Praos c) a a0 → a0 # minimum ∷ Ord a0 ⇒ LeiosOnly (Praos c) a a0 → a0 # | |||||||||||||||||||||||||||||
| Traversable (LeiosOnly (Praos c) a) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Methods traverse ∷ Applicative f ⇒ (a0 → f b) → LeiosOnly (Praos c) a a0 → f (LeiosOnly (Praos c) a b) # sequenceA ∷ Applicative f ⇒ LeiosOnly (Praos c) a (f a0) → f (LeiosOnly (Praos c) a a0) # mapM ∷ Monad m ⇒ (a0 → m b) → LeiosOnly (Praos c) a a0 → m (LeiosOnly (Praos c) a b) # sequence ∷ Monad m ⇒ LeiosOnly (Praos c) a (m a0) → m (LeiosOnly (Praos c) a a0) # | |||||||||||||||||||||||||||||
| Eq a ⇒ Eq (LeiosOnly (Praos c) a b) Source # | |||||||||||||||||||||||||||||
| Generic (LeiosOnly (Praos c) a b) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos Associated Types
| |||||||||||||||||||||||||||||
| Show a ⇒ Show (LeiosOnly (Praos c) a b) Source # | |||||||||||||||||||||||||||||
| NoThunks a ⇒ NoThunks (LeiosOnly (Praos c) a b) 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-5.0.0.0-inplace-protocol" '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 TiebreakerView (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 | |||||||||||||||||||||||||||||
| newtype LeiosOnly (Praos c) a b Source # | Praos is not Leios, so it holds the left alternative. | ||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
| type PraosProtocolSupportsNodeCrypto (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
| type ShelleyProtocolHeader (Praos c) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos | |||||||||||||||||||||||||||||
| type Rep (LeiosOnly (Praos c) a b) Source # | |||||||||||||||||||||||||||||
Defined in Ouroboros.Consensus.Protocol.Praos type Rep (LeiosOnly (Praos c) a b) = D1 ('MetaData "LeiosOnly" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-5.0.0.0-inplace-protocol" 'True) (C1 ('MetaCons "PraosLacksLeios" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||||||||||||||||||||||||||
class (Crypto c, PolyPraosCrypto (Praos c) c) ⇒ PraosCrypto c Source #
Instances
type PraosLedgerView c = PolyPraosLedgerView (Praos c) Source #
type PraosState c = PolyPraosState (Praos c) Source #
type PraosValidateView c = PolyPraosValidateView (Praos c) c Source #
type PraosValidationErr c = PolyPraosValidationErr (Praos c) c Source #
Re-exports
These were defined in this module before Ouroboros.Consensus.Protocol.PolyPraos existed. They are re-exported only for that historical reason, so that the modules importing them here did not need to change.
class (Crypto c, Signable DSIGN (OCertSignable c), Signable (VRF c) InputVRF, Signable (KES c) (Signed (ShelleyProtocolHeader proto))) ⇒ PolyPraosCrypto proto c Source #
What a protocol needs of its crypto: the Praos essentials, plus signing whichever header body it is the protocol for.
Instances
data PolyPraosState proto 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
| SerialisePraosState proto ⇒ FromCBOR (PolyPraosState proto) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos | |||||
| SerialisePraosState proto ⇒ ToCBOR (PolyPraosState proto) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods toCBOR ∷ PolyPraosState proto → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (PolyPraosState proto) → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PolyPraosState proto] → Size Source # | |||||
| Eq (WhenLeios proto (Either WhyNotCertifiable LeiosAnnouncement)) ⇒ Eq (PolyPraosState proto) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods (==) ∷ PolyPraosState proto → PolyPraosState proto → Bool # (/=) ∷ PolyPraosState proto → PolyPraosState proto → Bool # | |||||
| Generic (PolyPraosState proto) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Associated Types
Methods from ∷ PolyPraosState proto → Rep (PolyPraosState proto) x # to ∷ Rep (PolyPraosState proto) x → PolyPraosState proto # | |||||
| Show (WhenLeios proto (Either WhyNotCertifiable LeiosAnnouncement)) ⇒ Show (PolyPraosState proto) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods showsPrec ∷ Int → PolyPraosState proto → ShowS # show ∷ PolyPraosState proto → String # showList ∷ [PolyPraosState proto] → ShowS # | |||||
| (Typeable proto, NoThunks (WhenLeios proto (Either WhyNotCertifiable LeiosAnnouncement))) ⇒ NoThunks (PolyPraosState proto) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos | |||||
| ChainDepStateSupportsPeras (PolyPraosState proto) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods getEpochNonce ∷ PolyPraosState proto → Nonce Source # | |||||
| SerialisePraosState proto ⇒ Serialise (PolyPraosState proto) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods encode ∷ PolyPraosState proto → Encoding Source # decode ∷ Decoder s (PolyPraosState proto) Source # encodeList ∷ [PolyPraosState proto] → Encoding Source # decodeList ∷ Decoder s [PolyPraosState proto] Source # | |||||
| ChainDepStateSupportsPeras (Ticked (PolyPraosState proto)) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods getEpochNonce ∷ Ticked (PolyPraosState proto) → Nonce Source # | |||||
| data Ticked (PolyPraosState proto ∷ Type) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos | |||||
| type Rep (PolyPraosState proto) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos type Rep (PolyPraosState proto) = D1 ('MetaData "PolyPraosState" "Ouroboros.Consensus.Protocol.PolyPraos" "ouroboros-consensus-5.0.0.0-inplace-protocol" '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 "praosStatePreviousEpochNonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce)) :*: (S1 ('MetaSel ('Just "praosStateLabNonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce) :*: (S1 ('MetaSel ('Just "praosStateLastEpochBlockNonce") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Nonce) :*: S1 ('MetaSel ('Just "praosStateLeiosAnnouncement") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WhenLeios proto (Either WhyNotCertifiable LeiosAnnouncement)))))))) | |||||
data PolyPraosValidationErr proto 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) | |
| LeiosCertWithoutAnnouncement !(VoidUnlessLeios proto ()) !WhyNotCertifiable !(WithOrigin SlotNo) !SlotNo | The header sets its cert bit, but there is no announcement for the certificate to certify. |
| LeiosCertTooYoung !(VoidUnlessLeios proto ()) !SlotNo !SlotNo !SlotNo | The header sets its cert bit too soon after its predecessor's announcement: the announcement, voting and diffusion periods have not all elapsed. |
| LeiosEbTooBig !(VoidUnlessLeios proto ()) !Word32 !Word32 | The header announces an endorser block larger than the protocol parameters allow. |
Instances
| (Crypto c, Eq (VoidUnlessLeios proto ())) ⇒ Eq (PolyPraosValidationErr proto c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods (==) ∷ PolyPraosValidationErr proto c → PolyPraosValidationErr proto c → Bool # (/=) ∷ PolyPraosValidationErr proto c → PolyPraosValidationErr proto c → Bool # | |||||
| Generic (PolyPraosValidationErr proto c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Associated Types
Methods from ∷ PolyPraosValidationErr proto c → Rep (PolyPraosValidationErr proto c) x # to ∷ Rep (PolyPraosValidationErr proto c) x → PolyPraosValidationErr proto c # | |||||
| (Crypto c, Show (VoidUnlessLeios proto ())) ⇒ Show (PolyPraosValidationErr proto c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods showsPrec ∷ Int → PolyPraosValidationErr proto c → ShowS # show ∷ PolyPraosValidationErr proto c → String # showList ∷ [PolyPraosValidationErr proto c] → ShowS # | |||||
| (Typeable proto, Crypto c, NoThunks (VoidUnlessLeios proto ())) ⇒ NoThunks (PolyPraosValidationErr proto c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos | |||||
| type Rep (PolyPraosValidationErr proto c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos type Rep (PolyPraosValidationErr proto c) = D1 ('MetaData "PolyPraosValidationErr" "Ouroboros.Consensus.Protocol.PolyPraos" "ouroboros-consensus-5.0.0.0-inplace-protocol" '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))) :+: C1 ('MetaCons "LeiosCertWithoutAnnouncement" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VoidUnlessLeios proto ())) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 WhyNotCertifiable)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin SlotNo)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)))) :+: (C1 ('MetaCons "LeiosCertTooYoung" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VoidUnlessLeios proto ())) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo))) :+: C1 ('MetaCons "LeiosEbTooBig" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VoidUnlessLeios proto ())) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32))))))) | |||||
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.PolyPraos Associated Types
Methods from ∷ PraosCannotForge c → Rep (PraosCannotForge c) x # to ∷ Rep (PraosCannotForge c) x → PraosCannotForge c # | |||||
| Crypto c ⇒ Show (PraosCannotForge c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods showsPrec ∷ Int → PraosCannotForge c → ShowS # show ∷ PraosCannotForge c → String # showList ∷ [PraosCannotForge c] → ShowS # | |||||
| type Rep (PraosCannotForge c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos type Rep (PraosCannotForge c) = D1 ('MetaData "PraosCannotForge" "Ouroboros.Consensus.Protocol.PolyPraos" "ouroboros-consensus-5.0.0.0-inplace-protocol" '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))) | |||||
data PraosFields c toSign Source #
Constructors
| PraosFields | |
Fields
| |
Instances
| Generic (PraosFields c toSign) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Associated Types
Methods from ∷ PraosFields c toSign → Rep (PraosFields c toSign) x # to ∷ Rep (PraosFields c toSign) x → PraosFields c toSign # | |||||
| (Show toSign, Crypto c) ⇒ Show (PraosFields c toSign) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods showsPrec ∷ Int → PraosFields c toSign → ShowS # show ∷ PraosFields c toSign → String # showList ∷ [PraosFields c toSign] → ShowS # | |||||
| (NoThunks toSign, Crypto c) ⇒ NoThunks (PraosFields c toSign) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos | |||||
| type Rep (PraosFields c toSign) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos type Rep (PraosFields c toSign) = D1 ('MetaData "PraosFields" "Ouroboros.Consensus.Protocol.PolyPraos" "ouroboros-consensus-5.0.0.0-inplace-protocol" '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.PolyPraos Associated Types
Methods from ∷ PraosIsLeader c → Rep (PraosIsLeader c) x # to ∷ Rep (PraosIsLeader c) x → PraosIsLeader c # | |||||
| Crypto c ⇒ NoThunks (PraosIsLeader c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos | |||||
| type Rep (PraosIsLeader c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos type Rep (PraosIsLeader c) = D1 ('MetaData "PraosIsLeader" "Ouroboros.Consensus.Protocol.PolyPraos" "ouroboros-consensus-5.0.0.0-inplace-protocol" '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.PolyPraos Associated Types
| |||||
| NoThunks PraosParams Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos | |||||
| type Rep PraosParams Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos type Rep PraosParams = D1 ('MetaData "PraosParams" "Ouroboros.Consensus.Protocol.PolyPraos" "ouroboros-consensus-5.0.0.0-inplace-protocol" '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 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.PolyPraos Associated Types
| |||||
| Crypto c ⇒ Show (PraosToSign c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods showsPrec ∷ Int → PraosToSign c → ShowS # show ∷ PraosToSign c → String # showList ∷ [PraosToSign c] → ShowS # | |||||
| Crypto c ⇒ NoThunks (PraosToSign c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos | |||||
| type Rep (PraosToSign c) Source # | |||||
Defined in Ouroboros.Consensus.Protocol.PolyPraos type Rep (PraosToSign c) = D1 ('MetaData "PraosToSign" "Ouroboros.Consensus.Protocol.PolyPraos" "ouroboros-consensus-5.0.0.0-inplace-protocol" '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))))) | |||||
type SerialisePraosState proto = (Typeable proto, Applicative (WhenLeios proto), Traversable (WhenLeios proto)) Source #
What encoding PolyPraosState needs of its protocol.
LeiosOnly decides which fields are written. There is no inner version: the
snapshot version covers it, and the HFC's era index precedes it, so the codec
is already chosen when it is read.
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.
Ticked is used mainly in two ways:
Ticked (Ext)LedgerStatewhere its kind gets concretized toStateKind -> StateKindTicked (HeaderState blk)where its kind gets concretized toType -> Type
Instances
| Show (Ticked ()) Source # | |
| ChainDepStateSupportsPeras (Ticked (ChainDepState (BlockProtocol blk))) ⇒ ChainDepStateSupportsPeras (Ticked (HeaderState blk)) Source # | |
Defined in Ouroboros.Consensus.HeaderValidation Methods getEpochNonce ∷ Ticked (HeaderState blk) → Nonce Source # | |
| ChainDepStateSupportsPeras (Ticked (PolyPraosState proto)) Source # | |
Defined in Ouroboros.Consensus.Protocol.PolyPraos Methods getEpochNonce ∷ Ticked (PolyPraosState proto) → Nonce Source # | |
| ChainDepStateSupportsPeras (Ticked TPraosState) Source # | |
Defined in Ouroboros.Consensus.Protocol.TPraos Methods | |
| ChainDepStateSupportsPeras (Ticked ()) Source # | |
Defined in Ouroboros.Consensus.Protocol.Abstract Methods getEpochNonce ∷ Ticked () → Nonce Source # | |
| (NoThunks (TxIn blk), NoThunks (TxOut blk), HasLedgerTables (Ticked LedgerState) blk) ⇒ HasLedgerTables (Ticked ExtLedgerState) blk Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked ExtLedgerState blk mk → LedgerTables blk mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked ExtLedgerState blk any → LedgerTables blk mk → Ticked ExtLedgerState blk mk Source # | |
| (Bridge m a, HasLedgerTables (Ticked LedgerState) m) ⇒ HasLedgerTables (Ticked LedgerState) (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked LedgerState (DualBlock m a) mk → LedgerTables (DualBlock m a) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked LedgerState (DualBlock m a) any → LedgerTables (DualBlock m a) mk → Ticked LedgerState (DualBlock m a) mk Source # | |
| Bridge m a ⇒ GetTip (Ticked LedgerState (DualBlock m a)) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
| IsLedger LedgerState blk ⇒ GetTip (Ticked ExtLedgerState blk) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked ExtLedgerState blk mk → Point (Ticked ExtLedgerState blk) Source # | |
| LedgerStateSupportsPeras (Ticked LedgerState (DualBlock m a)) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods getPoolDistr ∷ Ticked LedgerState (DualBlock m a) EmptyMK → PoolDistr Source # getPerasParams ∷ proxy blk → Ticked LedgerState (DualBlock m a) EmptyMK → PerasParams blk Source # | |
| NoThunks (Ticked LedgerState (DualBlock m a) mk) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
| Show (Ticked (f a)) ⇒ Show (((Ticked ∷ Type → Type) :.: f) a) Source # | |
| NoThunks (Ticked (f a)) ⇒ NoThunks (((Ticked ∷ Type → Type) :.: f) a) Source # | |
| data Ticked TPraosState Source # | |
| data Ticked () Source # | |
Defined in Ouroboros.Consensus.Ticked | |
| data Ticked (HardForkChainDepState xs ∷ Type) Source # | |
| data Ticked (HeaderState blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.HeaderValidation | |
| data Ticked (PBftState c ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Protocol.PBFT | |
| newtype Ticked (WrapChainDepState blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.TypeFamilyWrappers | |
| data Ticked (PolyPraosState proto ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Protocol.PolyPraos | |
| type HeaderHash (Ticked l blk ∷ k2) Source # | |
Defined in Ouroboros.Consensus.Ticked | |
| data Ticked ExtLedgerState (blk ∷ Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended data Ticked ExtLedgerState (blk ∷ Type) (mk ∷ MapKind) = TickedExtLedgerState {
| |
| data Ticked LedgerState (HardForkBlock xs ∷ Type) (mk ∷ MapKind) Source # | |
| data Ticked LedgerState (DualBlock m a ∷ Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
checkIsLeaderPolyPraos ∷ PolyPraosCrypto proto c ⇒ PraosParams → PraosCanBeLeader c → SlotNo → Ticked (PolyPraosState proto) → Maybe (PraosIsLeader c) Source #
checkIsLeader for every Praos.
forgePraosFields ∷ (Crypto c, Signable (KES c) toSign, Monad m) ⇒ HotKey c m → PraosCanBeLeader c → PraosIsLeader c → (PraosToSign c → toSign) → m (PraosFields c toSign) Source #
getOpCertCountersPolyPraos ∷ PolyPraosState proto → Map (KeyHash 'BlockIssuer) Word64 Source #
getOpCertCounters for every Praos.
getPraosNoncesPolyPraos ∷ PolyPraosState proto → PraosNonces Source #
getPraosNonces for every Praos.
leiosContextFreeHeaderChecks ∷ (Applicative (WhenLeios proto), Foldable (WhenLeios proto), TypeSwitch (LeiosOnly proto)) ⇒ PolyPraosLedgerView proto → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto c) () Source #
The Leios header checks that read only the header and the ledger view.
Sound out of context: the bound they check is forecast for the header's own slot, so any path that validates the header reads the same value.
They run only for protocols with Leios, which are the ones that fill
typeSwitchR.
praosCheckCanForge ∷ PraosParams → SlotNo → KESInfo → Either (PraosCannotForge c) () Source #
reupdateChainDepStatePolyPraos ∷ Functor (WhenLeios proto) ⇒ PraosParams → EpochInfo (Except PastHorizonException) → PolyPraosValidateView proto c → SlotNo → Ticked (PolyPraosState proto) → PolyPraosState proto Source #
reupdateChainDepState for every Praos.
Re-update the chain dependent state as a result of processing a header.
This consists of: - Update the last applied block hash. - Update the evolving and (potentially) candidate nonces based on the position in the epoch. - Update the operational certificate counter. - Record the header's announcement, if any, replacing the previous one.
updateChainDepStatePolyPraos ∷ (PolyPraosCrypto proto c, Applicative (WhenLeios proto), Foldable (WhenLeios proto), TypeSwitch (LeiosOnly proto)) ⇒ PraosParams → EpochInfo (Except PastHorizonException) → PolyPraosValidateView proto c → SlotNo → Ticked (PolyPraosState proto) → Except (PolyPraosValidationErr proto c) (PolyPraosState proto) Source #
updateChainDepState for every Praos.
Validate and update the chain dependent state as a result of processing a new header.
This consists of:
- Validate the VRF checks
- Validate the KES checks
- Call reupdateChainDepState
tickChainDepStatePolyPraos ∷ Functor (WhenLeios proto) ⇒ EpochInfo (Except PastHorizonException) → PolyPraosLedgerView proto → SlotNo → PolyPraosState proto → Ticked (PolyPraosState proto) Source #
tickChainDepState for every Praos.
Updating the chain dependent state for Praos.
If we are not in a new epoch, then nothing happens. If we are in a new epoch, we do four things: - Store the existing current epoch nonce as the "previous epoch" nonce. This is needed to validate Peras certificates when they appear in blocks. - Update the epoch nonce to the combination of the candidate nonce and the nonce derived from the last block of the previous epoch. - Update the "last block of previous epoch" nonce to the nonce derived from the last applied block. - Mark the pending announcement as no longer certifiable, since an endorser block may not be certified across an epoch boundary.
validateKESSignature ∷ PolyPraosCrypto proto c ⇒ PraosParams → PolyPraosLedgerView proto → Map (KeyHash 'BlockIssuer) Word64 → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto c) () Source #
validateVRFSignature ∷ PolyPraosCrypto proto c ⇒ Nonce → PolyPraosLedgerView proto → ActiveSlotCoeff → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto c) () Source #
For testing purposes
doValidateKESSignature ∷ PolyPraosCrypto proto c ⇒ Word64 → Word64 → Map (KeyHash 'StakePool) IndividualPoolStake → Map (KeyHash 'BlockIssuer) Word64 → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto c) () Source #
doValidateVRFSignature ∷ PolyPraosCrypto proto c ⇒ Nonce → Map (KeyHash 'StakePool) IndividualPoolStake → ActiveSlotCoeff → PolyPraosValidateView proto c → Except (PolyPraosValidationErr proto c) () Source #