ouroboros-consensus-byron-0.1.0.0: Byron ledger integration in the Ouroboros consensus layer
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Byron.Ledger.Ledger

Description

Instances requires for consensus/ledger integration

Synopsis

Documentation

data ByronTransition Source #

Information required to determine the transition from Byron to Shelley

Constructors

ByronTransitionInfo !(Map ProtocolVersion BlockNo)

Per candidate proposal, the BlockNo in which it became a candidate

The HFC needs to know when a candidate proposal becomes stable. We cannot reliably do this using SlotNo: doing so would mean that if we were to switch to a denser fork, something that was previously deemed stable is suddenly not deemed stable anymore (although in actuality it still is). We therefore must do this based on BlockNo instead, but unfortunately the Byron ledger does not record this information. Therefore, we record it here instead.

Invariant: the domain of this map should equal the set of candidate proposals.

Instances

Instances details
Eq ByronTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Show ByronTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Generic ByronTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Associated Types

type Rep ByronTransitionTypeType Source #

NoThunks ByronTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Methods

noThunks ∷ Context → ByronTransitionIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ByronTransitionIO (Maybe ThunkInfo) #

showTypeOfProxy ByronTransitionString #

type Rep ByronTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep ByronTransition = D1 ('MetaData "ByronTransition" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-byron-0.1.0.0-inplace" 'False) (C1 ('MetaCons "ByronTransitionInfo" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map ProtocolVersion BlockNo))))

Ledger integration

byronEraParams ∷ Config → EraParams Source #

To be used for a Byron-to-X (where X is typically Shelley) chain.

byronEraParamsNeverHardForks ∷ Config → EraParams Source #

Separate variant of byronEraParams to be used for a Byron-only chain.

initByronLedgerState Source #

Arguments

∷ Config 
Maybe UTxO

Optionally override UTxO

LedgerState ByronBlock 

Serialisation

decodeByronResultBlockQuery ByronBlock result → ∀ s. Decoder s result Source #

encodeByronResultBlockQuery ByronBlock result → result → Encoding Source #

Type family instances

data family BlockQuery blk ∷ TypeType Source #

Different queries supported by the ledger, indexed by the result type.

Instances

Instances details
SerialiseResult ByronBlock (BlockQuery ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

SerialiseNodeToClient ByronBlock (SomeSecond BlockQuery ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

SameDepIndex (BlockQuery ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

ShowQuery (BlockQuery ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Methods

showResultBlockQuery ByronBlock result → result → String Source #

Eq (BlockQuery ByronBlock result) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

SameDepIndex (BlockQuery blk) ⇒ Eq (SomeSecond BlockQuery blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

Show (BlockQuery ByronBlock result) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

(∀ result. Show (BlockQuery blk result)) ⇒ Show (SomeSecond BlockQuery blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Query

ShowProxy (BlockQuery ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

data BlockQuery ByronBlock a Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

data family LedgerState blk Source #

Ledger state associated with a block

Instances

Instances details
EncodeDisk ByronBlock (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

DecodeDisk ByronBlock (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Node.Serialisation

Methods

decodeDiskCodecConfig ByronBlock → ∀ s. Decoder s (LedgerState ByronBlock) Source #

Eq (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Show (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Generic (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Associated Types

type Rep (LedgerState ByronBlock) ∷ TypeType Source #

Generic (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Associated Types

type Rep (Ticked (LedgerState ByronBlock)) ∷ TypeType Source #

GetTip (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

GetTip (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

IsLedger (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

NoThunks (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Methods

noThunks ∷ Context → LedgerState ByronBlockIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → LedgerState ByronBlockIO (Maybe ThunkInfo) #

showTypeOfProxy (LedgerState ByronBlock) → String #

NoThunks (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Methods

noThunks ∷ Context → Ticked (LedgerState ByronBlock) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → Ticked (LedgerState ByronBlock) → IO (Maybe ThunkInfo) #

showTypeOfProxy (Ticked (LedgerState ByronBlock)) → String #

ApplyBlock (LedgerState ByronBlock) ByronBlock Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

data LedgerState ByronBlock Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (LedgerState ByronBlock) = D1 ('MetaData "LedgerState" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-byron-0.1.0.0-inplace" 'False) (C1 ('MetaCons "ByronLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "byronLedgerTipBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin BlockNo)) :*: (S1 ('MetaSel ('Just "byronLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "byronLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByronTransition))))
type Rep (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (Ticked (LedgerState ByronBlock)) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-byron-0.1.0.0-inplace" 'False) (C1 ('MetaCons "TickedByronLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedByronLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "untickedByronLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByronTransition)))
type LedgerCfg (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type AuxLedgerEvent (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type LedgerErr (LedgerState ByronBlock) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type LedgerErr (LedgerState ByronBlock) = ChainValidationError
data Ticked (LedgerState ByronBlock) Source #

The ticked Byron ledger state

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type HeaderHash (LedgerState blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Basics

data family Ticked st Source #

" Ticked " piece of state (LedgerState, LedgerView, ChainIndepState)

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 (or forecast).

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

Instances details
Show (Ticked ()) 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrecIntTicked () → ShowS Source #

showTicked () → String Source #

showList ∷ [Ticked ()] → ShowS Source #

Show (Ticked a) ⇒ Show (Ticked (K a x)) 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrecIntTicked (K a x) → ShowS Source #

showTicked (K a x) → String Source #

showList ∷ [Ticked (K a x)] → ShowS Source #

Generic (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Associated Types

type Rep (Ticked (LedgerState ByronBlock)) ∷ TypeType Source #

IsLedger l ⇒ GetTip (Ticked (LedgerDB l)) 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.InMemory

Methods

getTipTicked (LedgerDB l) → Point (Ticked (LedgerDB l)) Source #

IsLedger (LedgerState blk) ⇒ GetTip (Ticked (ExtLedgerState blk)) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

GetTip (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

NoThunks (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

Methods

noThunks ∷ Context → Ticked (LedgerState ByronBlock) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → Ticked (LedgerState ByronBlock) → IO (Maybe ThunkInfo) #

showTypeOfProxy (Ticked (LedgerState ByronBlock)) → String #

Show (Ticked (f a)) ⇒ Show ((Ticked :.: f) a) 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrecInt → (Ticked :.: f) a → ShowS Source #

show ∷ (Ticked :.: f) a → String Source #

showList ∷ [(Ticked :.: f) a] → ShowS Source #

NoThunks (Ticked (f a)) ⇒ NoThunks ((Ticked :.: f) a) 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

noThunks ∷ Context → (Ticked :.: f) a → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → (Ticked :.: f) a → IO (Maybe ThunkInfo) #

showTypeOfProxy ((Ticked :.: f) a) → String #

data Ticked () 
Instance details

Defined in Ouroboros.Consensus.Ticked

type Rep (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (Ticked (LedgerState ByronBlock)) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-byron-0.1.0.0-inplace" 'False) (C1 ('MetaCons "TickedByronLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedByronLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "untickedByronLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByronTransition)))
newtype Ticked (PBftLedgerView c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

data Ticked (PBftState c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

data Ticked (LedgerDB l)

Ticking the ledger DB just ticks the current state

We don't push the new state into the DB until we apply a block.

Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.InMemory

data Ticked (ExtLedgerState blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

newtype Ticked (WrapChainDepState blk) 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype Ticked (WrapLedgerView blk) 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

data Ticked (HeaderState blk) 
Instance details

Defined in Ouroboros.Consensus.HeaderValidation

data Ticked (LedgerState ByronBlock) Source #

The ticked Byron ledger state

Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type HeaderHash (Ticked l) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Basics

newtype Ticked (K a x) 
Instance details

Defined in Ouroboros.Consensus.Ticked

newtype Ticked (K a x) = TickedK {}

Auxiliary

validationErrorImpossible ∷ ∀ err a. Except err a → a Source #

Mark computation as validation error free

Given a BlockValidationMode of NoBlockValidation, a call to applyByronBlock shouldn't fail since the ledger layer won't be performing any block validation checks. However, because applyByronBlock can fail in the event it is given a BlockValidationMode of BlockValidation, it still looks like it can fail (since its type doesn't change based on the ValidationMode) and we must still treat it as such.

Orphan instances

QueryLedger ByronBlock Source # 
Instance details

HasHardForkHistory ByronBlock Source # 
Instance details

Associated Types

type HardForkIndices ByronBlock ∷ [Type] Source #

LedgerSupportsProtocol ByronBlock Source # 
Instance details

CommonProtocolParams ByronBlock Source # 
Instance details

LedgerSupportsPeerSelection ByronBlock Source # 
Instance details

UpdateLedger ByronBlock Source # 
Instance details

Eq (LedgerState ByronBlock) Source # 
Instance details

Show (LedgerState ByronBlock) Source # 
Instance details

Generic (LedgerState ByronBlock) Source # 
Instance details

Associated Types

type Rep (LedgerState ByronBlock) ∷ TypeType Source #

Generic (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Associated Types

type Rep (Ticked (LedgerState ByronBlock)) ∷ TypeType Source #

GetTip (LedgerState ByronBlock) Source # 
Instance details

GetTip (Ticked (LedgerState ByronBlock)) Source # 
Instance details

IsLedger (LedgerState ByronBlock) Source # 
Instance details

SameDepIndex (BlockQuery ByronBlock) Source # 
Instance details

NoThunks (LedgerState ByronBlock) Source # 
Instance details

Methods

noThunks ∷ Context → LedgerState ByronBlockIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → LedgerState ByronBlockIO (Maybe ThunkInfo) #

showTypeOfProxy (LedgerState ByronBlock) → String #

NoThunks (Ticked (LedgerState ByronBlock)) Source # 
Instance details

Methods

noThunks ∷ Context → Ticked (LedgerState ByronBlock) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → Ticked (LedgerState ByronBlock) → IO (Maybe ThunkInfo) #

showTypeOfProxy (Ticked (LedgerState ByronBlock)) → String #

ShowQuery (BlockQuery ByronBlock) Source # 
Instance details

Methods

showResultBlockQuery ByronBlock result → result → String Source #

ApplyBlock (LedgerState ByronBlock) ByronBlock Source # 
Instance details

Eq (BlockQuery ByronBlock result) Source # 
Instance details

Show (BlockQuery ByronBlock result) Source # 
Instance details

ShowProxy (BlockQuery ByronBlock) Source # 
Instance details