ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Peras.Types

Description

Base Peras types used throughout the codebase.

Synopsis

Peras round numbers

newtype PerasRoundNo Source #

Round number in a Peras election.

Constructors

PerasRoundNo 

Instances

Instances details
FromCBOR PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

ToCBOR PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Methods

toCBORPerasRoundNoEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy PerasRoundNoSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PerasRoundNo] → Size Source #

NFData PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Methods

rnfPerasRoundNo → () #

Eq PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Ord PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Bounded PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Enum PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Generic PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Associated Types

type Rep PerasRoundNo 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasRoundNo = D1 ('MetaData "PerasRoundNo" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'True) (C1 ('MetaCons "PerasRoundNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerasRoundNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))
Num PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Show PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

NoThunks PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Condense PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Serialise PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

SerialiseNodeToNode blk PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

ShowProxy PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasRoundNo Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasRoundNo = D1 ('MetaData "PerasRoundNo" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'True) (C1 ('MetaCons "PerasRoundNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerasRoundNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

onPerasRoundNo ∷ (Word64Word64Word64) → PerasRoundNoPerasRoundNoPerasRoundNo Source #

Lift a binary operation on Word64 to PerasRoundNo

Peras boosted blocks

newtype PerasBoostedBlock Source #

The slot number and 32-byte hash of the block being voted for.

NOTE: this type is mostly used in production votes and certificates, while mocked votes and certificates generally use the more abstract 'Point blk'.

Instances

Instances details
FromCBOR PerasBoostedBlock Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

ToCBOR PerasBoostedBlock Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Eq PerasBoostedBlock Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Generic PerasBoostedBlock Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Associated Types

type Rep PerasBoostedBlock 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasBoostedBlock = D1 ('MetaData "PerasBoostedBlock" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'True) (C1 ('MetaCons "PerasBoostedBlock" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerasBoostedBlock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WithOrigin Bytes32RealPoint))))
Show PerasBoostedBlock Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

NoThunks PerasBoostedBlock Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

(ConvertRawHash blk, HashSize blk ~ 32)BoostedBlockCompatibleWithPoint PerasBoostedBlock blk Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasBoostedBlock Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasBoostedBlock = D1 ('MetaData "PerasBoostedBlock" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'True) (C1 ('MetaCons "PerasBoostedBlock" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerasBoostedBlock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WithOrigin Bytes32RealPoint))))

type family BoostedBlock voteOrCert Source #

Instances

Instances details
type BoostedBlock (PerasCert' blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.SupportsPeras

type BoostedBlock (PerasCert' blk) = Point blk
type BoostedBlock (PerasVote' blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.SupportsPeras

type BoostedBlock (PerasVote' blk) = Point blk
type BoostedBlock (ValidatedPerasCert blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.SupportsPeras

type BoostedBlock (ValidatedPerasVote blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.SupportsPeras

type BoostedBlock (WithArrivalTime voteOrCert) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type BoostedBlock (WithArrivalTime voteOrCert) = BoostedBlock voteOrCert
type BoostedBlock (PerasCert blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Cert.V1

type BoostedBlock (VoidPerasCert blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Void

type BoostedBlock (VoidPerasVote blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Void

type BoostedBlock (PerasVote blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Vote.V1

class BoostedBlockCompatibleWithPoint boostedBlock blk where Source #

Conversion back and forth between boosted blocks and abstract points.

Methods

boostedBlockToPoint ∷ boostedBlock → Point blk Source #

pointToBoostedBlockPoint blk → boostedBlock Source #

Peras seat indices

newtype PerasSeatIndex Source #

Seat index in the voting committee used for Peras

Constructors

PerasSeatIndex 

Instances

Instances details
FromCBOR PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

ToCBOR PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

NFData PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Methods

rnfPerasSeatIndex → () #

Eq PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Ord PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Bounded PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Enum PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Generic PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Associated Types

type Rep PerasSeatIndex 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasSeatIndex = D1 ('MetaData "PerasSeatIndex" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'True) (C1 ('MetaCons "PerasSeatIndex" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerasSeatIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16)))
Show PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

NoThunks PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

SerialiseNodeToNode blk PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

type Rep PerasSeatIndex Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasSeatIndex = D1 ('MetaData "PerasSeatIndex" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'True) (C1 ('MetaCons "PerasSeatIndex" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerasSeatIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16)))

Peras vote parameters

data PerasVoteTarget blk Source #

The target of a vote in a Peras election

Constructors

PerasVoteTarget 

Fields

Instances

Instances details
StandardHash blk ⇒ Eq (PerasVoteTarget blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Methods

(==)PerasVoteTarget blk → PerasVoteTarget blk → Bool #

(/=)PerasVoteTarget blk → PerasVoteTarget blk → Bool #

StandardHash blk ⇒ Ord (PerasVoteTarget blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Generic (PerasVoteTarget blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Associated Types

type Rep (PerasVoteTarget blk) 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep (PerasVoteTarget blk) = D1 ('MetaData "PerasVoteTarget" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'False) (C1 ('MetaCons "PerasVoteTarget" 'PrefixI 'True) (S1 ('MetaSel ('Just "pvtRoundNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PerasRoundNo) :*: S1 ('MetaSel ('Just "pvtBlock") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Point blk))))

Methods

fromPerasVoteTarget blk → Rep (PerasVoteTarget blk) x #

toRep (PerasVoteTarget blk) x → PerasVoteTarget blk #

StandardHash blk ⇒ Show (PerasVoteTarget blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Methods

showsPrecIntPerasVoteTarget blk → ShowS #

showPerasVoteTarget blk → String #

showList ∷ [PerasVoteTarget blk] → ShowS #

StandardHash blk ⇒ NoThunks (PerasVoteTarget blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep (PerasVoteTarget blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep (PerasVoteTarget blk) = D1 ('MetaData "PerasVoteTarget" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'False) (C1 ('MetaCons "PerasVoteTarget" 'PrefixI 'True) (S1 ('MetaSel ('Just "pvtRoundNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PerasRoundNo) :*: S1 ('MetaSel ('Just "pvtBlock") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Point blk))))

data PerasVoteId Source #

The identifier of a vote in a Peras election

Instances

Instances details
FromCBOR PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

ToCBOR PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Methods

toCBORPerasVoteIdEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy PerasVoteIdSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PerasVoteId] → Size Source #

Eq PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Ord PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Generic PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

Associated Types

type Rep PerasVoteId 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasVoteId = D1 ('MetaData "PerasVoteId" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'False) (C1 ('MetaCons "PerasVoteId" 'PrefixI 'True) (S1 ('MetaSel ('Just "pviRoundNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PerasRoundNo) :*: S1 ('MetaSel ('Just "pviSeatIndex") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PerasSeatIndex)))
Show PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

NoThunks PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

SerialiseNodeToNode blk PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

ShowProxy PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasVoteId Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.Types

type Rep PerasVoteId = D1 ('MetaData "PerasVoteId" "Ouroboros.Consensus.Peras.Types" "ouroboros-consensus-4.0.0.0-inplace" 'False) (C1 ('MetaCons "PerasVoteId" 'PrefixI 'True) (S1 ('MetaSel ('Just "pviRoundNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PerasRoundNo) :*: S1 ('MetaSel ('Just "pviSeatIndex") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PerasSeatIndex)))

newtype VoteWeight Source #

Relative voting power of a voter in the committee selection scheme

Constructors

VoteWeight 

Instances

Instances details
FromCBOR VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

ToCBOR VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

Methods

toCBORVoteWeightEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy VoteWeightSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VoteWeight] → Size Source #

NFData VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

Methods

rnfVoteWeight → () #

Monoid VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

Semigroup VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

Eq VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

Methods

(==)VoteWeightVoteWeightBool #

(/=)VoteWeightVoteWeightBool #

Ord VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

Generic VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

Associated Types

type Rep VoteWeight 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

type Rep VoteWeight = D1 ('MetaData "VoteWeight" "Ouroboros.Consensus.Committee.Types" "ouroboros-consensus-4.0.0.0-inplace" 'True) (C1 ('MetaCons "VoteWeight" 'PrefixI 'True) (S1 ('MetaSel ('Just "unVoteWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)))
Num VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

Fractional VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

Show VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

NoThunks VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

type Rep VoteWeight Source # 
Instance details

Defined in Ouroboros.Consensus.Committee.Types

type Rep VoteWeight = D1 ('MetaData "VoteWeight" "Ouroboros.Consensus.Committee.Types" "ouroboros-consensus-4.0.0.0-inplace" 'True) (C1 ('MetaCons "VoteWeight" 'PrefixI 'True) (S1 ('MetaSel ('Just "unVoteWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)))