cardano-ledger-byron-1.0.2.0: The blockchain layer of Cardano during the Byron era
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Chain.Byron.API

Description

Auxiliary definitions to make working with the Byron ledger easier

Synopsis

Extract info from chain state

Applying blocks

applyChainTickConfigSlotNumberChainValidationStateChainValidationState Source #

Apply chain tick

This is the part of block processing that depends only on the slot number of the block: We update

  • The update state
  • The delegation state
  • The last applied slot number

NOTE: The spec currently only updates the update state here; this is not good enough. Fortunately, updating the delegation state and slot number here (currently done in body processing) is at least conform spec, as these updates are conform spec. See

https://github.com/intersectmbo/cardano-ledger/issues/1046 https://github.com/input-output-hk/ouroboros-network/issues/1291

validateBoundaryMonadError ChainValidationError m ⇒ ConfigABoundaryBlock ByteStringChainValidationState → m ChainValidationState Source #

Apply a boundary block

NOTE: The cvsLastSlot calculation must match the one in abobHdrSlotNo.

Applying transactions

data ApplyMempoolPayloadErr Source #

Errors that arise from applying an arbitrary mempool payload

Although cardano-legder defines MempoolPayload, it does not define a corresponding error type. We could ChainValidationError, but it's too large, which is problematic because we actually sent encoded versions of these errors across the wire.

Instances

Instances details
Show ApplyMempoolPayloadErr Source # 
Instance details

Defined in Cardano.Chain.Byron.API.Mempool

FromCBOR ApplyMempoolPayloadErr Source # 
Instance details

Defined in Cardano.Chain.Byron.API.Mempool

ToCBOR ApplyMempoolPayloadErr Source # 
Instance details

Defined in Cardano.Chain.Byron.API.Mempool

DecCBOR ApplyMempoolPayloadErr Source # 
Instance details

Defined in Cardano.Chain.Byron.API.Mempool

EncCBOR ApplyMempoolPayloadErr Source # 
Instance details

Defined in Cardano.Chain.Byron.API.Mempool

Eq ApplyMempoolPayloadErr Source # 
Instance details

Defined in Cardano.Chain.Byron.API.Mempool

mempoolPayloadRecoverBytesAMempoolPayload ByteStringByteString Source #

The encoding of the mempool payload (without a AMempoolPayload envelope)

mempoolPayloadReencodeAMempoolPayload a → ByteString Source #

Re-encode the mempool payload (without any envelope)

Protocol

previewDelegationMapSlotNumberChainValidationStateMap Source #

Preview the delegation map at a slot assuming no new delegations are | scheduled.

Annotations

reAnnotateUsing ∷ ∀ f a. Functor f ⇒ (f a → Encoding) → (∀ s. Decoder s (f ByteSpan)) → f a → f ByteString Source #

Generalization of reAnnotate

Headers

abobMatchesBodyABlockOrBoundaryHdr ByteStringABlockOrBoundary ByteStringBool Source #

Check if a block matches its header

For EBBs, we're currently being more permissive here and not performing any header-body validation but only checking whether an EBB header and EBB block were provided. This seems to be fine as it won't cause any loss of consensus with the old `cardano-sl` nodes.