Module Tezos_dal_node_lib.Store

This module handles the on-disk storage of the DAL node. We rely on the Key_value_store module from lib_stdlib_unix. For shards storage, we rely on a cache mechanism in the case of non-prover profiles.

module Shards : sig ... end

A shard of some slot id consist of a shard index (a number between 0 and the number_of_shards protocol parameter) and a share. The shard store is a mapping associating 0 or 1 share to each (slot_id, shard index) pair.

module Slots : sig ... end

A store of slots, indexed by slot id.

module Slot_id_cache : sig ... end
module Statuses : sig ... end

A store keeping the attestation status of slot ids.

module Commitment_indexed_cache : sig ... end
module Traps : sig ... end
module First_seen_level : Single_value_store.S with type value = int32
module Storage_backend : sig ... end

Storage backend for storage components supporting multiple backends.

type t

The DAL node store.

cache t returns the cache associated with the store t.

val first_seen_level : t -> First_seen_level.t

first_seen_level t returns the first seen level store associated with the store t.

val finalized_commitments : t -> Slot_id_cache.t

finalized_commitments t returns the cache of commitments indexed by level and then by slot id associated with the store t. The maximum number of levels is given by Constants.slot_id_cache_size. No more than number_of_slots commitments can be stored per level.

val last_processed_level : t -> Last_processed_level.t

last_processed_level t returns the last processed level store associated with the store t.

val shards : t -> Shards.t

shards t returns the shards store associated with the store t.

val skip_list_cells : t -> Dal_store_sqlite3.Skip_list_cells.t

skip_list_cells t returns the skip list cells store associated with the store t.

val slot_header_statuses : t -> Statuses.t

slot_header_statuses t returns the statuses store associated with the store t.

val slots : t -> Slots.t

slots t returns the slots store associated with the store t.

val traps : t -> Traps.t

traps t returns the traps store associated with the store t.

val cache_entry : t -> Tezos_crypto_dal.Cryptobox.commitment -> Tezos_crypto_dal.Cryptobox.slot -> Tezos_crypto_dal.Cryptobox.share array -> Tezos_crypto_dal.Cryptobox.shard_proof array -> unit

cache_entry store commitment entry adds or replace an entry to the cache with key commitment.

init config profile_ctxt proto_parameters inits the store on the filesystem using the given config, profile_ctxt and proto_parameters.

val add_slot_headers : number_of_slots:int -> block_level:int32 -> Dal_plugin.slot_header list -> t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

add_slot_headers ~number_of_slots ~block_level slot_headers store processes the slot_headers published at block_level. Concretely, for each slot header successfully applied in the L1 block,

  • It is added to disk store slot_header_statuses with a `Waiting_attestation status (indexed by slot_id);
  • It is added to the 2D memory cache finalized_commitments, indexed by publication level and slots indices.
module Skip_list_cells : sig ... end

Skip_list_cells manages the storage of Skip_list_cell.t