ouroboros-consensus-byron-0.1.0.1: Byron ledger integration in the Ouroboros consensus layer
Safe Haskell None
Language Haskell2010

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

NoThunks ByronTransition Source #
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

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.1-1xx7v4AzrF0A75LZoaNMal" ' False ) ( C1 (' MetaCons "ByronTransitionInfo" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe 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.

Serialisation

Type family instances

data family BlockQuery blk :: Type -> Type 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

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

( forall 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

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

Generic ( Ticked ( 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

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

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

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

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.1-1xx7v4AzrF0A75LZoaNMal" ' 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.1-1xx7v4AzrF0A75LZoaNMal" ' 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

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

Show ( Ticked a) => Show ( Ticked ( K a x))
Instance details

Defined in Ouroboros.Consensus.Ticked

Generic ( 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

IsLedger l => GetTip ( Ticked ( LedgerDB l))
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.InMemory

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

Show ( Ticked (f a)) => Show (( Ticked :.: f) a)
Instance details

Defined in Ouroboros.Consensus.Ticked

NoThunks ( Ticked (f a)) => NoThunks (( Ticked :.: f) a)
Instance details

Defined in Ouroboros.Consensus.Ticked

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.1-1xx7v4AzrF0A75LZoaNMal" ' 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

Auxiliary

validationErrorImpossible :: forall 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

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

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

NoThunks ( LedgerState ByronBlock ) Source #
Instance details

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

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

ShowQuery ( BlockQuery ByronBlock ) Source #
Instance details

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