package octez-smart-rollup-node-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

This version of the store is used for the rollup nodes for protocol Mumbai, i.e. = 16.

This interface is a copy of src/proto_016_PtMumbai/lib_sc_rollup_node/store.mli, which contains the layout for the Mumbai rollup node.

module Irmin_store : sig ... end
module L2_blocks : Tezos_layer2_store.Indexed_store.INDEXED_FILE with type key := Tezos_base.TzPervasives.Block_hash.t and type value := (unit, unit) Octez_smart_rollup.Sc_rollup_block.block and type header := Octez_smart_rollup.Sc_rollup_block.header
module Messages : Tezos_layer2_store.Indexed_store.INDEXED_FILE with type key := Octez_smart_rollup.Merkelized_payload_hashes_hash.t and type value := string list and type header := Tezos_base.TzPervasives.Block_hash.t * Tezos_base.Time.Protocol.t * int

Storage for persisting messages downloaded from the L1 node.

module Inboxes : Tezos_layer2_store.Indexed_store.SIMPLE_INDEXED_FILE with type key := Octez_smart_rollup.Inbox.Hash.t and type value := Octez_smart_rollup.Inbox.V1.t and type header := unit

Aggregated collection of messages from the L1 inbox

module Commitments : Tezos_layer2_store.Indexed_store.INDEXABLE_STORE with type key := Octez_smart_rollup.Commitment.Hash.t and type value := Octez_smart_rollup.Commitment.t

Storage containing commitments and corresponding commitment hashes that the rollup node has knowledge of.

module Commitments_published_at_level : sig ... end

Storage mapping commitment hashes to the level when they were published by the rollup node. It only contains hashes of commitments published by this rollup node.

module L2_head : Tezos_layer2_store.Indexed_store.SINGLETON_STORE with type value := Octez_smart_rollup.Sc_rollup_block.t
module Last_finalized_level : Tezos_layer2_store.Indexed_store.SINGLETON_STORE with type value := int32
module Levels_to_hashes : Tezos_layer2_store.Indexed_store.INDEXABLE_STORE with type key := int32 and type value := Tezos_base.TzPervasives.Block_hash.t
module Dal_slots_headers : Tezos_layer2_store.Store_sigs.Nested_map with type primary_key := Tezos_base.TzPervasives.Block_hash.t and type secondary_key := Octez_smart_rollup.Dal.Slot_index.t and type value := Octez_smart_rollup.Dal.Slot_header.V1.t and type 'a store := 'a Irmin_store.t

Published slot headers per block hash, stored as a list of bindings from Dal_slot_index.t to Dal.Slot.t. The encoding function converts this list into a Dal.Slot_index.t-indexed map.

module Dal_confirmed_slots_history : Tezos_layer2_store.Store_sigs.Append_only_map with type key := Tezos_base.TzPervasives.Block_hash.t and type value := Octez_smart_rollup.Dal.Slot_history.V1.t and type 'a store := 'a Irmin_store.t
module Dal_confirmed_slots_histories : Tezos_layer2_store.Store_sigs.Append_only_map with type key := Tezos_base.TzPervasives.Block_hash.t and type value := Octez_smart_rollup.Dal.Slot_history_cache.V1.t and type 'a store := 'a Irmin_store.t

Confirmed DAL slots histories cache. See documentation of Dal_slot_repr.Slots_history for more details.

module Dal_slot_pages : Tezos_layer2_store.Store_sigs.Nested_map with type primary_key := Tezos_base.TzPervasives.Block_hash.t and type secondary_key := Octez_smart_rollup.Dal.Slot_index.t * Octez_smart_rollup.Dal.Page_index.t and type value := bytes and type 'a store := 'a Irmin_store.t

Dal_slot_pages is a Store_utils.Nested_map used to store the contents of dal slots fetched by the rollup node, as a list of pages. The values of this storage module have type `string list`. A value of the form page_contents refers to a page of a slot that has been confirmed, and whose contents are page_contents.

module Dal_processed_slots : Tezos_layer2_store.Store_sigs.Nested_map with type primary_key := Tezos_base.TzPervasives.Block_hash.t and type secondary_key := Octez_smart_rollup.Dal.Slot_index.t and type value := [ `Confirmed | `Unconfirmed ] and type 'a store := 'a Irmin_store.t

Dal_processed_slots is a Store_utils.Nested_map used to store the processing status of dal slots content fetched by the rollup node. The values of this storage module have type ``Confirmed | `Unconfirmed`, depending on whether the content of the slot has been confirmed or not. If an entry is not present for a (block_hash, slot_index), this either means that it's not processed yet.

type +'a store = {
  1. l2_blocks : 'a L2_blocks.t;
  2. messages : 'a Messages.t;
  3. inboxes : 'a Inboxes.t;
  4. commitments : 'a Commitments.t;
  5. commitments_published_at_level : 'a Commitments_published_at_level.t;
  6. l2_head : 'a L2_head.t;
  7. last_finalized_level : 'a Last_finalized_level.t;
  8. levels_to_hashes : 'a Levels_to_hashes.t;
  9. irmin_store : 'a Irmin_store.t;
}
include Store_sig.S with type 'a store := 'a store
type 'a t = [< `Read | `Write Read ] as 'a store

Type of store. The parameter indicates if the store can be written or only read.

type rw = Tezos_layer2_store.Store_sigs.rw t

Read/write store t.

type ro = Tezos_layer2_store.Store_sigs.ro t

Read only store t.

val version : Store_version.t

Version supported by this code.

close store closes the store.

val load : 'a Tezos_layer2_store.Store_sigs.mode -> index_buffer_size:int -> l2_blocks_cache_size:int -> string -> 'a store Tezos_base.TzPervasives.tzresult Lwt.t

load mode ~index_buffer_size ~l2_blocks_cache_size directory loads a store from the data persisted in directory. If mode is Store_sigs.Read_only, then the indexes and irmin store will be opened in readonly mode and only read operations will be permitted. This allows to open a store for read access that is already opened in Store_sigs.Read_write mode in another process. index_buffer_size is the maximum cache size in memory before it is flushed to disk. l2_blocks_cache_size is the number of L2 blocks the rollup node will keep in memory.

val readonly : _ t -> ro

readonly store returns a read-only version of store.

val iter_l2_blocks : ?progress:string -> Metadata.t -> _ t -> (Octez_smart_rollup.Sc_rollup_block.t -> unit Tezos_base.TzPervasives.tzresult Lwt.t) -> unit Tezos_base.TzPervasives.tzresult Lwt.t

iter_l2_blocks ?progress metadata store f iterates f on all L2 blocks reachable from the head, from newest to oldest. If progress is provided, a progress bar is displayed with the progress messages during the iteration.

val gc : rw -> level:int32 -> unit Tezos_base.TzPervasives.tzresult Lwt.t

gc store ~level asynchronously garbage collects everything from the store that concerns blocks for levels below level.

val wait_gc_completion : 'a t -> unit Lwt.t

wait_gc_completion store returns a blocking thread if a GC run is currently ongoing.

OCaml

Innovation. Community. Security.