Safe Haskell | None |
---|---|
Language | Haskell2010 |
Transitional Praos.
Transitional praos allows for the overlaying of Praos with an overlay schedule determining slots to be produced by BFT
Synopsis
- newtype MaxMajorProtVer = MaxMajorProtVer { }
-
data
PraosChainSelectView
c =
PraosChainSelectView
{
- csvChainLength :: BlockNo
- csvSlotNo :: SlotNo
- csvIssuer :: VKey ' BlockIssuer c
- csvIssueNo :: Word64
- csvLeaderVRF :: OutputVRF ( VRF c)
- data TPraos c
-
data
TPraosFields
c toSign =
TPraosFields
{
- tpraosSignature :: SignedKES c toSign
- tpraosToSign :: toSign
-
data
TPraosIsLeader
c =
TPraosIsLeader
{
- tpraosIsLeaderEta :: CertifiedVRF c Nonce
- tpraosIsLeaderProof :: CertifiedVRF c Natural
- tpraosIsLeaderGenVRFHash :: Maybe ( Hash c ( VerKeyVRF c))
-
data
TPraosParams
=
TPraosParams
{
- tpraosSlotsPerKESPeriod :: ! Word64
- tpraosLeaderF :: ! ActiveSlotCoeff
- tpraosSecurityParam :: ! SecurityParam
- tpraosMaxKESEvo :: ! Word64
- tpraosQuorum :: ! Word64
- tpraosMaxMajorPV :: ! MaxMajorProtVer
- tpraosMaxLovelaceSupply :: ! Word64
- tpraosNetworkId :: ! Network
- tpraosInitialNonce :: ! Nonce
- tpraosSystemStart :: ! SystemStart
-
data
TPraosState
c =
TPraosState
{
- tpraosStateLastSlot :: !( WithOrigin SlotNo )
- tpraosStateChainDepState :: !( ChainDepState c)
-
data
TPraosToSign
c =
TPraosToSign
{
- tpraosToSignIssuerVK :: VKey ' BlockIssuer c
- tpraosToSignVrfVK :: VerKeyVRF c
- tpraosToSignEta :: CertifiedVRF c Nonce
- tpraosToSignLeader :: CertifiedVRF c Natural
- tpraosToSignOCert :: OCert c
- type TPraosValidateView c = BHeader c
- forgeTPraosFields :: ( PraosCrypto c, KESignable c toSign, Monad m) => HotKey c m -> CanBeLeader ( TPraos c) -> IsLeader ( TPraos c) -> ( TPraosToSign c -> toSign) -> m ( TPraosFields c toSign)
- mkShelleyGlobals :: ConsensusConfig ( TPraos c) -> Globals
- mkTPraosParams :: MaxMajorProtVer -> Nonce -> ShelleyGenesis era -> TPraosParams
- class ( Crypto c, DSignable c ( OCertSignable c), KESignable c ( BHBody c), VRFSignable c Seed ) => PraosCrypto c
- data StandardCrypto
-
data
TPraosCannotForge
c
- = TPraosCannotForgeKeyNotUsableYet ! KESPeriod ! KESPeriod
- | TPraosCannotForgeWrongVRF !( Hash c ( VerKeyVRF c)) !( Hash c ( VerKeyVRF c))
- tpraosCheckCanForge :: ConsensusConfig ( TPraos c) -> Hash c ( VerKeyVRF c) -> SlotNo -> IsLeader ( TPraos c) -> KESInfo -> Either ( TPraosCannotForge c) ()
- data family ConsensusConfig p
- data family Ticked st
Documentation
newtype MaxMajorProtVer Source #
The maximum major protocol version.
Must be at least the current major protocol version. For Cardano mainnet, the Shelley era has major protocol verison 2 .
Instances
data PraosChainSelectView c Source #
View of the ledger tip for chain selection.
We order between chains as follows:
- By chain length, with longer chains always preferred.
- If the tip of each chain was issued by the same agent, then we prefer the chain whose tip has the highest ocert issue number.
- By the leader value of the chain tip, with lower values preferred.
PraosChainSelectView | |
|
Instances
Instances
data TPraosFields c toSign Source #
TPraosFields | |
|
Instances
data TPraosIsLeader c Source #
Assembled proof that the issuer has the right to issue a block in the selected slot.
TPraosIsLeader | |
|
Instances
data TPraosParams Source #
TPraos parameters that are node independent
TPraosParams | |
|
Instances
data TPraosState c Source #
Transitional Praos consensus state.
In addition to the
ChainDepState
provided by the ledger, we track the slot
number of the last applied header.
TPraosState | |
|
Instances
data TPraosToSign c Source #
Fields arising from transitional praos execution which must be included in the block signature.
TPraosToSign | |
|
Instances
type TPraosValidateView c = BHeader c Source #
Because we are using the executable spec, rather than implementing the protocol directly here, we have a fixed header type rather than an abstraction. So our validate view is fixed to this.
forgeTPraosFields :: ( PraosCrypto c, KESignable c toSign, Monad m) => HotKey c m -> CanBeLeader ( TPraos c) -> IsLeader ( TPraos c) -> ( TPraosToSign c -> toSign) -> m ( TPraosFields c toSign) Source #
mkShelleyGlobals :: ConsensusConfig ( TPraos c) -> Globals Source #
:: MaxMajorProtVer | |
-> Nonce |
Initial nonce |
-> ShelleyGenesis era | |
-> TPraosParams |
Crypto
class ( Crypto c, DSignable c ( OCertSignable c), KESignable c ( BHBody c), VRFSignable c Seed ) => PraosCrypto c Source #
Instances
PraosCrypto StandardCrypto | |
Defined in Cardano.Protocol.TPraos.API |
data StandardCrypto Source #
The same crypto used on the net
Instances
Crypto StandardCrypto | |
Defined in Cardano.Ledger.Crypto type HASH StandardCrypto Source # type ADDRHASH StandardCrypto Source # type DSIGN StandardCrypto Source # type KES StandardCrypto Source # type VRF StandardCrypto Source # |
|
PraosCrypto StandardCrypto | |
Defined in Cardano.Protocol.TPraos.API |
|
PraosCrypto StandardCrypto Source # | |
Defined in Ouroboros.Consensus.Protocol.Praos |
|
type VRF StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
|
type KES StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
|
type DSIGN StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
|
type ADDRHASH StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
|
type HASH StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
CannotForge
data TPraosCannotForge c Source #
Expresses that, whilst we believe ourselves to be a leader for this slot, we are nonetheless unable to forge a block.
TPraosCannotForgeKeyNotUsableYet |
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
|
TPraosCannotForgeWrongVRF !( Hash c ( VerKeyVRF c)) !( Hash c ( VerKeyVRF c)) |
We are a genesis delegate, but our VRF key (second argument) does not match the registered key for that delegate (first argument). |
Instances
:: ConsensusConfig ( TPraos c) | |
-> Hash c ( VerKeyVRF c) |
Precomputed hash of the VRF verification key |
-> SlotNo | |
-> IsLeader ( TPraos c) | |
-> KESInfo | |
-> Either ( TPraosCannotForge c) () |
Type instances
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
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 |