package octez-l2-libs

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

Module Tezos_layer2_store.ContextSource

This module dipatches context calls to contexts/pvm_states corresponding to the used pvm

This module is largely inspired from Tezos_protocol_environment.Environement_context

Sourcetype ('repo, 'tree) pvm_context_impl = (module Context_sigs.S with type repo = 'repo and type tree = 'tree)

See Tezos_protocol_environment.Environement_context.ops

Sourcetype 'a t = private
  1. | Context : {
    1. index : ('a, 'repo) Context_sigs.index;
    2. pvm_context_impl : ('repo, 'tree) pvm_context_impl;
    3. impl_name : string;
    4. tree : 'tree;
    5. equality_witness : ('repo, 'tree) Context_sigs.equality_witness;
    } -> 'a t

See Tezos_protocol_environment.Environement_context.t

Sourcetype rw = [ `Read | `Write ] t

Read/write context t.

Sourcetype ro = [ `Read ] t

Read-only context t.

Sourceval make : index:('a, 'b) Context_sigs.index -> tree:'c -> pvm_context_impl:('b, 'c) pvm_context_impl -> equality_witness:('b, 'c) Context_sigs.equality_witness -> impl_name:string -> 'a t
Sourcetype hash = Tezos_base.TzPervasives.Context_hash.t
Sourceval load : ('repo, 'tree) pvm_context_impl -> cache_size:int -> [< `Read | `Write Read ] as 'a Store_sigs.mode -> string -> 'a t Tezos_base.TzPervasives.tzresult Lwt.t

load cache_size path initializes from disk a context from path. cache_size allows to change size of the Context Backend in use (for instance, the LRU cache size of Irmin (100_000 by default at irmin-pack/config.ml)

Sourceval index : 'a t -> 'a t

index context is the repository of the context context.

Sourceval close : 'a t -> unit Lwt.t

close ctxt closes the context index ctxt.

Sourceval readonly : [> `Read ] t -> [ `Read ] t

readonly index returns a read-only version of the index.

Sourceval checkout : 'a t -> hash -> 'a t option Lwt.t

checkout ctxt hash checkouts the content that corresponds to the commit hash hash in the repository ctxt and returns the corresponding context. If there is no commit that corresponds to hash, it returns None.

Sourceval empty : 'a t -> 'a t

empty ctxt is the context with an empty content for the repository ctxt.

Sourceval commit : ?message:string -> [ `Read | `Write ] t -> hash Lwt.t

commit ?message context commits content of the context context on disk, and return the commit hash.

Sourceval is_gc_finished : [ `Read | `Write ] t -> bool

is_gc_finished index returns true if a GC is finished (or idle) and false if a GC is running for index.

Sourceval split : _ t -> unit

split ctxt creates a new suffix file, also called "chunk", into the context's file hierarchy. This split function is expected to be called after committing a commit that will be a future candidate for a GC target.

Sourceval gc : [ `Read | `Write ] t -> ?callback:(unit -> unit Lwt.t) -> hash -> unit Lwt.t

gc index ?callback hash removes all data older than hash from disk. If passed, callback will be executed when garbage collection finishes.

Sourceval wait_gc_completion : [ `Read | `Write ] t -> unit Lwt.t

wait_gc_completion index will return a blocking thread if a GC run is currently ongoing.

Sourceval export_snapshot : _ t -> hash -> path:string -> unit Tezos_base.TzPervasives.tzresult Lwt.t

export_snapshot index context_hash ~path exports the context corresponding to context_hash, if found in index, into the given folder path.

Sourcetype pvmstate =
  1. | PVMState : {
    1. pvm_context_impl : ('repo, 'tree) pvm_context_impl;
    2. impl_name : string;
    3. pvmstate : 'tree;
    4. equality_witness : ('repo, 'tree) Context_sigs.equality_witness;
    } -> pvmstate
Sourceval make_pvmstate : pvm_context_impl:('a, 'b) pvm_context_impl -> equality_witness:('a, 'b) Context_sigs.equality_witness -> impl_name:string -> pvmstate:'b -> pvmstate
Sourcemodule PVMState : sig ... end

State of the PVM that this rollup node deals with

Sourcemodule Version : sig ... end
Sourcemodule Internal_for_tests : sig ... end
OCaml

Innovation. Community. Security.