Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Block.SupportsPeras
Contents
Synopsis
- newtype PerasRoundNo = PerasRoundNo {}
- newtype PerasWeight = PerasWeight {}
- boostPerCert ∷ PerasWeight
- class (Show (PerasCfg blk), NoThunks (PerasCert blk)) ⇒ BlockSupportsPeras blk where
- data PerasCfg blk
- data PerasCert blk
- data PerasValidationErr blk
- validatePerasCert ∷ PerasCfg blk → PerasCert blk → Either (PerasValidationErr blk) (ValidatedPerasCert blk)
- data family PerasCert blk
- data ValidatedPerasCert blk = ValidatedPerasCert {
- vpcCert ∷ !(PerasCert blk)
- vpcCertBoost ∷ !PerasWeight
- makePerasCfg ∷ Maybe (BlockConfig blk) → PerasCfg blk
- class StandardHash blk ⇒ HasPerasCert (cert ∷ Type → Type) blk where
- getPerasCert ∷ cert blk → PerasCert blk
- getPerasCertRound ∷ HasPerasCert cert blk ⇒ cert blk → PerasRoundNo
- getPerasCertBoostedBlock ∷ HasPerasCert cert blk ⇒ cert blk → Point blk
- getPerasCertBoost ∷ ValidatedPerasCert blk → PerasWeight
- newtype PerasRoundLength = PerasRoundLength {}
- defaultPerasRoundLength ∷ PerasRoundLength
Documentation
newtype PerasRoundNo Source #
Constructors
PerasRoundNo | |
Fields |
Instances
newtype PerasWeight Source #
Constructors
PerasWeight | |
Fields |
Instances
Monoid PerasWeight Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras | |||||
Semigroup PerasWeight Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods (<>) ∷ PerasWeight → PerasWeight → PerasWeight # sconcat ∷ NonEmpty PerasWeight → PerasWeight # stimes ∷ Integral b ⇒ b → PerasWeight → PerasWeight # | |||||
Generic PerasWeight Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Associated Types
| |||||
Show PerasWeight Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods showsPrec ∷ Int → PerasWeight → ShowS # show ∷ PerasWeight → String # showList ∷ [PerasWeight] → ShowS # | |||||
Eq PerasWeight Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras | |||||
Ord PerasWeight Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods compare ∷ PerasWeight → PerasWeight → Ordering # (<) ∷ PerasWeight → PerasWeight → Bool # (<=) ∷ PerasWeight → PerasWeight → Bool # (>) ∷ PerasWeight → PerasWeight → Bool # (>=) ∷ PerasWeight → PerasWeight → Bool # max ∷ PerasWeight → PerasWeight → PerasWeight # min ∷ PerasWeight → PerasWeight → PerasWeight # | |||||
NoThunks PerasWeight Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras | |||||
Condense PerasWeight Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods condense ∷ PerasWeight → String Source # | |||||
type Rep PerasWeight Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras type Rep PerasWeight = D1 ('MetaData "PerasWeight" "Ouroboros.Consensus.Block.SupportsPeras" "ouroboros-consensus-0.27.0.0-inplace" 'True) (C1 ('MetaCons "PerasWeight" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerasWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
boostPerCert ∷ PerasWeight Source #
TODO: this will become a Ledger protocol parameter see https://github.com/tweag/cardano-peras/issues/119
class (Show (PerasCfg blk), NoThunks (PerasCert blk)) ⇒ BlockSupportsPeras blk where Source #
Associated Types
data PerasValidationErr blk Source #
Methods
validatePerasCert ∷ PerasCfg blk → PerasCert blk → Either (PerasValidationErr blk) (ValidatedPerasCert blk) Source #
Instances
StandardHash blk ⇒ BlockSupportsPeras blk Source # | |||||||||||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Associated Types
Methods validatePerasCert ∷ PerasCfg blk → PerasCert blk → Either (PerasValidationErr blk) (ValidatedPerasCert blk) Source # |
data family PerasCert blk Source #
Instances
StandardHash blk ⇒ HasPerasCert PerasCert blk Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasCert ∷ PerasCert blk → PerasCert blk Source # | |||||
ShowProxy blk ⇒ ShowProxy (PerasCert blk ∷ Type) Source # | |||||
Generic (PerasCert blk) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Associated Types
| |||||
StandardHash blk ⇒ Show (PerasCert blk) Source # | |||||
StandardHash blk ⇒ Eq (PerasCert blk) Source # | |||||
StandardHash blk ⇒ Ord (PerasCert blk) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras | |||||
StandardHash blk ⇒ NoThunks (PerasCert blk) Source # | |||||
Serialise (HeaderHash blk) ⇒ Serialise (PerasCert blk) Source # | |||||
data PerasCert blk Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras | |||||
type Rep (PerasCert blk) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras type Rep (PerasCert blk) = D1 ('MetaData "PerasCert" "Ouroboros.Consensus.Block.SupportsPeras" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "PerasCert" 'PrefixI 'True) (S1 ('MetaSel ('Just "pcCertRound") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PerasRoundNo) :*: S1 ('MetaSel ('Just "pcCertBoostedBlock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Point blk)))) |
data ValidatedPerasCert blk Source #
Constructors
ValidatedPerasCert | |
Fields
|
Instances
StandardHash blk ⇒ HasPerasCert ValidatedPerasCert blk Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasCert ∷ ValidatedPerasCert blk → PerasCert blk Source # | |||||
Generic (ValidatedPerasCert blk) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Associated Types
Methods from ∷ ValidatedPerasCert blk → Rep (ValidatedPerasCert blk) x # to ∷ Rep (ValidatedPerasCert blk) x → ValidatedPerasCert blk # | |||||
StandardHash blk ⇒ Show (ValidatedPerasCert blk) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods showsPrec ∷ Int → ValidatedPerasCert blk → ShowS # show ∷ ValidatedPerasCert blk → String # showList ∷ [ValidatedPerasCert blk] → ShowS # | |||||
StandardHash blk ⇒ Eq (ValidatedPerasCert blk) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods (==) ∷ ValidatedPerasCert blk → ValidatedPerasCert blk → Bool # (/=) ∷ ValidatedPerasCert blk → ValidatedPerasCert blk → Bool # | |||||
StandardHash blk ⇒ Ord (ValidatedPerasCert blk) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods compare ∷ ValidatedPerasCert blk → ValidatedPerasCert blk → Ordering # (<) ∷ ValidatedPerasCert blk → ValidatedPerasCert blk → Bool # (<=) ∷ ValidatedPerasCert blk → ValidatedPerasCert blk → Bool # (>) ∷ ValidatedPerasCert blk → ValidatedPerasCert blk → Bool # (>=) ∷ ValidatedPerasCert blk → ValidatedPerasCert blk → Bool # max ∷ ValidatedPerasCert blk → ValidatedPerasCert blk → ValidatedPerasCert blk # min ∷ ValidatedPerasCert blk → ValidatedPerasCert blk → ValidatedPerasCert blk # | |||||
StandardHash blk ⇒ NoThunks (ValidatedPerasCert blk) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras | |||||
type Rep (ValidatedPerasCert blk) Source # | |||||
Defined in Ouroboros.Consensus.Block.SupportsPeras type Rep (ValidatedPerasCert blk) = D1 ('MetaData "ValidatedPerasCert" "Ouroboros.Consensus.Block.SupportsPeras" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "ValidatedPerasCert" 'PrefixI 'True) (S1 ('MetaSel ('Just "vpcCert") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PerasCert blk)) :*: S1 ('MetaSel ('Just "vpcCertBoost") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PerasWeight))) |
makePerasCfg ∷ Maybe (BlockConfig blk) → PerasCfg blk Source #
Derive a PerasCfg
from a BlockConfig
TODO: this currently doesn't depend on BlockConfig
at all, but likely will
depend on it in the future
see https://github.com/tweag/cardano-peras/issues/73
class StandardHash blk ⇒ HasPerasCert (cert ∷ Type → Type) blk where Source #
Methods
getPerasCert ∷ cert blk → PerasCert blk Source #
Instances
StandardHash blk ⇒ HasPerasCert PerasCert blk Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasCert ∷ PerasCert blk → PerasCert blk Source # | |
StandardHash blk ⇒ HasPerasCert ValidatedPerasCert blk Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods getPerasCert ∷ ValidatedPerasCert blk → PerasCert blk Source # |
getPerasCertRound ∷ HasPerasCert cert blk ⇒ cert blk → PerasRoundNo Source #
getPerasCertBoostedBlock ∷ HasPerasCert cert blk ⇒ cert blk → Point blk Source #
Ouroboros Peras round length
newtype PerasRoundLength Source #
Constructors
PerasRoundLength | |
Fields |
Instances
Num PerasRoundLength Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods (+) ∷ PerasRoundLength → PerasRoundLength → PerasRoundLength # (-) ∷ PerasRoundLength → PerasRoundLength → PerasRoundLength # (*) ∷ PerasRoundLength → PerasRoundLength → PerasRoundLength # negate ∷ PerasRoundLength → PerasRoundLength # abs ∷ PerasRoundLength → PerasRoundLength # | |
Show PerasRoundLength Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods showsPrec ∷ Int → PerasRoundLength → ShowS # show ∷ PerasRoundLength → String # showList ∷ [PerasRoundLength] → ShowS # | |
Eq PerasRoundLength Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods | |
Ord PerasRoundLength Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras Methods compare ∷ PerasRoundLength → PerasRoundLength → Ordering # (<) ∷ PerasRoundLength → PerasRoundLength → Bool # (<=) ∷ PerasRoundLength → PerasRoundLength → Bool # (>) ∷ PerasRoundLength → PerasRoundLength → Bool # (>=) ∷ PerasRoundLength → PerasRoundLength → Bool # max ∷ PerasRoundLength → PerasRoundLength → PerasRoundLength # min ∷ PerasRoundLength → PerasRoundLength → PerasRoundLength # | |
NoThunks PerasRoundLength Source # | |
Defined in Ouroboros.Consensus.Block.SupportsPeras |
defaultPerasRoundLength ∷ PerasRoundLength Source #
See the Protocol parameters section of the Peras design report: https://tweag.github.io/cardano-peras/peras-design.pdf#section.2.1 TODO: this will become a Ledger protocol parameter see https://github.com/tweag/cardano-peras/issues/119