Describes the different representations that can be stored persistently.

Signatures

module type SINGLETON_STORE = sig ... end

A store composed of a single file on disk

module type INDEXABLE_STORE = sig ... end

An index store mapping keys to values. It is composed of an index only.

module type INDEXABLE_REMOVABLE_STORE = sig ... end

An index store mapping keys to values. Keys are associated to optional values in the index which allows them to be removed.

Indexed stores

module L2_block_store : sig ... end

A persistent store on disk for storing L2 blocks. It is composed of an index file and a data file which contains the actual blocks. The keys of the index are the L2 block hashes.

Pure index stores

module Tezos_block_store : sig ... end

An index store to map Tezos block hashes to L2 block hashes. It is composed of an index only. This store is used to remember which Tezos blocks have been processed by the Tx rollup node. When there is no inbox for a Tezos block, we associate to it the L2 block of its predecessor.

An index store to map L2 block level to L2 block hashes. It is composed of an index only.

module Commitment_store : sig ... end

An index store to map commitment hashes to their inclusion information.

Singleton stores

A store composed of a single file on disk to store the current head

A store composed of a single file on disk to store the current Tezos head

type rollup_info = {
  1. rollup_id : Tezos_protocol_013_PtJakart.Protocol.Alpha_context.Tx_rollup.t;
  2. origination_level : int32 option;
}

Type for on disk information about a rollup

A store composed of a single file on disk to store the rollup information. This is used to guarantee consistency between several runs of the Tx rollup node.

A store composed of a single file on disk to store the last finalized rollup level (on L1)

type t = {
  1. blocks : L2_block_store.t;
  2. tezos_blocks : Tezos_block_store.t;
  3. levels : Level_store.t;
  4. commitments : Commitment_store.t;
  5. head : Head_store.t;
  6. tezos_head : Tezos_head_store.t;
  7. rollup_info : Rollup_info_store.t;
  8. finalized_level : Finalized_level_store.t;
}

The type of all stores of the Tx rollup node.

val init : data_dir:string -> readonly:bool -> blocks_cache_size:int -> t Lwt.t

init ~data_dir ~readonly ~blocks_cache_size creates or loads existing stores located in the directory data_dir. If readonly (defaults to false) is set, the stores can only be read. An LRU cache of size blocks_cache_size is used for reading L2 blocks.

val close : t -> unit Lwt.t

close store closes all the stores by closing the indexes and the associated opened file descriptors.