Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.ByronSpec.Ledger
Synopsis
- data family GenTx blk
- data family Validated x
- data family LedgerState blk
- data family BlockConfig blk
- data family CodecConfig blk
- data family StorageConfig blk
- data family Header blk
- data family Ticked st
- data ByronSpecGenesis = ByronSpecGenesis {
- byronSpecGenesisDelegators ∷ Set VKeyGenesis
- byronSpecGenesisInitUtxo ∷ UTxO
- byronSpecGenesisInitPParams ∷ PParams
- byronSpecGenesisSecurityParam ∷ BlockCount
- byronSpecGenesisSlotLength ∷ Natural
- type ByronSpecHeader = Header ByronSpecBlock
- data ByronSpecBlock = ByronSpecBlock {
- byronSpecBlock ∷ Block
- byronSpecBlockNo ∷ BlockNo
- byronSpecBlockHash ∷ Hash
- newtype ByronSpecLedgerError = ByronSpecLedgerError {
- unByronSpecLedgerError ∷ [PredicateFailure CHAIN]
- initByronSpecLedgerState ∷ ByronSpecGenesis → LedgerState ByronSpecBlock
- newtype ByronSpecGenTxErr = ByronSpecGenTxErr {
- unByronSpecGenTxErr ∷ [PredicateFailure CHAIN]
- data ByronSpecGenTx
- = ByronSpecGenTxDCert DCert
- | ByronSpecGenTxTx Tx
- | ByronSpecGenTxUProp UProp
- | ByronSpecGenTxVote Vote
- forgeByronSpecBlock ∷ BlockNo → SlotNo → Ticked (LedgerState ByronSpecBlock) → [Validated (GenTx ByronSpecBlock)] → VKey → ByronSpecBlock
Documentation
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 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
Show (Validated (GenTx ByronSpecBlock)) Source # | |
Generic (Validated (GenTx ByronSpecBlock)) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Mempool Methods from ∷ Validated (GenTx ByronSpecBlock) → Rep (Validated (GenTx ByronSpecBlock)) x Source # to ∷ Rep (Validated (GenTx ByronSpecBlock)) x → Validated (GenTx ByronSpecBlock) Source # | |
NoThunks (Validated (GenTx ByronSpecBlock)) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Mempool | |
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-byronspec-0.1.0.0-inplace" 'True) (C1 ('MetaCons "ValidatedByronSpecGenTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "forgetValidatedByronSpecGenTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (GenTx ByronSpecBlock)))) | |
newtype Validated (GenTx ByronSpecBlock) Source # | |
data family LedgerState blk Source #
Ledger state associated with a block
Instances
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 Associated Types type Rep (BlockConfig ByronSpecBlock) ∷ Type → Type Source # Methods from ∷ BlockConfig ByronSpecBlock → Rep (BlockConfig ByronSpecBlock) x Source # to ∷ Rep (BlockConfig ByronSpecBlock) x → BlockConfig ByronSpecBlock Source # | |
NoThunks (BlockConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block Methods noThunks ∷ Context → BlockConfig ByronSpecBlock → IO (Maybe ThunkInfo) # wNoThunks ∷ Context → BlockConfig ByronSpecBlock → IO (Maybe ThunkInfo) # | |
data BlockConfig ByronSpecBlock Source # | |
type Rep (BlockConfig 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 Associated Types type Rep (CodecConfig ByronSpecBlock) ∷ Type → Type Source # Methods from ∷ CodecConfig ByronSpecBlock → Rep (CodecConfig ByronSpecBlock) x Source # to ∷ Rep (CodecConfig ByronSpecBlock) x → CodecConfig ByronSpecBlock Source # | |
NoThunks (CodecConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block Methods noThunks ∷ Context → CodecConfig ByronSpecBlock → IO (Maybe ThunkInfo) # wNoThunks ∷ Context → CodecConfig ByronSpecBlock → IO (Maybe ThunkInfo) # | |
data CodecConfig ByronSpecBlock Source # | |
type Rep (CodecConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block |
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 Associated Types type Rep (StorageConfig ByronSpecBlock) ∷ Type → Type Source # Methods from ∷ StorageConfig ByronSpecBlock → Rep (StorageConfig ByronSpecBlock) x Source # to ∷ Rep (StorageConfig ByronSpecBlock) x → StorageConfig ByronSpecBlock Source # | |
NoThunks (StorageConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block Methods noThunks ∷ Context → StorageConfig ByronSpecBlock → IO (Maybe ThunkInfo) # wNoThunks ∷ Context → StorageConfig ByronSpecBlock → IO (Maybe ThunkInfo) # showTypeOf ∷ Proxy (StorageConfig ByronSpecBlock) → String # | |
data StorageConfig ByronSpecBlock Source # | |
type Rep (StorageConfig ByronSpecBlock) Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Block |
data family Header blk Source #
Instances
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
data ByronSpecGenesis Source #
The equivalent of the genesis config for the abstract ledger
Constructors
ByronSpecGenesis | |
Fields
|
Instances
Show ByronSpecGenesis Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Genesis | |
NoThunks ByronSpecGenesis Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Genesis Methods noThunks ∷ Context → ByronSpecGenesis → IO (Maybe ThunkInfo) # wNoThunks ∷ Context → ByronSpecGenesis → IO (Maybe ThunkInfo) # |
type ByronSpecHeader = Header ByronSpecBlock Source #
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
.
Constructors
ByronSpecBlock | |
Fields
|
Instances
newtype ByronSpecLedgerError Source #
Constructors
ByronSpecLedgerError | |
Fields
|
Instances
Eq ByronSpecLedgerError Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods (==) ∷ ByronSpecLedgerError → ByronSpecLedgerError → Bool Source # (/=) ∷ ByronSpecLedgerError → ByronSpecLedgerError → Bool Source # | |
Show ByronSpecLedgerError Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger | |
NoThunks ByronSpecLedgerError Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.Ledger Methods noThunks ∷ Context → ByronSpecLedgerError → IO (Maybe ThunkInfo) # wNoThunks ∷ Context → ByronSpecLedgerError → IO (Maybe ThunkInfo) # |
newtype ByronSpecGenTxErr Source #
Transaction errors
We don't distinguish these from any other kind of CHAIN failure.
Constructors
ByronSpecGenTxErr | |
Fields
|
Instances
Show ByronSpecGenTxErr Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.GenTx | |
Generic ByronSpecGenTxErr Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.GenTx Methods | |
Serialise ByronSpecGenTxErr Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.GenTx Methods encode ∷ ByronSpecGenTxErr → Encoding # decode ∷ Decoder s ByronSpecGenTxErr # encodeList ∷ [ByronSpecGenTxErr] → Encoding # decodeList ∷ Decoder s [ByronSpecGenTxErr] # | |
type Rep ByronSpecGenTxErr Source # | |
Defined in Ouroboros.Consensus.ByronSpec.Ledger.GenTx type Rep ByronSpecGenTxErr = D1 ('MetaData "ByronSpecGenTxErr" "Ouroboros.Consensus.ByronSpec.Ledger.GenTx" "ouroboros-consensus-byronspec-0.1.0.0-inplace" 'True) (C1 ('MetaCons "ByronSpecGenTxErr" 'PrefixI 'True) (S1 ('MetaSel ('Just "unByronSpecGenTxErr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PredicateFailure CHAIN]))) |
data ByronSpecGenTx Source #
Generalized transaction
The spec doesn't have a type for this, instead splitting the block body into separate lists
Constructors
ByronSpecGenTxDCert DCert | |
ByronSpecGenTxTx Tx | |
ByronSpecGenTxUProp UProp | |
ByronSpecGenTxVote Vote |
Instances
forgeByronSpecBlock ∷ BlockNo → SlotNo → Ticked (LedgerState ByronSpecBlock) → [Validated (GenTx ByronSpecBlock)] → VKey → ByronSpecBlock Source #