Module Octez_riscv_nds_memory

In-memory implementation of the RISC-V new durable storage.

All data is held in RAM with no persistence. State is lost when the registry value is garbage collected. This variant is intended for fast execution without disk I/O.

Proof objects for the in-memory durable storage.

module Normal : sig ... end

Normal mode: registry and database operations.

val make_empty_normal_nds : unit -> Octez_riscv_nds_common.Nds.t

make_empty_normal_nds () allocates a fresh, empty in-memory normal-mode registry and wraps it as an opaque Nds.t handle. Convenience factory for callers that need a backend-erased empty NDS — most commonly the make_empty_nds field of a Wasm_vm.Make_vm instantiation.

Prove mode: registry, database, and proof lifecycle.

Verify mode: registry, database, and verify entry point.

Typed mode-switching

These constructors extend the common Nds.tag type with this backend's three mode tags, refining the wrapped registry type to a concrete in-memory variant. They let backend-aware callers recover the concrete Registry.t from an opaque Nds.t via the unwrap_* helpers below.

val unwrap_normal : Octez_riscv_nds_common.Nds.t -> Normal.Registry.t option

unwrap_normal nds returns Some r if nds was wrapped with Normal_tag, None otherwise. Callers that need the concrete Normal.Registry.t (e.g. to call Prove.start_proof) use this helper to escape the existential.

val unwrap_prove : Octez_riscv_nds_common.Nds.t -> Prove.Registry.t option

unwrap_prove nds returns Some r if nds was wrapped with Prove_tag, None otherwise.

val unwrap_verify : Octez_riscv_nds_common.Nds.t -> Verify.Registry.t option

unwrap_verify nds returns Some r if nds was wrapped with Verify_tag, None otherwise.