ouroboros-consensus-shelley-0.1.0.0: Shelley ledger integration in the Ouroboros consensus layer
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Shelley.Ledger.Ledger

Synopsis

Documentation

newtype ShelleyLedgerError era Source #

Constructors

BBodyError (BlockTransitionError era) 

Instances

Instances details
ShelleyBasedEra era => Eq (ShelleyLedgerError era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

ShelleyBasedEra era => Show (ShelleyLedgerError era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Generic (ShelleyLedgerError era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Associated Types

type Rep (ShelleyLedgerError era) :: Type -> Type #

ShelleyBasedEra era => NoThunks (ShelleyLedgerError era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (ShelleyLedgerError era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (ShelleyLedgerError era) = D1 ('MetaData "ShelleyLedgerError" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'True) (C1 ('MetaCons "BBodyError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BlockTransitionError era))))

class (PraosCrypto (Crypto era), ShelleyBased era, GetLedgerView era, ApplyBlock era, ApplyTx era) => ShelleyBasedEra era Source #

Instances

Instances details
PraosCrypto crypto => ShelleyBasedEra (ShelleyEra crypto) 
Instance details

Defined in Shelley.Spec.Ledger.API

data ShelleyTip era Source #

Instances

Instances details
Eq (ShelleyTip era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Methods

(==) :: ShelleyTip era -> ShelleyTip era -> Bool #

(/=) :: ShelleyTip era -> ShelleyTip era -> Bool #

Show (ShelleyTip era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Methods

showsPrec :: Int -> ShelleyTip era -> ShowS #

show :: ShelleyTip era -> String #

showList :: [ShelleyTip era] -> ShowS #

Generic (ShelleyTip era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Associated Types

type Rep (ShelleyTip era) :: Type -> Type #

Methods

from :: ShelleyTip era -> Rep (ShelleyTip era) x #

to :: Rep (ShelleyTip era) x -> ShelleyTip era #

NoThunks (ShelleyTip era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (ShelleyTip era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (ShelleyTip era) = D1 ('MetaData "ShelleyTip" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "ShelleyTip" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyTipSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: (S1 ('MetaSel ('Just "shelleyTipBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockNo) :*: S1 ('MetaSel ('Just "shelleyTipHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HeaderHash (ShelleyBlock era))))))

newtype ShelleyTransition Source #

Information required to determine the hard fork point from Shelley to the next ledger

Constructors

ShelleyTransitionInfo 

Fields

  • shelleyAfterVoting :: Word32

    The number of blocks in this epoch past the voting deadline

    We record this to make sure that we can tell the HFC about hard forks if and only if we are certain:

    1. Blocks that came in within an epoch after the 4k/f voting deadline are not relevant (10kf - 2 * 3kf).
    2. Since there are slots between blocks, we are probably only sure that there will be no more relevant block when we have seen the first block after the deadline.
    3. If we count how many blocks we have seen post deadline, and we have reached k of them, we know that that last pre-deadline block won't be rolled back anymore.
    4. At this point we can look at the ledger state and see which proposals we accepted in the voting period, if any, and notify the HFC is one of them indicates a transition.

Instances

Instances details
Eq ShelleyTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Show ShelleyTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Generic ShelleyTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Associated Types

type Rep ShelleyTransition :: Type -> Type #

NoThunks ShelleyTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep ShelleyTransition Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep ShelleyTransition = D1 ('MetaData "ShelleyTransition" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'True) (C1 ('MetaCons "ShelleyTransitionInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyAfterVoting") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))

data family LedgerState blk Source #

Ledger state associated with a block

Instances

Instances details
ShelleyBasedEra era => Eq (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

ShelleyBasedEra era => Show (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Generic (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Associated Types

type Rep (LedgerState (ShelleyBlock era)) :: Type -> Type #

Generic (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Associated Types

type Rep (Ticked (LedgerState (ShelleyBlock era))) :: Type -> Type #

NoThunks (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

NoThunks (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

GetTip (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

GetTip (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

ShelleyBasedEra era => IsLedger (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Associated Types

type LedgerErr (LedgerState (ShelleyBlock era)) Source #

ShelleyBasedEra era => EncodeDisk (ShelleyBlock era) (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Node.Serialisation

ShelleyBasedEra era => DecodeDisk (ShelleyBlock era) (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Node.Serialisation

ShelleyBasedEra era => ApplyBlock (LedgerState (ShelleyBlock era)) (ShelleyBlock era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (LedgerState (ShelleyBlock era)) = D1 ('MetaData "LedgerState" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "ShelleyLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyLedgerTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin (ShelleyTip era))) :*: (S1 ('MetaSel ('Just "shelleyLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NewEpochState era)) :*: S1 ('MetaSel ('Just "shelleyLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ShelleyTransition))))
type Rep (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (Ticked (LedgerState (ShelleyBlock era))) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "TickedShelleyLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "untickedShelleyLedgerTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin (ShelleyTip era))) :*: (S1 ('MetaSel ('Just "tickedShelleyLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ShelleyTransition) :*: S1 ('MetaSel ('Just "tickedShelleyLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NewEpochState era)))))
type LedgerCfg (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type LedgerErr (LedgerState (ShelleyBlock era)) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

data LedgerState (ShelleyBlock era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

data Ticked (LedgerState (ShelleyBlock era)) Source #

Ticking only affects the state itself

Instance details

Defined in Ouroboros.Consensus.Shelley.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

showsPrec :: Int -> Ticked () -> ShowS #

show :: Ticked () -> String #

showList :: [Ticked ()] -> ShowS #

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

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrec :: Int -> Ticked (K a x) -> ShowS #

show :: Ticked (K a x) -> String #

showList :: [Ticked (K a x)] -> ShowS #

Generic (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Associated Types

type Rep (Ticked (LedgerState (ShelleyBlock era))) :: Type -> Type #

NoThunks (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

IsLedger (LedgerState blk) => GetTip (Ticked (ExtLedgerState blk)) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

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

Defined in Ouroboros.Consensus.Storage.LedgerDB.InMemory

Methods

getTip :: Ticked (LedgerDB l r) -> Point (Ticked (LedgerDB l r)) Source #

GetTip (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

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

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrec :: Int -> (Ticked :.: f) a -> ShowS #

show :: (Ticked :.: f) a -> String #

showList :: [(Ticked :.: f) a] -> ShowS #

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 (ShelleyBlock era))) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (Ticked (LedgerState (ShelleyBlock era))) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "TickedShelleyLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "untickedShelleyLedgerTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin (ShelleyTip era))) :*: (S1 ('MetaSel ('Just "tickedShelleyLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ShelleyTransition) :*: S1 ('MetaSel ('Just "tickedShelleyLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NewEpochState era)))))
newtype Ticked (WrapChainDepState blk) 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype Ticked (WrapLedgerView blk) 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

data Ticked (ExtLedgerState blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

data Ticked (HeaderState blk) 
Instance details

Defined in Ouroboros.Consensus.HeaderValidation

data Ticked (LedgerState (ShelleyBlock era)) Source #

Ticking only affects the state itself

Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

newtype Ticked (LedgerView c) Source #

Ledger view at a particular slot

Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

data Ticked (TPraosState c) Source #

Ticked TPraosState

Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

type HeaderHash (Ticked l) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Basics

data Ticked (LedgerDB l r)

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

newtype Ticked (K a x) 
Instance details

Defined in Ouroboros.Consensus.Ticked

newtype Ticked (K a x) = TickedK {}

Ledger config

data ShelleyLedgerConfig era Source #

Constructors

ShelleyLedgerConfig 

Fields

Instances

Instances details
Generic (ShelleyLedgerConfig era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

Associated Types

type Rep (ShelleyLedgerConfig era) :: Type -> Type #

ShelleyBasedEra era => NoThunks (ShelleyLedgerConfig era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (ShelleyLedgerConfig era) Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (ShelleyLedgerConfig era) = D1 ('MetaData "ShelleyLedgerConfig" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "ShelleyLedgerConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyLedgerCompactGenesis") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CompactGenesis era)) :*: S1 ('MetaSel ('Just "shelleyLedgerGlobals") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Globals)))

shelleyEraParamsNeverHardForks :: ShelleyGenesis era -> EraParams Source #

Separate variant of shelleyEraParams to be used for a Shelley-only chain.

Auxiliary

Serialisation

Orphan instances

ShelleyBasedEra era => Eq (LedgerState (ShelleyBlock era)) Source # 
Instance details

ShelleyBasedEra era => Show (LedgerState (ShelleyBlock era)) Source # 
Instance details

Generic (LedgerState (ShelleyBlock era)) Source # 
Instance details

Associated Types

type Rep (LedgerState (ShelleyBlock era)) :: Type -> Type #

Generic (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

Associated Types

type Rep (Ticked (LedgerState (ShelleyBlock era))) :: Type -> Type #

NoThunks (LedgerState (ShelleyBlock era)) Source # 
Instance details

NoThunks (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

HasHardForkHistory (ShelleyBlock era) Source # 
Instance details

Associated Types

type HardForkIndices (ShelleyBlock era) :: [Type] Source #

ShelleyBasedEra era => LedgerSupportsProtocol (ShelleyBlock era) Source # 
Instance details

ShelleyBasedEra era => BasicEnvelopeValidation (ShelleyBlock era) Source # 
Instance details

ShelleyBasedEra era => ValidateEnvelope (ShelleyBlock era) Source # 
Instance details

Associated Types

type OtherHeaderEnvelopeError (ShelleyBlock era) Source #

ShelleyBasedEra era => CommonProtocolParams (ShelleyBlock era) Source # 
Instance details

ShelleyBasedEra era => UpdateLedger (ShelleyBlock era) Source # 
Instance details

GetTip (LedgerState (ShelleyBlock era)) Source # 
Instance details

GetTip (Ticked (LedgerState (ShelleyBlock era))) Source # 
Instance details

ShelleyBasedEra era => IsLedger (LedgerState (ShelleyBlock era)) Source # 
Instance details

Associated Types

type LedgerErr (LedgerState (ShelleyBlock era)) Source #

ShelleyBasedEra era => ApplyBlock (LedgerState (ShelleyBlock era)) (ShelleyBlock era) Source # 
Instance details