package octez-l2-libs

  1. Overview
  2. Docs
Octez layer2 libraries

Install

Dune Dependency

Authors

Maintainers

Sources

octez-19.0.tar.gz
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13

doc/octez-l2-libs.layer2_store/Tezos_layer2_store/Indexed_store/index.html

Module Tezos_layer2_store.Indexed_storeSource

This library provides functors to build various kinds of stores using mirage's index and Octez data-encoding libraries.

It is tailored to build stores for the Layer 2 nodes of Tezos (Tx-rollups and Smart rollups).

The stores built with this library support concurrent accesses thanks to the use of the light scheduler provided by Lwt_idle_waiter for exclusive write access.

Signatures

Sourcetype ('key, 'value) gc_iterator =
  1. | Retain of 'key list
    (*

    A simple list of keys to retain.

    *)
  2. | Iterator of {
    1. first : 'key;
      (*

      The key at which the iteration starts for the GC.

      *)
    2. next : 'key -> 'value -> 'key option Lwt.t;
      (*

      A function to compute the next element to explore from the last expired key, value binding in the store. We explicit the value here because the next element can be computed from it without accessing the store (e.g. to iterate over L2 blocks, we start from the head and the next element is computed from the predecessor field of the block.

      *)
    }
    (*

    An iterator. The GC stops when the next function returns None.

    *)

An iterator for the GC functions.

Sourcemodule type SINGLETON_STORE = sig ... end

A store for single updatable values. Values are stored in a file on disk and are kept in memory in a cache.

Sourcemodule type INDEXABLE_STORE = sig ... end

An index store mapping keys to values. It uses an index file internally.

Sourcemodule 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.

Sourcemodule type INDEXED_FILE = sig ... end

An indexed file (i.e. a file and an index) mapping keys to values. Contrary to INDEXABLE_STORE, the values can vary in size. Internally, values are stored, concatenated, in a append only file. The index file associates keys to offsets in this file (and a header to retrieve information more efficiently).

Sourcemodule type SIMPLE_INDEXED_FILE = sig ... end

Same as INDEXED_FILE but where headers are extracted from values.

Sourcemodule type NAME = sig ... end

Names for stores.

Sourcemodule type INDEX_KEY = sig ... end

Values that can be used as keys for indices.

Sourcemodule type ENCODABLE_VALUE = sig ... end

Values that can be encoded.

Sourcemodule type FIXED_ENCODABLE_VALUE = sig ... end

Values that can be encoded and whose encoding is a fixed size.

Sourcemodule type ENCODABLE_VALUE_HEADER = sig ... end

Values with a given fixed size header.

Functors

Sourcemodule Make_indexable (_ : NAME) (K : INDEX_KEY) (V : Index.Value.S) : INDEXABLE_STORE with type key := K.t and type value := V.t
Sourcemodule Make_indexed_file (_ : NAME) (K : INDEX_KEY) (V : ENCODABLE_VALUE_HEADER) : INDEXED_FILE with type key := K.t and type value := V.t and type header := V.Header.t
Sourcemodule Make_simple_indexed_file (_ : NAME) (K : INDEX_KEY) (V : sig ... end) : SIMPLE_INDEXED_FILE with type key := K.t and type value := V.t and type header := V.Header.t

Helper functors

Sourcemodule Make_index_key (E : sig ... end) : INDEX_KEY with type t = E.t
OCaml

Innovation. Community. Security.