Module Tezos_smart_rollup_wasm_dual_state

Dual-storage WASM PVM backend, parameterized over an Irmin durable (Tezos_scoru_wasm.Wasm_pvm_sig.STATE_PROOF) and an NDS implementation (NDS_BACKEND).

Pairs the Irmin durable with an NDS handle. The phase model, the /pvm/nds_hash marker, the Irmin_only / Dual proof dispatch, and the soundness cross-checks are defined here, independent of both backends.

module type NDS_BACKEND = sig ... end

Operations a concrete NDS backend must provide; everything else in the dual-state logic is backend-agnostic.

exception Marker_handle_mismatch of string

Raised when a state's /pvm/nds_hash marker and its nds_state tag disagree, on presence or on value.

On the encoding and checkout paths both halves come from stores the node owns, so a disagreement is a store-drift bug and propagates. On the verification path the marker comes from an untrusted proof, so Dual_state.verify_proof catches this and rejects the proof rather than letting it escape into the protocol.

val empty_registry_hash : bytes

Content hash of an empty NDS registry — the expected /pvm/nds_hash marker on the (host-function-free) activation tick.

A constant of the NDS hashing scheme, not of any backend: a proof produced against one backend is verified against another (the rollup node proves on disk, the protocol verifies in memory), so the activation-tick cross-checks only make sense if every backend hashes the empty registry identically. Defined once here rather than required from each NDS_BACKEND.

module Make (Irmin : sig ... end) (Backend : NDS_BACKEND) : sig ... end

Make (Irmin) (Backend) specialises the dual-state WASM PVM to a concrete Irmin durable and NDS Backend.