| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Protocol
Synopsis
- newtype HardForkTiebreakerView (xs ∷ [Type]) = HardForkTiebreakerView {}
- type HardForkCanBeLeader (xs ∷ [Type]) = SomeErasCanBeLeader xs
- type HardForkChainDepState (xs ∷ [Type]) = HardForkState WrapChainDepState xs
- type HardForkIsLeader (xs ∷ [Type]) = OneEraIsLeader xs
- data HardForkValidationErr (xs ∷ [Type])
- type HardForkLedgerView = HardForkLedgerView_ WrapLedgerView
- data HardForkLedgerView_ (f ∷ Type → Type) (xs ∷ [Type]) = HardForkLedgerView {}
- data family Ticked (st ∷ k) ∷ k
Documentation
newtype HardForkTiebreakerView (xs ∷ [Type]) Source #
Constructors
| HardForkTiebreakerView | |
Fields | |
Instances
Re-exports to keep State an internal module
type HardForkCanBeLeader (xs ∷ [Type]) = SomeErasCanBeLeader xs Source #
We have one or more BlockForgings, and thus CanBeLeader proofs, for
each era in which we can forge blocks.
type HardForkChainDepState (xs ∷ [Type]) = HardForkState WrapChainDepState xs Source #
type HardForkIsLeader (xs ∷ [Type]) = OneEraIsLeader xs Source #
We are a leader if we have a proof from one of the eras
data HardForkValidationErr (xs ∷ [Type]) Source #
Constructors
| HardForkValidationErrFromEra (OneEraValidationErr xs) | Validation error from one of the eras |
| HardForkValidationErrWrongEra (MismatchEraInfo xs) | We tried to apply a block from the wrong era |
Instances
| Generic (HardForkValidationErr xs) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol Associated Types
Methods from ∷ HardForkValidationErr xs → Rep (HardForkValidationErr xs) x # to ∷ Rep (HardForkValidationErr xs) x → HardForkValidationErr xs # | |||||
| CanHardFork xs ⇒ Show (HardForkValidationErr xs) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol Methods showsPrec ∷ Int → HardForkValidationErr xs → ShowS # show ∷ HardForkValidationErr xs → String # showList ∷ [HardForkValidationErr xs] → ShowS # | |||||
| CanHardFork xs ⇒ Eq (HardForkValidationErr xs) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol Methods (==) ∷ HardForkValidationErr xs → HardForkValidationErr xs → Bool # (/=) ∷ HardForkValidationErr xs → HardForkValidationErr xs → Bool # | |||||
| CanHardFork xs ⇒ NoThunks (HardForkValidationErr xs) Source # | |||||
| type Rep (HardForkValidationErr xs) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol type Rep (HardForkValidationErr xs) = D1 ('MetaData "HardForkValidationErr" "Ouroboros.Consensus.HardFork.Combinator.Protocol" "ouroboros-consensus-3.0.1.0-inplace" 'False) (C1 ('MetaCons "HardForkValidationErrFromEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OneEraValidationErr xs))) :+: C1 ('MetaCons "HardForkValidationErrWrongEra" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MismatchEraInfo xs)))) | |||||
Re-exports to keep LedgerView an internal module
data HardForkLedgerView_ (f ∷ Type → Type) (xs ∷ [Type]) Source #
Constructors
| HardForkLedgerView | |
Fields
| |
Instances
| CanHardFork xs ⇒ Show (HardForkLedgerView_ WrapLedgerView xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Protocol.LedgerView Methods showsPrec ∷ Int → HardForkLedgerView_ WrapLedgerView xs → ShowS # show ∷ HardForkLedgerView_ WrapLedgerView xs → String # showList ∷ [HardForkLedgerView_ WrapLedgerView xs] → ShowS # | |
| (SListI xs, Show a) ⇒ Show (HardForkLedgerView_ (K a ∷ Type → Type) xs) Source # | |
Type family instances
data family Ticked (st ∷ k) ∷ k Source #
" Ticked " piece of state, either LedgerState or ChainDepState
Ticking refers to the passage of time (the ticking of the clock). When a
piece of state is marked as ticked, it means that time-related changes have
been applied to the state. There are exactly two methods in the interface
that do that: tickChainDepState and
applyChainTickLedgerResult.
Also note that a successful forecast
must equal
forecastFor
(ledgerViewForecastAt cfg st)
slot. Thus a
protocolLedgerView cfg
(applyChainTick cfg slot st)LedgerView can only be projected
from a Ticked state, but cannot itself be ticked.
Some examples of time related changes:
- Scheduled delegations might have been applied in Byron
- New leader schedule computed for Shelley
- Transition from Byron to Shelley activated in the hard fork combinator.
- Nonces switched out at the start of a new epoch.
Ticked is used mainly in two ways:
Ticked (Ext)LedgerStatewhere its kind gets concretized toStateKind -> StateKindTicked (HeaderState blk)where its kind gets concretized toType -> Type
Instances
| Show (Ticked ()) Source # | |
| (NoThunks (TxIn blk), NoThunks (TxOut blk), HasLedgerTables (Ticked LedgerState) blk) ⇒ HasLedgerTables (Ticked ExtLedgerState) blk Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked ExtLedgerState blk mk → LedgerTables blk mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked ExtLedgerState blk any → LedgerTables blk mk → Ticked ExtLedgerState blk mk Source # | |
| (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ HasLedgerTables (Ticked LedgerState) (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked LedgerState (HardForkBlock xs) mk → LedgerTables (HardForkBlock xs) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked LedgerState (HardForkBlock xs) any → LedgerTables (HardForkBlock xs) mk → Ticked LedgerState (HardForkBlock xs) mk Source # | |
| (Bridge m a, HasLedgerTables (Ticked LedgerState) m) ⇒ HasLedgerTables (Ticked LedgerState) (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods projectLedgerTables ∷ ∀ (mk ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked LedgerState (DualBlock m a) mk → LedgerTables (DualBlock m a) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked LedgerState (DualBlock m a) any → LedgerTables (DualBlock m a) mk → Ticked LedgerState (DualBlock m a) mk Source # | |
| CanHardFork xs ⇒ GetTip (Ticked LedgerState (HardForkBlock xs)) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked LedgerState (HardForkBlock xs) mk → Point (Ticked LedgerState (HardForkBlock xs)) Source # | |
| Bridge m a ⇒ GetTip (Ticked LedgerState (DualBlock m a)) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
| IsLedger LedgerState blk ⇒ GetTip (Ticked ExtLedgerState blk) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods getTip ∷ ∀ (mk ∷ MapKind). Ticked ExtLedgerState blk mk → Point (Ticked ExtLedgerState blk) Source # | |
| NoThunks (Ticked LedgerState (DualBlock m a) mk) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
| Show (Ticked (f a)) ⇒ Show (((Ticked ∷ Type → Type) :.: f) a) Source # | |
| NoThunks (Ticked (f a)) ⇒ NoThunks (((Ticked ∷ Type → Type) :.: f) a) Source # | |
| data Ticked () Source # | |
Defined in Ouroboros.Consensus.Ticked | |
| data Ticked (HardForkChainDepState xs ∷ Type) Source # | |
| data Ticked (HeaderState blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.HeaderValidation | |
| data Ticked (PBftState c ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Protocol.PBFT | |
| newtype Ticked (WrapChainDepState blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.TypeFamilyWrappers | |
| type HeaderHash (Ticked l blk ∷ k2) Source # | |
Defined in Ouroboros.Consensus.Ticked | |
| data Ticked ExtLedgerState (blk ∷ Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended data Ticked ExtLedgerState (blk ∷ Type) (mk ∷ MapKind) = TickedExtLedgerState {
| |
| data Ticked LedgerState (HardForkBlock xs ∷ Type) (mk ∷ MapKind) Source # | |
| data Ticked LedgerState (DualBlock m a ∷ Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
Orphan instances
| CanHardFork xs ⇒ BlockSupportsProtocol (HardForkBlock xs) Source # | |||||||||||||||||||||||||||||
Methods validateView ∷ BlockConfig (HardForkBlock xs) → Header (HardForkBlock xs) → ValidateView (BlockProtocol (HardForkBlock xs)) Source # tiebreakerView ∷ BlockConfig (HardForkBlock xs) → Header (HardForkBlock xs) → TiebreakerView (BlockProtocol (HardForkBlock xs)) Source # projectChainOrderConfig ∷ BlockConfig (HardForkBlock xs) → ChainOrderConfig (SelectView (BlockProtocol (HardForkBlock xs))) Source # | |||||||||||||||||||||||||||||
| CanHardFork xs ⇒ ConsensusProtocol (HardForkProtocol xs) Source # | |||||||||||||||||||||||||||||
Associated Types
Methods checkIsLeader ∷ ConsensusConfig (HardForkProtocol xs) → CanBeLeader (HardForkProtocol xs) → SlotNo → Ticked (ChainDepState (HardForkProtocol xs)) → Maybe (IsLeader (HardForkProtocol xs)) Source # tickChainDepState ∷ ConsensusConfig (HardForkProtocol xs) → LedgerView (HardForkProtocol xs) → SlotNo → ChainDepState (HardForkProtocol xs) → Ticked (ChainDepState (HardForkProtocol xs)) Source # updateChainDepState ∷ ConsensusConfig (HardForkProtocol xs) → ValidateView (HardForkProtocol xs) → SlotNo → Ticked (ChainDepState (HardForkProtocol xs)) → Except (ValidationErr (HardForkProtocol xs)) (ChainDepState (HardForkProtocol xs)) Source # reupdateChainDepState ∷ ConsensusConfig (HardForkProtocol xs) → ValidateView (HardForkProtocol xs) → SlotNo → Ticked (ChainDepState (HardForkProtocol xs)) → ChainDepState (HardForkProtocol xs) Source # protocolSecurityParam ∷ ConsensusConfig (HardForkProtocol xs) → SecurityParam Source # | |||||||||||||||||||||||||||||