Module Mavryk_raw_protocol_alpha.Dal_slot_storage

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:

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.

finalize_current_slot_headers ctxt finalizes the current slot headers posted on this block and marks them as pending into the context.

finalize_pending_slot_headers ctxt ~number_of_slots 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.

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.

val compute_attested_slot_headers : is_slot_attested:(Dal_slot_repr.Header.t -> bool) -> Dal_slot_repr.Header.t list -> Dal_slot_repr.Header.t list * Dal_attestation_repr.t

compute_attested_slot_headers ~is_slot_attested published_slot_headers filter the given published_slot_headers and return the list of attested slot headers and the corresponding bitset.