Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data family ConsensusConfig p
- data Praos c
- data PraosCannotForge c = PraosCannotForgeKeyNotUsableYet ! KESPeriod ! KESPeriod
- class ( Crypto c, Signable ( DSIGN c) ( OCertSignable c), Signable ( DSIGN c) ( Hash c EraIndependentTxBody ), Signable ( KES c) ( HeaderBody c), Signable ( VRF c) InputVRF ) => PraosCrypto c
-
data
PraosFields
c toSign =
PraosFields
{
- praosSignature :: SignedKES c toSign
- praosToSign :: toSign
- newtype PraosIsLeader c = PraosIsLeader { }
-
data
PraosParams
=
PraosParams
{
- praosSlotsPerKESPeriod :: ! Word64
- praosLeaderF :: ! ActiveSlotCoeff
- praosSecurityParam :: ! SecurityParam
- praosMaxKESEvo :: ! Word64
- praosQuorum :: ! Word64
- praosMaxMajorPV :: ! MaxMajorProtVer
- praosMaxLovelaceSupply :: ! Word64
- praosNetworkId :: ! Network
- praosSystemStart :: ! SystemStart
-
data
PraosState
c =
PraosState
{
- praosStateLastSlot :: !( WithOrigin SlotNo )
- praosStateOCertCounters :: !( Map ( KeyHash ' BlockIssuer c) Word64 )
- praosStateEvolvingNonce :: ! Nonce
- praosStateCandidateNonce :: ! Nonce
- praosStateEpochNonce :: ! Nonce
- praosStateLabNonce :: ! Nonce
- praosStateLastEpochBlockNonce :: ! Nonce
-
data
PraosToSign
c =
PraosToSign
{
- praosToSignIssuerVK :: VKey ' BlockIssuer c
- praosToSignVrfVK :: VerKeyVRF c
- praosToSignVrfRes :: CertifiedVRF c InputVRF
- praosToSignOCert :: OCert c
-
data
PraosValidationErr
c
- = VRFKeyUnknown !( KeyHash StakePool c)
- | VRFKeyWrongVRFKey !( KeyHash StakePool c) !( Hash c ( VerKeyVRF c)) !( Hash c ( VerKeyVRF 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 ! String
- | NoCounterForKeyHashOCERT !( KeyHash ' BlockIssuer c)
- data family Ticked st
- forgePraosFields :: ( PraosCrypto c, KESignable 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) ()
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
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.
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
PraosCrypto c => Show ( PraosCannotForge c) Source # | |
Defined in Ouroboros.Consensus.Protocol.Praos |
|
Generic ( PraosCannotForge c) Source # | |
Defined in Ouroboros.Consensus.Protocol.Praos from :: PraosCannotForge c -> Rep ( PraosCannotForge c) x Source # to :: Rep ( PraosCannotForge c) x -> PraosCannotForge c Source # |
|
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.1.0.1-zKRBoYOfUlKsvZd6xB0lb" '
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 c) ( OCertSignable c), Signable ( DSIGN c) ( Hash c EraIndependentTxBody ), Signable ( KES c) ( HeaderBody c), Signable ( VRF c) InputVRF ) => PraosCrypto c Source #
Instances
data PraosFields c toSign Source #
PraosFields | |
|
Instances
newtype PraosIsLeader c Source #
Assembled proof that the issuer has the right to issue a block in the selected slot.
Instances
Generic ( PraosIsLeader c) Source # | |
Defined in Ouroboros.Consensus.Protocol.Praos from :: PraosIsLeader c -> Rep ( PraosIsLeader c) x Source # to :: Rep ( PraosIsLeader c) x -> PraosIsLeader c Source # |
|
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.1.0.1-zKRBoYOfUlKsvZd6xB0lb" '
True
) (
C1
('
MetaCons
"PraosIsLeader" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"praosIsLeaderVrfRes") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
(
CertifiedVRF
c
InputVRF
))))
|
data PraosParams Source #
Praos parameters that are node independent
PraosParams | |
|
Instances
data PraosState c 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.
PraosState | |
|
Instances
data PraosToSign c Source #
Fields arising from praos execution which must be included in the block signature.
PraosToSign | |
|
Instances
data PraosValidationErr c Source #
Errors which we might encounter
VRFKeyUnknown !( KeyHash StakePool c) | |
VRFKeyWrongVRFKey !( KeyHash StakePool c) !( Hash c ( VerKeyVRF c)) !( Hash c ( VerKeyVRF 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 ! String | |
NoCounterForKeyHashOCERT !( KeyHash ' BlockIssuer c) |
Instances
data family Ticked st Source #
" Ticked " piece of state (
LedgerState
,
LedgerView
,
ChainIndepState
)
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 (or forecast).
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 ()) | |
Show ( Ticked a) => Show ( Ticked ( K a x)) | |
Show ( Ticked (f a)) => Show (( Ticked :.: f) a) | |
NoThunks ( Ticked (f a)) => NoThunks (( Ticked :.: f) a) | |
data Ticked () | |
Defined in Ouroboros.Consensus.Ticked |
|
newtype Ticked ( LedgerView c) Source # |
Ledger view at a particular slot |
Defined in Ouroboros.Consensus.Protocol.TPraos |
|
newtype Ticked ( LedgerView c) Source # |
Ledger view at a particular slot |
Defined in Ouroboros.Consensus.Protocol.Praos |
|
data Ticked ( TPraosState c) Source # |
Ticked
|
Defined in Ouroboros.Consensus.Protocol.TPraos |
|
data Ticked ( PraosState c) Source # |
Ticked
|
Defined in Ouroboros.Consensus.Protocol.Praos |
|
type HeaderHash ( Ticked l) | |
Defined in Ouroboros.Consensus.Ledger.Basics |
|
newtype Ticked ( K a x) | |
Defined in Ouroboros.Consensus.Ticked |
forgePraosFields :: ( PraosCrypto c, KESignable 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 #