package tezos-protocol-alpha
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Dal_slot_storage/index.html
Module Tezos_raw_protocol_alpha.Dal_slot_storage
Source
Storage management of slots for the data-availability layer.
Overview
This module is an interface for the slot storage for the layer 1.
Depending on the current level of the context and the attestation_lag
(a constant given by the context), the status of the slot may differ:
- For every level in the interval
current_level; current_level + attestation_lag - 1
the slot isPending
. This means a slot header was proposed but was not declared available yet.
- For every level above
current_level + attestation_lag
, the slot may beattested
. For any slot attested by the protocol (i.e. indices returned byfinalize_pending_slots
), subscribers of the DAL should take into account the corresponding slots.
- For every level below
current_level - attestation_lag
, there should not be any slot in the storage.
val find_slot_headers :
Raw_context.t ->
Raw_level_repr.t ->
Dal_slot_repr.Header.t list option
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
find_slot_headers ctxt level
returns Some slot_headers
where slot_headers
are pending slots at level level
. None
is returned if no slot_header
was registered at this level. The function fails if the reading into the context fails.
val finalize_current_slot_headers :
Raw_context.t ->
Raw_context.t Tezos_protocol_environment_alpha.Lwt.t
finalize_current_slot_headers ctxt
finalizes the current slot headers posted on this block and marks them as pending into the context.
val finalize_pending_slot_headers :
Raw_context.t ->
(Raw_context.t * Dal_attestation_repr.t)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
finalize_pending_slot_headers ctxt
finalizes pending slot headers which are old enough (i.e. registered at level current_level - attestation_lag
). All slots marked as available are returned. All the pending slots at current_level - attestation_lag
level are removed from the context.
val get_slot_headers_history :
Raw_context.t ->
Dal_slot_repr.History.t Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
get_slot_headers_history ctxt
returns the current value of slots_history stored in ctxt
, or Slots_history.genesis if no value is stored yet.