Module Irmin_context.PVMState

State of the PVM that this rollup node deals with

type value = mut_state

The value of a PVM state

val empty : unit -> value

empty () is the empty PVM state.

val find : _ t -> value option Lwt.t

find context returns the PVM state stored in the context, if any.

val get : _ t -> value Lwt.t
val lookup : value -> string list -> bytes option Lwt.t

lookup state path returns the data stored for the path path in the PVM state state.

val set : 'a t -> value -> unit Lwt.t

set context state saves the PVM state state in the context. Note: set does not perform any write on disk, this information must be committed using commit.

val commit : [> `Write ] index -> value -> hash Lwt.t

commit index state commits just the raw PVM state tree to disk and returns the commit hash. This is used for on-disk caching of PVM states during refutation game dissections. Unlike Irmin_context.commit, this commits the raw PVM state tree directly, not a full context tree with the /pvm_state subtree prefix.

Note: for the Irmin backend, in-memory caching via immutable copies is preferred (see cache_preference). These functions are provided for interface completeness but are not used in practice.

val checkout : _ index -> hash -> value option Lwt.t

checkout index hash restores a PVM state from the commit hash. Returns None if the commit is not found. See commit for details.