Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Protocol
Synopsis
- newtype HardForkSelectView (xs ∷ [Type]) = HardForkSelectView {}
- 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 HardForkSelectView (xs ∷ [Type]) Source #
Constructors
HardForkSelectView | |
Fields |
Instances
Re-exports to keep State
an internal module
type HardForkCanBeLeader (xs ∷ [Type]) = SomeErasCanBeLeader xs Source #
We have one or more BlockForging
s, 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-0.26.0.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.
Instances
Show (Ticked ()) 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 # | |
(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 (Ticked (LedgerState (HardForkBlock xs))) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (HardForkBlock xs)) any → LedgerTables (Ticked (LedgerState (HardForkBlock xs))) mk → Ticked (LedgerState (HardForkBlock xs)) mk Source # | |
(Bridge m a, NoThunks (TxOut (LedgerState m)), NoThunks (TxIn (LedgerState m)), Show (TxOut (LedgerState m)), Show (TxIn (LedgerState m)), Eq (TxOut (LedgerState m)), Ord (TxIn (LedgerState m)), MemPack (TxIn (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 (Ticked (LedgerState (DualBlock m a))) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (LedgerState (DualBlock m a)) any → LedgerTables (Ticked (LedgerState (DualBlock m a))) mk → Ticked (LedgerState (DualBlock m a)) mk Source # | |
(HasLedgerTables (Ticked (LedgerState blk)), NoThunks (TxOut (LedgerState blk)), NoThunks (TxIn (LedgerState blk)), Show (TxOut (LedgerState blk)), Show (TxIn (LedgerState blk)), Eq (TxOut (LedgerState blk)), Ord (TxIn (LedgerState blk)), MemPack (TxIn (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 (Ticked (ExtLedgerState blk)) mk Source # withLedgerTables ∷ ∀ (mk ∷ MapKind) (any ∷ MapKind). (CanMapMK mk, CanMapKeysMK mk, ZeroableMK mk) ⇒ Ticked (ExtLedgerState blk) any → LedgerTables (Ticked (ExtLedgerState blk)) mk → Ticked (ExtLedgerState blk) mk Source # | |
LedgerTablesAreTrivial (Ticked (LedgerState blk)) ⇒ LedgerTablesAreTrivial (Ticked (ExtLedgerState blk)) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended Methods convertMapKind ∷ ∀ (mk ∷ MapKind) (mk' ∷ MapKind). Ticked (ExtLedgerState blk) mk → Ticked (ExtLedgerState blk) mk' 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 ∷ k) Source # | |
Defined in Ouroboros.Consensus.Ticked | |
type TxIn (Ticked l) Source # | |
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |
type TxOut (Ticked l) Source # | |
Defined in Ouroboros.Consensus.Ledger.Tables.Basics | |
data Ticked (LedgerState (HardForkBlock xs) ∷ MapKind → Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger data Ticked (LedgerState (HardForkBlock xs) ∷ MapKind → Type) (mk ∷ MapKind) = TickedHardForkLedgerState {} | |
data Ticked (LedgerState (DualBlock m a) ∷ MapKind → Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual data Ticked (LedgerState (DualBlock m a) ∷ MapKind → Type) (mk ∷ MapKind) = TickedDualLedgerState {} | |
data Ticked (ExtLedgerState blk ∷ MapKind → Type) (mk ∷ MapKind) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended data Ticked (ExtLedgerState blk ∷ MapKind → Type) (mk ∷ MapKind) = TickedExtLedgerState {
|
Orphan instances
CanHardFork xs ⇒ BlockSupportsProtocol (HardForkBlock xs) Source # | |||||||||||||||||||||||||||||
Methods validateView ∷ BlockConfig (HardForkBlock xs) → Header (HardForkBlock xs) → ValidateView (BlockProtocol (HardForkBlock xs)) Source # selectView ∷ BlockConfig (HardForkBlock xs) → Header (HardForkBlock xs) → SelectView (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 # |