Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data family Header blk
- data family StorageConfig blk
- data family CodecConfig blk
- data family BlockConfig blk
- data family Ticked st
- data family LedgerState blk
- data family Validated x
- data family GenTx blk
- data ByronSpecGenesis = ByronSpecGenesis {}
- data ByronSpecGenTx
- newtype ByronSpecGenTxErr = ByronSpecGenTxErr {}
- data ByronSpecBlock = ByronSpecBlock {}
- type ByronSpecHeader = Header ByronSpecBlock
- newtype ByronSpecLedgerError = ByronSpecLedgerError {}
- forgeByronSpecBlock ∷ BlockNo → SlotNo → Ticked (LedgerState ByronSpecBlock) → [Validated (GenTx ByronSpecBlock)] → VKey → ByronSpecBlock
- initByronSpecLedgerState ∷ ByronSpecGenesis → LedgerState ByronSpecBlock
Documentation
data family Header blk Source #
Instances
data family StorageConfig blk Source #
Config needed for the
NodeInitStorage
class. Defined here to
avoid circular dependencies.
Instances
Generic (StorageConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block type Rep (StorageConfig ByronSpecBlock) ∷ Type → Type # | |
NoThunks (StorageConfig ByronSpecBlock) Source # | |
data StorageConfig ByronSpecBlock Source # | |
type Rep (StorageConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block |
data family CodecConfig blk Source #
Static configuration required for serialisation and deserialisation of types pertaining to this type of block.
Data family instead of type family to get better type inference.
Instances
Generic (CodecConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block type Rep (CodecConfig ByronSpecBlock) ∷ Type → Type # | |
NoThunks (CodecConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block | |
data CodecConfig ByronSpecBlock Source # | |
type Rep (CodecConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block |
data family BlockConfig blk Source #
Static configuration required to work with this type of blocks
Instances
Generic (BlockConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block type Rep (BlockConfig ByronSpecBlock) ∷ Type → Type # | |
NoThunks (BlockConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block | |
data BlockConfig ByronSpecBlock Source # | |
type Rep (BlockConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block | |
newtype BlockConfig (DisableDiffusionPipelining blk) | |
Defined in Ouroboros.Consensus.Block.SupportsDiffusionPipelining newtype BlockConfig (DisableDiffusionPipelining blk) = DisableDiffusionPipeliningBlockConfig (BlockConfig blk) | |
newtype BlockConfig (SelectViewDiffusionPipelining blk) | |
Defined in Ouroboros.Consensus.Block.SupportsDiffusionPipelining newtype BlockConfig (SelectViewDiffusionPipelining blk) = SelectViewDiffusionPipeliningBlockConfig (BlockConfig blk) |
data family Ticked st 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
data family LedgerState blk Source #
Ledger state associated with a block
This is the Consensus notion of a ledger state. Each block type is
associated with one of the Ledger types for the ledger state. Virtually
every concept in this codebase revolves around this type, or the referenced
blk
. Whenever we use the type variable l
, we intend to denote that the
expected instantiation is either a LedgerState
or some wrapper over it
(like the ExtLedgerState
).
The main operations we can do with a LedgerState
are ticking (defined in
IsLedger
), and applying a block (defined in
ApplyBlock
).
Instances
data family Validated x Source #
" Validated " transaction or block
The ledger defines how to validate transactions and blocks. It's possible the type before and after validation may be distinct (eg Alonzo transactions), which originally motivated this family.
We also gain the related benefit that certain interface functions, such as those that reapply blocks, can have a more precise type now. TODO
Similarly, the Node-to-Client mini protocols can explicitly indicate that the
client trusts the blocks from the local server, by having the server send
Validated
blocks to the client. TODO
Note that validation has different implications for a transaction than for a block. In particular, a validated transaction can be " reapplied " to different ledger states, whereas a validated block must only be " reapplied " to the exact same ledger state (eg as part of rebuilding from an on-disk ledger snapshot).
Since the ledger defines validation, see the ledger details for concrete
examples of what determines the validity (wrt to a LedgerState
) of a
transaction and/or block. Example properties include: a transaction's claimed
inputs exist and are still unspent, a block carries a sufficient
cryptographic signature, etc.
Instances
Generic (Validated (GenTx ByronSpecBlock)) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Mempool from ∷ Validated (GenTx ByronSpecBlock) → Rep (Validated (GenTx ByronSpecBlock)) x # to ∷ Rep (Validated (GenTx ByronSpecBlock)) x → Validated (GenTx ByronSpecBlock) # | |
Show (Validated (GenTx ByronSpecBlock)) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Mempool | |
NoThunks (Validated (GenTx ByronSpecBlock)) Source # | |
type Rep (Validated (GenTx ByronSpecBlock)) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Mempool type Rep (Validated (GenTx ByronSpecBlock)) = D1 ('MetaData "Validated" "Ouroboros.Consensus.ByronSpec.Ledger.Mempool" "ouroboros-consensus-cardano-0.20.0.0-inplace-unstable-byronspec" 'True) (C1 ('MetaCons "ValidatedByronSpecGenTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "forgetValidatedByronSpecGenTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (GenTx ByronSpecBlock)))) | |
newtype Validated (GenTx ByronSpecBlock) Source # | |
data family GenTx blk Source #
Generalized transaction
The mempool (and, accordingly, blocks) consist of "generalized transactions"; this could be "proper" transactions (transferring funds) but also other kinds of things such as update proposals, delegations, etc.
Instances
data ByronSpecGenesis Source #
The equivalent of the genesis config for the abstract ledger
ByronSpecGenesis | |
|
Instances
data ByronSpecGenTx Source #
Generalized transaction
The spec doesn't have a type for this, instead splitting the block body into separate lists
Instances
newtype ByronSpecGenTxErr Source #
Transaction errors
We don't distinguish these from any other kind of CHAIN failure.
Instances
Generic ByronSpecGenTxErr Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.GenTx type Rep ByronSpecGenTxErr ∷ Type → Type # | |
Show ByronSpecGenTxErr Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.GenTx showsPrec ∷ Int → ByronSpecGenTxErr → ShowS # show ∷ ByronSpecGenTxErr → String # showList ∷ [ByronSpecGenTxErr] → ShowS # | |
Serialise ByronSpecGenTxErr Source # | |
type Rep ByronSpecGenTxErr Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.GenTx type Rep ByronSpecGenTxErr = D1 ('MetaData "ByronSpecGenTxErr" "Ouroboros.Consensus.ByronSpec.Ledger.GenTx" "ouroboros-consensus-cardano-0.20.0.0-inplace-unstable-byronspec" 'True) (C1 ('MetaCons "ByronSpecGenTxErr" 'PrefixI 'True) (S1 ('MetaSel ('Just "unByronSpecGenTxErr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty (PredicateFailure CHAIN))))) |
data ByronSpecBlock Source #
Block according to the Byron spec
Just like we do for ByronBlock
, we cache the header hash. In addition, we
also add the BlockNo
, as this is entirely absent from the spec but we need
it for the HasHeader
abstraction, which is ubiquitous in
ouroboros-consensus
and -network
.
Instances
type ByronSpecHeader = Header ByronSpecBlock Source #
newtype ByronSpecLedgerError Source #
Instances
forgeByronSpecBlock ∷ BlockNo → SlotNo → Ticked (LedgerState ByronSpecBlock) → [Validated (GenTx ByronSpecBlock)] → VKey → ByronSpecBlock Source #