ouroboros-consensus-0.28.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Peras.SelectView

Synopsis

WeightedSelectView

data WeightedSelectView proto Source #

Information from a non-empty chain fragment for a weighted chain comparison against other fragments with the same anchor.

Comparisons of fragments with different anchors are not possible in general, as the fragments might not intersect, and so some blocks after their intersection (and hence their weight boost) are unknown.

Constructors

WeightedSelectView 

Fields

Instances

Instances details
Show (TiebreakerView proto) ⇒ Show (WeightedSelectView proto) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.SelectView

Methods

showsPrecIntWeightedSelectView proto → ShowS #

showWeightedSelectView proto → String #

showList ∷ [WeightedSelectView proto] → ShowS #

Eq (TiebreakerView proto) ⇒ Eq (WeightedSelectView proto) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.SelectView

Methods

(==)WeightedSelectView proto → WeightedSelectView proto → Bool #

(/=)WeightedSelectView proto → WeightedSelectView proto → Bool #

Ord (TiebreakerView proto) ⇒ Ord (WeightedSelectView proto) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.SelectView

ChainOrder (TiebreakerView proto) ⇒ ChainOrder (WeightedSelectView proto) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.SelectView

type ChainOrderConfig (WeightedSelectView proto) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.SelectView

wsvTotalWeightWeightedSelectView proto → PerasWeight Source #

The total weight, ie the sum of wsvBlockNo and wsvBoostedWeight.

weightedSelectView ∷ (GetHeader1 h, HasHeader (h blk), HeaderHash blk ~ HeaderHash (h blk), BlockSupportsProtocol blk) ⇒ BlockConfig blk → PerasWeightSnapshot blk → AnchoredFragment (h blk) → WithEmptyFragment (WeightedSelectView (BlockProtocol blk)) Source #

Get the WeightedSelectView for a fragment using the given PerasWeightSnapshot. Note that this is only meanigful for comparisons against other fragments with the same anchor.

Returns EmptyFragment iff the input fragment is empty.

Utility: WithEmptyFragment

data WithEmptyFragment a Source #

Attach the possibility of an empty fragment to a type.

Instances

Instances details
Show a ⇒ Show (WithEmptyFragment a) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.SelectView

Eq a ⇒ Eq (WithEmptyFragment a) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.SelectView

Ord a ⇒ Ord (WithEmptyFragment a) Source #

Prefer non-empty fragments to empty ones.

Instance details

Defined in Ouroboros.Consensus.Peras.SelectView

ChainOrder a ⇒ ChainOrder (WithEmptyFragment a) Source #

Prefer non-empty fragments to empty ones. This instance assumes that the underlying fragments all have the same anchor.

Instance details

Defined in Ouroboros.Consensus.Peras.SelectView

type ChainOrderConfig (WithEmptyFragment a) Source # 
Instance details

Defined in Ouroboros.Consensus.Peras.SelectView