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

Ouroboros.Consensus.Protocol.Abstract

Synopsis

Abstract definition of the Ouroboros protocol

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 (HardForkProtocol xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

Associated Types

type Rep (ConsensusConfig (HardForkProtocol xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type Rep (ConsensusConfig (HardForkProtocol xs)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.HardFork.Combinator.Basics" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "HardForkConsensusConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "hardForkConsensusConfigK") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SecurityParam) :*: (S1 ('MetaSel ('Just "hardForkConsensusConfigShape") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Shape xs)) :*: S1 ('MetaSel ('Just "hardForkConsensusConfigPerEra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PerEraConsensusConfig xs)))))
Generic (ConsensusConfig (Bft c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

Associated Types

type Rep (ConsensusConfig (Bft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type Rep (ConsensusConfig (Bft c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.BFT" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "BftConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "bftParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BftParams) :*: (S1 ('MetaSel ('Just "bftSignKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignKeyDSIGN (BftDSIGN c))) :*: S1 ('MetaSel ('Just "bftVerKeys") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map NodeId (VerKeyDSIGN (BftDSIGN c)))))))

Methods

fromConsensusConfig (Bft c) → Rep (ConsensusConfig (Bft c)) x #

toRep (ConsensusConfig (Bft c)) x → ConsensusConfig (Bft c) #

Generic (ConsensusConfig (ModChainSel p t)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.ModChainSel

Associated Types

type Rep (ConsensusConfig (ModChainSel p t)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.ModChainSel

type Rep (ConsensusConfig (ModChainSel p t)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.ModChainSel" "ouroboros-consensus-0.27.0.0-inplace" 'True) (C1 ('MetaCons "McsConsensusConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "mcsConfigP") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConsensusConfig p))))
Generic (ConsensusConfig (PBft c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

Associated Types

type Rep (ConsensusConfig (PBft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type Rep (ConsensusConfig (PBft c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.PBFT" "ouroboros-consensus-0.27.0.0-inplace" 'True) (C1 ('MetaCons "PBftConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "pbftParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PBftParams)))
CanHardFork xs ⇒ NoThunks (ConsensusConfig (HardForkProtocol xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

BftCrypto c ⇒ NoThunks (ConsensusConfig (Bft c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

ConsensusProtocol p ⇒ NoThunks (ConsensusConfig (ModChainSel p t)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.ModChainSel

NoThunks (ConsensusConfig (PBft c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type Rep (ConsensusConfig (HardForkProtocol xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type Rep (ConsensusConfig (HardForkProtocol xs)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.HardFork.Combinator.Basics" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "HardForkConsensusConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "hardForkConsensusConfigK") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SecurityParam) :*: (S1 ('MetaSel ('Just "hardForkConsensusConfigShape") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Shape xs)) :*: S1 ('MetaSel ('Just "hardForkConsensusConfigPerEra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PerEraConsensusConfig xs)))))
type Rep (ConsensusConfig (Bft c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type Rep (ConsensusConfig (Bft c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.BFT" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "BftConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "bftParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BftParams) :*: (S1 ('MetaSel ('Just "bftSignKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignKeyDSIGN (BftDSIGN c))) :*: S1 ('MetaSel ('Just "bftVerKeys") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map NodeId (VerKeyDSIGN (BftDSIGN c)))))))
type Rep (ConsensusConfig (ModChainSel p t)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.ModChainSel

type Rep (ConsensusConfig (ModChainSel p t)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.ModChainSel" "ouroboros-consensus-0.27.0.0-inplace" 'True) (C1 ('MetaCons "McsConsensusConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "mcsConfigP") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConsensusConfig p))))
type Rep (ConsensusConfig (PBft c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type Rep (ConsensusConfig (PBft c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.PBFT" "ouroboros-consensus-0.27.0.0-inplace" 'True) (C1 ('MetaCons "PBftConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "pbftParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PBftParams)))
data ConsensusConfig (HardForkProtocol xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

data ConsensusConfig (Bft c) Source #

(Static) node configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

newtype ConsensusConfig (PBft c) Source #

(Static) node configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

newtype ConsensusConfig (ModChainSel p t) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.ModChainSel

class (Show (ChainDepState p), Show (ValidationErr p), Show (TiebreakerView p), Show (LedgerView p), Eq (ChainDepState p), Eq (ValidationErr p), ChainOrder (TiebreakerView p), NoThunks (ConsensusConfig p), NoThunks (ChainDepState p), NoThunks (ValidationErr p), NoThunks (TiebreakerView p), Typeable p) ⇒ ConsensusProtocol p where Source #

The (open) universe of Ouroboros protocols

This class encodes the part that is independent from any particular block representation.

Associated Types

type ChainDepState p Source #

Protocol-specific state

NOTE: This chain is blockchain dependent, i.e., updated when new blocks come in (more precisely, new headers), and subject to rollback.

type IsLeader p Source #

Evidence that a node is the leader

type CanBeLeader p Source #

Evidence that we can be a leader

type TiebreakerView p Source #

View on a header required for tiebreaking between chains of equal length.

Chain selection is implemented by the chain database, which takes care of two things independent of a choice of consensus protocol: we never switch to chains that fork off more than k blocks ago, and we never adopt an invalid chain. We always prefer longer chains to shorter chains. The comparison of chains A and B of equal length however depends on the chain selection protocol: chain A is strictly preferred over chain B whenever A's tiebreaker view is preferred over B's tiebreaker view according to the ChainOrder instance.

type LedgerView p Source #

Projection of the ledger state the Ouroboros protocol needs access to

The LedgerView is a summary of the state of the ledger that the consensus algorithm requires to do its job. Under certain circumstances the consensus algorithm may require the LedgerView for slots in the past (before the current tip of the chain) or in the (near) future (beyond the tip of the current chain, without having seen those future blocks yet).

This puts limitations on what the LedgerView can be. For example, it cannot be the "current stake distribution", since it is of course impossible to compute the current stake distibution for a slot in the future. This means that for a consensus algorithm that requires the stake distribution such as Praos, the LedgerView for a particular slot must be the "stake distribution for the purpose of leader selection". This "relevant" stake distribution can be computed for slots in the (near) future because it is based on historical stake, not current.

A somewhat unfortunate consequence of this is that some decisions that ought to live in the consensus layer (such as the decision precisely which historical stake to sample to determine the relevant stake distribution) instead live in the ledger layer. It is difficult to disentangle this, because the ledger may indeed depend on those sampling decisions (for example, reward calculations must be based on that same stake distribution).

There are also some advantages to moving these sorts of decisions to the ledger layer. It means that the consensus algorithm can continue to function without modifications if we decide that the stake distribution for leader selection should be based on something else instead (for example, for some bespoke version of the blockchain we may wish to use a committee instead of a decentralized blockchain). Having sampling decisions in the ledger layer rather than the consensus layer means that these decisions can be made without modifying the consensus algorithm.

Note that for the specific case of Praos, whilst the ledger layer provides the relevant stake distribution, the precise leader election must still live in the consensus layer since that depends on the computation (and sampling) of entropy, which is done consensus side, not ledger side (the reward calculation does not depend on this).

type ValidationErr p Source #

Validation errors

type ValidateView p Source #

View on a header required to validate it

Methods

checkIsLeaderConsensusConfig p → CanBeLeader p → SlotNoTicked (ChainDepState p) → Maybe (IsLeader p) Source #

Check if a node is the leader

tickChainDepStateConsensusConfig p → LedgerView p → SlotNoChainDepState p → Ticked (ChainDepState p) Source #

Tick the ChainDepState

We pass the LedgerView to tickChainDepState. Functions that take a ticked ChainDepState are not separately passed a ledger view; protocols that require it, can include it in their ticked ChainDepState type.

updateChainDepStateConsensusConfig p → ValidateView p → SlotNoTicked (ChainDepState p) → Except (ValidationErr p) (ChainDepState p) Source #

Apply a header

reupdateChainDepStateConsensusConfig p → ValidateView p → SlotNoTicked (ChainDepState p) → ChainDepState p Source #

Re-apply a header to the same ChainDepState we have been able to successfully apply to before.

Since a header can only be applied to a single, specific, ChainDepState, if we apply a previously applied header again it will be applied in the very same ChainDepState, and therefore can't possibly fail.

It is worth noting that since we already know that the header is valid w.r.t. the provided ChainDepState, no validation checks should be performed.

protocolSecurityParamConsensusConfig p → SecurityParam Source #

We require that protocols support a k security parameter

Instances

Instances details
CanHardFork xs ⇒ ConsensusProtocol (HardForkProtocol xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol

BftCrypto c ⇒ ConsensusProtocol (Bft c) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

Associated Types

type ChainDepState (Bft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type ChainDepState (Bft c) = ()
type IsLeader (Bft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type IsLeader (Bft c) = ()
type CanBeLeader (Bft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type TiebreakerView (Bft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type LedgerView (Bft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type LedgerView (Bft c) = ()
type ValidationErr (Bft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type ValidateView (Bft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

PBftCrypto c ⇒ ConsensusProtocol (PBft c) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

Associated Types

type ChainDepState (PBft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type IsLeader (PBft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type CanBeLeader (PBft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type TiebreakerView (PBft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type LedgerView (PBft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type ValidationErr (PBft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type ValidateView (PBft c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

(ConsensusProtocol p, ChainOrder t, Show t, Typeable t, NoThunks t) ⇒ ConsensusProtocol (ModChainSel p t) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.ModChainSel

Chain order

data SelectView p Source #

Information from the tip of a chain required to compare it to other chains using its Ord and ChainOrder instance.

As the abstract Consensus layer targets longest chain protocols, the primary measure for comparing chains is the block number. However, in case of chains of equal length, we use the TiebreakerView which is customizable by the particular ConsensusProtocol p.

Constructors

SelectView 

Instances

Instances details
Generic (SelectView p) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Associated Types

type Rep (SelectView p) 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

type Rep (SelectView p) = D1 ('MetaData "SelectView" "Ouroboros.Consensus.Protocol.Abstract" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "SelectView" 'PrefixI 'True) (S1 ('MetaSel ('Just "svBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockNo) :*: S1 ('MetaSel ('Just "svTiebreakerView") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (TiebreakerView p))))

Methods

fromSelectView p → Rep (SelectView p) x #

toRep (SelectView p) x → SelectView p #

Show (TiebreakerView p) ⇒ Show (SelectView p) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Methods

showsPrecIntSelectView p → ShowS #

showSelectView p → String #

showList ∷ [SelectView p] → ShowS #

Eq (TiebreakerView p) ⇒ Eq (SelectView p) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Methods

(==)SelectView p → SelectView p → Bool #

(/=)SelectView p → SelectView p → Bool #

Ord (TiebreakerView p) ⇒ Ord (SelectView p) Source #

First compare block numbers, then compare the TiebreakerView.

Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Methods

compareSelectView p → SelectView p → Ordering #

(<)SelectView p → SelectView p → Bool #

(<=)SelectView p → SelectView p → Bool #

(>)SelectView p → SelectView p → Bool #

(>=)SelectView p → SelectView p → Bool #

maxSelectView p → SelectView p → SelectView p #

minSelectView p → SelectView p → SelectView p #

NoThunks (TiebreakerView p) ⇒ NoThunks (SelectView p) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

ChainOrder (TiebreakerView p) ⇒ ChainOrder (SelectView p) Source #

cand is preferred to ours if either cand is longer than ours, or cand and ours are of equal length and we have

preferCandidate cfg ourTiebreaker candTiebreaker
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

type Rep (SelectView p) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

type Rep (SelectView p) = D1 ('MetaData "SelectView" "Ouroboros.Consensus.Protocol.Abstract" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "SelectView" 'PrefixI 'True) (S1 ('MetaSel ('Just "svBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockNo) :*: S1 ('MetaSel ('Just "svTiebreakerView") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (TiebreakerView p))))
type ChainOrderConfig (SelectView p) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

class Ord sv ⇒ ChainOrder sv where Source #

The chain order of some type; in the Consensus layer, this will always be the SelectView/TiebreakerView of some ConsensusProtocol. Namely, the ChainOrder instance of SelectView primarily compares block numbers, but refers to the ChainOrder instance of TiebreakerView in case of a tie.

See preferCandidate for the primary documentation.

Additionally, we require a total order on this type, such that eg different candidate chains that are preferred over our current selection can be sorted for prioritization. For example, this is used in ChainSel during initial chain selection or when blocks arrive out of order (not the case when the node is caught up), or in the BlockFetch decision logic. Future work could include also recording/storing arrival information and using that instead of/in addition to the Ord instance.

Associated Types

type ChainOrderConfig sv Source #

Methods

preferCandidate Source #

Arguments

ChainOrderConfig sv 
→ sv

Tip of our chain

→ sv

Tip of the candidate

Bool 

Compare a candidate chain to our own.

This method defines when a candidate chain is strictly preferable to our current chain. If both chains are equally preferable, the Ouroboros class of consensus protocols always sticks with the current chain.

Requirements

Write ours ⊏ cand for preferCandidate cfg ours cand for brevity.

Consistency with Ord
When ours ⊏ cand, then ours < cand.

This means that cand can only be preferred over ours when cand is greater than ours according to the Ord instance.

However, this is not necessarily a sufficient condition; a concrete implementation may decide to not have ours ⊏ cand despite ours < cand for some pairs ours, can. However, it is recommended to think about this carefully and rather use SimpleChainOrder if possible, which defines ours ⊏ cand as ours < cand, as it simplifies reasoning about the chain ordering.

However, forgoing SimpleChainOrder can enable more sophisticated tiebreaking rules that eg exhibit desirable incentive behavior.

Instances

Instances details
ChainOrder NoTiebreaker Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

ChainOrder PBftTiebreakerView Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

CanHardFork xs ⇒ ChainOrder (HardForkTiebreakerView xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol

ChainOrder (TiebreakerView p) ⇒ ChainOrder (SelectView p) Source #

cand is preferred to ours if either cand is longer than ours, or cand and ours are of equal length and we have

preferCandidate cfg ourTiebreaker candTiebreaker
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Ord sv ⇒ ChainOrder (SimpleChainOrder sv) Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Associated Types

type ChainOrderConfig (SimpleChainOrder sv) 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

ChainOrder (TiebreakerView (BlockProtocol blk)) ⇒ ChainOrder (WrapTiebreakerView blk) Source # 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype SimpleChainOrder sv Source #

A DerivingVia helper to implement preferCandidate in terms of the Ord instance.

Constructors

SimpleChainOrder sv 

data NoTiebreaker Source #

Use no tiebreaker to decide between chains of equal length, cf TiebreakerView and ChainOrder.

Constructors

NoTiebreaker 

Instances

Instances details
Generic NoTiebreaker Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Associated Types

type Rep NoTiebreaker 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

type Rep NoTiebreaker = D1 ('MetaData "NoTiebreaker" "Ouroboros.Consensus.Protocol.Abstract" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "NoTiebreaker" 'PrefixI 'False) (U1TypeType))
Show NoTiebreaker Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Eq NoTiebreaker Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Ord NoTiebreaker Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

NoThunks NoTiebreaker Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

ChainOrder NoTiebreaker Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

type Rep NoTiebreaker Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

type Rep NoTiebreaker = D1 ('MetaData "NoTiebreaker" "Ouroboros.Consensus.Protocol.Abstract" "ouroboros-consensus-0.27.0.0-inplace" 'False) (C1 ('MetaCons "NoTiebreaker" 'PrefixI 'False) (U1TypeType))
type ChainOrderConfig NoTiebreaker Source # 
Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Translation

class TranslateProto protoFrom protoTo where Source #

Translate across protocols

Methods

translateLedgerViewProxy (protoFrom, protoTo) → LedgerView protoFrom → LedgerView protoTo Source #

Translate the ledger view.

translateChainDepStateProxy (protoFrom, protoTo) → ChainDepState protoFrom → ChainDepState protoTo Source #

Instances

Instances details
TranslateProto singleProto singleProto Source #

Degenerate instance - we may always translate from a protocol to itself.

Instance details

Defined in Ouroboros.Consensus.Protocol.Abstract

Methods

translateLedgerViewProxy (singleProto, singleProto) → LedgerView singleProto → LedgerView singleProto Source #

translateChainDepStateProxy (singleProto, singleProto) → ChainDepState singleProto → ChainDepState singleProto Source #

Convenience re-exports

newtype SecurityParam Source #

Protocol security parameter

We interpret this as the number of rollbacks we support.

i.e., k == 1: we can roll back at most one block k == 2: we can roll back at most two blocks, etc

NOTE: This talks about the number of blocks we can roll back, not the number of slots.

Constructors

SecurityParam 

Instances

Instances details
FromCBOR SecurityParam Source # 
Instance details

Defined in Ouroboros.Consensus.Config.SecurityParam

ToCBOR SecurityParam Source # 
Instance details

Defined in Ouroboros.Consensus.Config.SecurityParam

Generic SecurityParam Source # 
Instance details

Defined in Ouroboros.Consensus.Config.SecurityParam

Associated Types

type Rep SecurityParam 
Instance details

Defined in Ouroboros.Consensus.Config.SecurityParam

type Rep SecurityParam = D1 ('MetaData "SecurityParam" "Ouroboros.Consensus.Config.SecurityParam" "ouroboros-consensus-0.27.0.0-inplace" 'True) (C1 ('MetaCons "SecurityParam" 'PrefixI 'True) (S1 ('MetaSel ('Just "maxRollbacks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonZero Word64))))
Show SecurityParam Source # 
Instance details

Defined in Ouroboros.Consensus.Config.SecurityParam

Eq SecurityParam Source # 
Instance details

Defined in Ouroboros.Consensus.Config.SecurityParam

NoThunks SecurityParam Source # 
Instance details

Defined in Ouroboros.Consensus.Config.SecurityParam

type Rep SecurityParam Source # 
Instance details

Defined in Ouroboros.Consensus.Config.SecurityParam

type Rep SecurityParam = D1 ('MetaData "SecurityParam" "Ouroboros.Consensus.Config.SecurityParam" "ouroboros-consensus-0.27.0.0-inplace" 'True) (C1 ('MetaCons "SecurityParam" 'PrefixI 'True) (S1 ('MetaSel ('Just "maxRollbacks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonZero Word64))))