ouroboros-consensus-protocol-0.1.0.1: Cardano consensus protocols.
Safe Haskell None
Language Haskell2010

Ouroboros.Consensus.Protocol.TPraos

Description

Transitional Praos.

Transitional praos allows for the overlaying of Praos with an overlay schedule determining slots to be produced by BFT

Synopsis

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

Instances details
Eq MaxMajorProtVer Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Show MaxMajorProtVer Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Generic MaxMajorProtVer Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

NoThunks MaxMajorProtVer Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

type Rep MaxMajorProtVer Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

type Rep MaxMajorProtVer = D1 (' MetaData "MaxMajorProtVer" "Ouroboros.Consensus.Protocol.Praos.Common" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" ' True ) ( C1 (' MetaCons "MaxMajorProtVer" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getMaxMajorProtVer") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Natural )))

data PraosChainSelectView c Source #

View of the ledger tip for chain selection.

We order between chains as follows:

  1. By chain length, with longer chains always preferred.
  2. 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.
  3. By the leader value of the chain tip, with lower values preferred.

Instances

Instances details
Crypto c => Eq ( PraosChainSelectView c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Crypto c => Ord ( PraosChainSelectView c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Crypto c => Show ( PraosChainSelectView c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Generic ( PraosChainSelectView c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

Crypto c => NoThunks ( PraosChainSelectView c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

type Rep ( PraosChainSelectView c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Common

data TPraos c Source #

Instances

Instances details
Generic ( ConsensusConfig ( TPraos c)) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

PraosCrypto c => NoThunks ( ConsensusConfig ( TPraos c)) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

PraosCrypto c => ConsensusProtocol ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

PraosCrypto c => PraosProtocolSupportsNode ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

( HASH c1 ~ HASH c2, ADDRHASH c1 ~ ADDRHASH c2, VerKeyDSIGN c1 ~ VerKeyDSIGN c2, VerKeyVRF c1 ~ VerKeyVRF c2) => TranslateProto ( TPraos c1) ( Praos c2) Source #

We can translate between TPraos and Praos, provided:

  • They share the same HASH algorithm
  • They share the same ADDRHASH algorithm
  • They share the same DSIGN verification keys
  • They share the same VRF verification keys
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos.Translate

type Rep ( ConsensusConfig ( TPraos c)) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep ( ConsensusConfig ( TPraos c)) = D1 (' MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.TPraos" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" ' False ) ( C1 (' MetaCons "TPraosConfig" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "tpraosParams") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 TPraosParams ) :*: S1 (' MetaSel (' Just "tpraosEpochInfo") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( EpochInfo ( Except PastHorizonException )))))
data ConsensusConfig ( TPraos c) Source #

Static configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type ValidateView ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type ValidationErr ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type LedgerView ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type SelectView ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type CanBeLeader ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type IsLeader ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type ChainDepState ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type PraosProtocolSupportsNodeCrypto ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

data TPraosFields c toSign Source #

Constructors

TPraosFields

Instances

Instances details
( Show toSign, PraosCrypto c) => Show ( TPraosFields c toSign) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

Generic ( TPraosFields c toSign) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

Associated Types

type Rep ( TPraosFields c toSign) :: Type -> Type Source #

( NoThunks toSign, PraosCrypto c) => NoThunks ( TPraosFields c toSign) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

( Condense toSign, PraosCrypto c) => Condense ( TPraosFields c toSign) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep ( TPraosFields c toSign) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep ( TPraosFields c toSign) = D1 (' MetaData "TPraosFields" "Ouroboros.Consensus.Protocol.TPraos" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" ' False ) ( C1 (' MetaCons "TPraosFields" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "tpraosSignature") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( SignedKES c toSign)) :*: S1 (' MetaSel (' Just "tpraosToSign") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 toSign)))

data TPraosIsLeader c Source #

Assembled proof that the issuer has the right to issue a block in the selected slot.

Constructors

TPraosIsLeader

Fields

data TPraosParams Source #

TPraos parameters that are node independent

Constructors

TPraosParams

Fields

Instances

Instances details
Generic TPraosParams Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

NoThunks TPraosParams Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep TPraosParams Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

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.

Instances

Instances details
Eq ( TPraosState c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

Show ( TPraosState c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

Generic ( TPraosState c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

Associated Types

type Rep ( TPraosState c) :: Type -> Type Source #

PraosCrypto c => ToCBOR ( TPraosState c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

PraosCrypto c => FromCBOR ( TPraosState c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

PraosCrypto c => NoThunks ( TPraosState c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

PraosCrypto c => Serialise ( TPraosState c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep ( TPraosState c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep ( TPraosState c) = D1 (' MetaData "TPraosState" "Ouroboros.Consensus.Protocol.TPraos" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" ' False ) ( C1 (' MetaCons "TPraosState" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "tpraosStateLastSlot") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( WithOrigin SlotNo )) :*: S1 (' MetaSel (' Just "tpraosStateChainDepState") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( ChainDepState c))))
data Ticked ( TPraosState c) Source #

Ticked TPraosState

Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

data TPraosToSign c Source #

Fields arising from transitional praos execution which must be included in the block signature.

Constructors

TPraosToSign

Fields

Instances

Instances details
PraosCrypto c => Show ( TPraosToSign c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

Generic ( TPraosToSign c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

Associated Types

type Rep ( TPraosToSign c) :: Type -> Type Source #

PraosCrypto c => NoThunks ( TPraosToSign c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep ( TPraosToSign c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

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.

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.

Constructors

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 updateForgeState .

Fields

  • ! KESPeriod

    Current KES period according to the wallclock slot, i.e., the KES period in which we want to use the key.

  • ! KESPeriod

    Start KES period of the KES key.

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

Instances details
PraosCrypto c => Show ( TPraosCannotForge c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

Generic ( TPraosCannotForge c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep ( TPraosCannotForge c) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

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

Instances details
Generic ( ConsensusConfig ( TPraos c)) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

Generic ( ConsensusConfig ( Praos c)) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

PraosCrypto c => NoThunks ( ConsensusConfig ( TPraos c)) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

PraosCrypto c => NoThunks ( ConsensusConfig ( Praos c)) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

type Rep ( ConsensusConfig ( TPraos c)) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

type Rep ( ConsensusConfig ( TPraos c)) = D1 (' MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.TPraos" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" ' False ) ( C1 (' MetaCons "TPraosConfig" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "tpraosParams") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 TPraosParams ) :*: S1 (' MetaSel (' Just "tpraosEpochInfo") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( EpochInfo ( Except PastHorizonException )))))
type Rep ( ConsensusConfig ( Praos c)) Source #
Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

type Rep ( ConsensusConfig ( Praos c)) = D1 (' MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.Praos" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" ' 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 )))))
data ConsensusConfig ( TPraos c) Source #

Static configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

data ConsensusConfig ( Praos c) Source #

Static configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

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

Instances details
Show ( Ticked ())
Instance details

Defined in Ouroboros.Consensus.Ticked

Show ( Ticked a) => Show ( Ticked ( K a x))
Instance details

Defined in Ouroboros.Consensus.Ticked

Show ( Ticked (f a)) => Show (( Ticked :.: f) a)
Instance details

Defined in Ouroboros.Consensus.Ticked

NoThunks ( Ticked (f a)) => NoThunks (( Ticked :.: f) a)
Instance details

Defined in Ouroboros.Consensus.Ticked

data Ticked ()
Instance details

Defined in Ouroboros.Consensus.Ticked

newtype Ticked ( LedgerView c) Source #

Ledger view at a particular slot

Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

newtype Ticked ( LedgerView c) Source #

Ledger view at a particular slot

Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

data Ticked ( TPraosState c) Source #

Ticked TPraosState

Instance details

Defined in Ouroboros.Consensus.Protocol.TPraos

data Ticked ( PraosState c) Source #

Ticked PraosState

Instance details

Defined in Ouroboros.Consensus.Protocol.Praos

type HeaderHash ( Ticked l)
Instance details

Defined in Ouroboros.Consensus.Ledger.Basics

newtype Ticked ( K a x)
Instance details

Defined in Ouroboros.Consensus.Ticked