Mavryk_layer2_store.ContextThis module dipatches context calls to contexts/pvm_states corresponding to the used pvm
This module is largely inspired from Mavryk_protocol_environment.Environement_context
type ('repo, 'tree) pvm_context_impl =
(module Context_sigs.S
with type repo = 'repo
and type tree = 'tree)See Mavryk_protocol_environment.Environement_context.ops
type 'a t = private | Context : {index : ('a, 'repo) Context_sigs.index;pvm_context_impl : ('repo, 'tree) pvm_context_impl;impl_name : string;tree : 'tree;equality_witness : ('repo, 'tree) Context_sigs.equality_witness;} -> 'a tSee Mavryk_protocol_environment.Environement_context.t
val 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 tval equiv :
('a Context_sigs.Equality_witness.t * 'b Context_sigs.Equality_witness.t) ->
('c Context_sigs.Equality_witness.t * 'd Context_sigs.Equality_witness.t) ->
('a, 'c) Context_sigs.Equality_witness.eq option
* ('b, 'd) Context_sigs.Equality_witness.eq optiontype hash = Mavryk_base.TzPervasives.Context_hash.tval load :
('repo, 'tree) pvm_context_impl ->
cache_size:int ->
[< `Read | `Write Read ] as 'a Store_sigs.mode ->
string ->
'a t Mavryk_base.TzPervasives.tzresult Lwt.tload 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)
val close : 'a t -> unit Lwt.tclose ctxt closes the context index ctxt.
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.
commit ?message context commits content of the context context on disk, and return the commit hash.
val is_gc_finished : [ `Read | `Write ] t -> boolis_gc_finished index returns true if a GC is finished (or idle) and false if a GC is running for index.
val split : _ t -> unitsplit 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.
gc index ?callback hash removes all data older than hash from disk. If passed, callback will be executed when garbage collection finishes.
val wait_gc_completion : [ `Read | `Write ] t -> unit Lwt.twait_gc_completion index will return a blocking thread if a GC run is currently ongoing.
val export_snapshot :
_ t ->
hash ->
path:string ->
unit Mavryk_base.TzPervasives.tzresult Lwt.texport_snapshot index context_hash ~path exports the context corresponding to context_hash, if found in index, into the given folder path.
type pvmstate = | PVMState : {pvm_context_impl : ('repo, 'tree) pvm_context_impl;impl_name : string;pvmstate : 'tree;equality_witness : ('repo, 'tree) Context_sigs.equality_witness;} -> pvmstateval make_pvmstate :
pvm_context_impl:('a, 'b) pvm_context_impl ->
equality_witness:('a, 'b) Context_sigs.equality_witness ->
impl_name:string ->
pvmstate:'b ->
pvmstatemodule PVMState : sig ... endState of the PVM that this rollup node deals with
module Version : sig ... endmodule Internal_for_tests : sig ... end