| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Peras.Types
Description
Base Peras types used throughout the codebase.
Synopsis
- newtype PerasRoundNo = PerasRoundNo {}
- onPerasRoundNo ∷ (Word64 → Word64 → Word64) → PerasRoundNo → PerasRoundNo → PerasRoundNo
- newtype PerasBoostedBlock = PerasBoostedBlock {}
- type family BoostedBlock voteOrCert
- class BoostedBlockCompatibleWithPoint boostedBlock blk where
- boostedBlockToPoint ∷ boostedBlock → Point blk
- pointToBoostedBlock ∷ Point blk → boostedBlock
- newtype PerasSeatIndex = PerasSeatIndex {}
- data PerasVoteTarget blk = PerasVoteTarget {
- pvtRoundNo ∷ !PerasRoundNo
- pvtBlock ∷ !(Point blk)
- data PerasVoteId = PerasVoteId {}
- newtype VoteWeight = VoteWeight {}
Peras round numbers
newtype PerasRoundNo Source #
Round number in a Peras election.
Constructors
| PerasRoundNo | |
Fields | |
Instances
onPerasRoundNo ∷ (Word64 → Word64 → Word64) → PerasRoundNo → PerasRoundNo → PerasRoundNo 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'.
Constructors
| PerasBoostedBlock | |
Instances
| FromCBOR PerasBoostedBlock Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types | |||||
| ToCBOR PerasBoostedBlock Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods toCBOR ∷ PerasBoostedBlock → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy PerasBoostedBlock → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PerasBoostedBlock] → Size Source # | |||||
| Eq PerasBoostedBlock Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods | |||||
| Generic PerasBoostedBlock Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Associated Types
Methods from ∷ PerasBoostedBlock → Rep PerasBoostedBlock x # to ∷ Rep PerasBoostedBlock x → PerasBoostedBlock # | |||||
| Show PerasBoostedBlock Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods showsPrec ∷ Int → PerasBoostedBlock → ShowS # show ∷ PerasBoostedBlock → String # showList ∷ [PerasBoostedBlock] → ShowS # | |||||
| NoThunks PerasBoostedBlock Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types | |||||
| (ConvertRawHash blk, HashSize blk ~ 32) ⇒ BoostedBlockCompatibleWithPoint PerasBoostedBlock blk Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods boostedBlockToPoint ∷ PerasBoostedBlock → Point blk Source # pointToBoostedBlock ∷ Point blk → PerasBoostedBlock Source # | |||||
| type Rep PerasBoostedBlock Source # | |||||
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
| type BoostedBlock (PerasCert' blk) Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras | |
| type BoostedBlock (PerasVote' blk) Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras | |
| type BoostedBlock (ValidatedPerasCert blk) Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras | |
| type BoostedBlock (ValidatedPerasVote blk) Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras | |
| type BoostedBlock (WithArrivalTime voteOrCert) Source # | |
Defined in Ouroboros.Consensus.Peras.Types | |
| type BoostedBlock (PerasCert blk) Source # | |
Defined in Ouroboros.Consensus.Peras.Cert.V1 | |
| type BoostedBlock (VoidPerasCert blk) Source # | |
Defined in Ouroboros.Consensus.Peras.Void | |
| type BoostedBlock (VoidPerasVote blk) Source # | |
Defined in Ouroboros.Consensus.Peras.Void | |
| type BoostedBlock (PerasVote blk) Source # | |
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 #
pointToBoostedBlock ∷ Point blk → boostedBlock Source #
Instances
| (ConvertRawHash blk, HashSize blk ~ 32) ⇒ BoostedBlockCompatibleWithPoint PerasBoostedBlock blk Source # | |
Defined in Ouroboros.Consensus.Peras.Types Methods boostedBlockToPoint ∷ PerasBoostedBlock → Point blk Source # pointToBoostedBlock ∷ Point blk → PerasBoostedBlock Source # | |
| BoostedBlockCompatibleWithPoint (Point blk) blk Source # | |
Defined in Ouroboros.Consensus.Peras.Types Methods boostedBlockToPoint ∷ Point blk → Point blk Source # pointToBoostedBlock ∷ Point blk → Point blk Source # | |
Peras seat indices
newtype PerasSeatIndex Source #
Seat index in the voting committee used for Peras
Constructors
| PerasSeatIndex | |
Fields | |
Instances
| FromCBOR PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types | |||||
| ToCBOR PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods toCBOR ∷ PerasSeatIndex → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy PerasSeatIndex → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PerasSeatIndex] → Size Source # | |||||
| NFData PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods rnf ∷ PerasSeatIndex → () # | |||||
| Eq PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods (==) ∷ PerasSeatIndex → PerasSeatIndex → Bool # (/=) ∷ PerasSeatIndex → PerasSeatIndex → Bool # | |||||
| Ord PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods compare ∷ PerasSeatIndex → PerasSeatIndex → Ordering # (<) ∷ PerasSeatIndex → PerasSeatIndex → Bool # (<=) ∷ PerasSeatIndex → PerasSeatIndex → Bool # (>) ∷ PerasSeatIndex → PerasSeatIndex → Bool # (>=) ∷ PerasSeatIndex → PerasSeatIndex → Bool # | |||||
| Bounded PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types | |||||
| Enum PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods succ ∷ PerasSeatIndex → PerasSeatIndex # pred ∷ PerasSeatIndex → PerasSeatIndex # toEnum ∷ Int → PerasSeatIndex # fromEnum ∷ PerasSeatIndex → Int # enumFrom ∷ PerasSeatIndex → [PerasSeatIndex] # enumFromThen ∷ PerasSeatIndex → PerasSeatIndex → [PerasSeatIndex] # enumFromTo ∷ PerasSeatIndex → PerasSeatIndex → [PerasSeatIndex] # enumFromThenTo ∷ PerasSeatIndex → PerasSeatIndex → PerasSeatIndex → [PerasSeatIndex] # | |||||
| Generic PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Associated Types
| |||||
| Show PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods showsPrec ∷ Int → PerasSeatIndex → ShowS # show ∷ PerasSeatIndex → String # showList ∷ [PerasSeatIndex] → ShowS # | |||||
| NoThunks PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types | |||||
| SerialiseNodeToNode blk PerasSeatIndex Source # | |||||
Defined in Ouroboros.Consensus.Node.Serialisation Methods encodeNodeToNode ∷ CodecConfig blk → BlockNodeToNodeVersion blk → PerasSeatIndex → Encoding Source # decodeNodeToNode ∷ CodecConfig blk → BlockNodeToNodeVersion blk → ∀ s. Decoder s PerasSeatIndex Source # | |||||
| type Rep PerasSeatIndex Source # | |||||
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
| StandardHash blk ⇒ Eq (PerasVoteTarget blk) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods (==) ∷ PerasVoteTarget blk → PerasVoteTarget blk → Bool # (/=) ∷ PerasVoteTarget blk → PerasVoteTarget blk → Bool # | |||||
| StandardHash blk ⇒ Ord (PerasVoteTarget blk) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods compare ∷ PerasVoteTarget blk → PerasVoteTarget blk → Ordering # (<) ∷ PerasVoteTarget blk → PerasVoteTarget blk → Bool # (<=) ∷ PerasVoteTarget blk → PerasVoteTarget blk → Bool # (>) ∷ PerasVoteTarget blk → PerasVoteTarget blk → Bool # (>=) ∷ PerasVoteTarget blk → PerasVoteTarget blk → Bool # max ∷ PerasVoteTarget blk → PerasVoteTarget blk → PerasVoteTarget blk # min ∷ PerasVoteTarget blk → PerasVoteTarget blk → PerasVoteTarget blk # | |||||
| Generic (PerasVoteTarget blk) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Associated Types
Methods from ∷ PerasVoteTarget blk → Rep (PerasVoteTarget blk) x # to ∷ Rep (PerasVoteTarget blk) x → PerasVoteTarget blk # | |||||
| StandardHash blk ⇒ Show (PerasVoteTarget blk) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods showsPrec ∷ Int → PerasVoteTarget blk → ShowS # show ∷ PerasVoteTarget blk → String # showList ∷ [PerasVoteTarget blk] → ShowS # | |||||
| StandardHash blk ⇒ NoThunks (PerasVoteTarget blk) Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types | |||||
| type Rep (PerasVoteTarget blk) Source # | |||||
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
Constructors
| PerasVoteId | |
Fields | |
Instances
| FromCBOR PerasVoteId Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types | |||||
| ToCBOR PerasVoteId Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods toCBOR ∷ PerasVoteId → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy PerasVoteId → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PerasVoteId] → Size Source # | |||||
| Eq PerasVoteId Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types | |||||
| Ord PerasVoteId Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods compare ∷ PerasVoteId → PerasVoteId → Ordering # (<) ∷ PerasVoteId → PerasVoteId → Bool # (<=) ∷ PerasVoteId → PerasVoteId → Bool # (>) ∷ PerasVoteId → PerasVoteId → Bool # (>=) ∷ PerasVoteId → PerasVoteId → Bool # max ∷ PerasVoteId → PerasVoteId → PerasVoteId # min ∷ PerasVoteId → PerasVoteId → PerasVoteId # | |||||
| Generic PerasVoteId Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Associated Types
| |||||
| Show PerasVoteId Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods showsPrec ∷ Int → PerasVoteId → ShowS # show ∷ PerasVoteId → String # showList ∷ [PerasVoteId] → ShowS # | |||||
| NoThunks PerasVoteId Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types | |||||
| SerialiseNodeToNode blk PerasVoteId Source # | |||||
Defined in Ouroboros.Consensus.Node.Serialisation Methods encodeNodeToNode ∷ CodecConfig blk → BlockNodeToNodeVersion blk → PerasVoteId → Encoding Source # decodeNodeToNode ∷ CodecConfig blk → BlockNodeToNodeVersion blk → ∀ s. Decoder s PerasVoteId Source # | |||||
| ShowProxy PerasVoteId Source # | |||||
Defined in Ouroboros.Consensus.Peras.Types Methods showProxy ∷ Proxy PerasVoteId → String # | |||||
| type Rep PerasVoteId Source # | |||||
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 | |
Fields | |
Instances
| FromCBOR VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types | |||||
| ToCBOR VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types Methods toCBOR ∷ VoteWeight → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy VoteWeight → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VoteWeight] → Size Source # | |||||
| NFData VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types Methods rnf ∷ VoteWeight → () # | |||||
| Monoid VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types | |||||
| Semigroup VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types Methods (<>) ∷ VoteWeight → VoteWeight → VoteWeight # sconcat ∷ NonEmpty VoteWeight → VoteWeight # stimes ∷ Integral b ⇒ b → VoteWeight → VoteWeight # | |||||
| Eq VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types | |||||
| Ord VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types Methods compare ∷ VoteWeight → VoteWeight → Ordering # (<) ∷ VoteWeight → VoteWeight → Bool # (<=) ∷ VoteWeight → VoteWeight → Bool # (>) ∷ VoteWeight → VoteWeight → Bool # (>=) ∷ VoteWeight → VoteWeight → Bool # max ∷ VoteWeight → VoteWeight → VoteWeight # min ∷ VoteWeight → VoteWeight → VoteWeight # | |||||
| Generic VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types Associated Types
| |||||
| Num VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types Methods (+) ∷ VoteWeight → VoteWeight → VoteWeight # (-) ∷ VoteWeight → VoteWeight → VoteWeight # (*) ∷ VoteWeight → VoteWeight → VoteWeight # negate ∷ VoteWeight → VoteWeight # abs ∷ VoteWeight → VoteWeight # signum ∷ VoteWeight → VoteWeight # | |||||
| Fractional VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types | |||||
| Show VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types Methods showsPrec ∷ Int → VoteWeight → ShowS # show ∷ VoteWeight → String # showList ∷ [VoteWeight] → ShowS # | |||||
| NoThunks VoteWeight Source # | |||||
Defined in Ouroboros.Consensus.Committee.Types | |||||
| type Rep VoteWeight Source # | |||||
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))) | |||||