package tezos-protocol-012-Psithaca

  1. Overview
  2. Docs
Tezos/Protocol: economic-protocol definition

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-16.0.tar.gz
sha256=ad9e08819871c75ba6f4530b125f7d157799398e4d77a1e6bfea9d91ff37ff55
sha512=c5dc4d40cc09bc6980fbbdb5c2e105bf4252cf9cfcb2b49660b0ebe4dc789f6709ec3b3bf2f87d81580d3eed9521eeb1c960f24d9b14eb0285aaba1f84d10a9b

doc/tezos-protocol-012-Psithaca.raw/Tezos_raw_protocol_012_Psithaca/Lazy_storage_kind/index.html

Module Tezos_raw_protocol_012_Psithaca.Lazy_storage_kindSource

Lazy_storage offers a unified interface for specific Michelson datatype that behave somewhat lazily, because they are intended to be quite big. Instead of serializing/deserializing the whole value to/from the storage, only an identifier is used. The identifier acts like a pointer. When using the value in a Michelson script, some part of it may be read from the storage, and a lightweight diff is computed. The diff is effectively applied to the storage at the end of the execution.

This module defines the different kinds of lazy storages and their basic properties. See also Lazy_storage_diff.

Lazy storage types are:

  • Big_map
Sourcemodule type ID = sig ... end

Lazy storage ids are kept as abstract as possible to avoid mixing them up.

Sourcemodule Big_map : sig ... end
Sourcemodule Sapling_state : sig ... end
Sourcetype ('id, 'alloc, 'updates) t =
  1. | Big_map : (Big_map.Id.t, Big_map.alloc, Big_map.updates) t
  2. | Sapling_state : (Sapling_state.Id.t, Sapling_state.alloc, Sapling_state.updates) t

Kinds of lazy storage. The GADT ensures operations are properly applied to the correct kind.

'id the abstract type for the identifier of the kind. 'alloc is the type used to construct a new value. 'updates is the type used to update a value.

Sourcetype ex =
  1. | Ex_Kind : (_, _, _) t -> ex
Sourceval all : (int * ex) list
Sourcetype (_, _) cmp =
  1. | Eq : ('a, 'a) cmp
  2. | Neq
Sourceval equal : ('i1, 'a1, 'u1) t -> ('i2, 'a2, 'u2) t -> ('i1 * 'a1 * 'u1, 'i2 * 'a2 * 'u2) cmp
Sourcetype ('i, 'a, 'u) kind = ('i, 'a, 'u) t
Sourcemodule Temp_ids : sig ... end

Type to manage temporary ids. Used only in the context.

Sourcemodule IdSet : sig ... end
OCaml

Innovation. Community. Security.