Module Evm_node_lib_dev.Durable_storage

Typed access layer for the EVM node durable storage.

All durable storage access MUST go through this module. The path GADT ensures type-safe read/write/delete operations. Raw_path is provided as an escape hatch for paths not yet modeled in the GADT. New code should add typed constructors instead of using Raw_path.

Typed path GADT

Typed operations

val storage_version : Pvm.State.t -> int Tezos_base.TzPervasives.tzresult Lwt.t
val read_opt : 'a path -> Pvm.State.t -> 'a option Tezos_base.TzPervasives.tzresult Lwt.t
val exists : 'a path -> Pvm.State.t -> bool Tezos_base.TzPervasives.tzresult Lwt.t

Deprecated untyped API

The functions below operate on raw durable storage paths (strings) with manual decoders. They will be removed once all callers have migrated to the typed GADT API above (read, read_opt, write, ...).

exception Invalid_block_structure of string
  • deprecated

    Use the typed path API instead.

val inspect_durable_and_decode_opt : Pvm.Context.tree -> string -> (bytes -> 'a) -> ('a option, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val inspect_durable_and_decode_default : default:'a -> Pvm.Context.tree -> string -> (bytes -> 'a) -> ('a, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t
  • deprecated

    Use read_opt with Option.value instead.

val inspect_durable_and_decode : Pvm.Context.tree -> string -> (bytes -> 'a) -> ('a, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t
  • deprecated

    Use read instead.

  • deprecated

    Use the typed path API instead.

  • deprecated

    Use the typed path API instead.

  • deprecated

    Use the typed path API instead.

  • deprecated

    Use the typed path API instead.