Module Mavryk_raw_protocol_alpha.Sapling_storage

module type COMMITMENTS = sig ... end
module Ciphertexts : sig ... end
module Nullifiers : sig ... end
module Roots : sig ... end

Bounded queue of roots. The full size is initialized with the default uncommitted root, that's why roots storage doesn't need to be carbonated. A maximum of one new root is added per protocol level. If multiple transactions for the same shielded pool are processed during the same contract call or several calls in the same block, only the last root will be stored. This property prevents transactions in the same block from depending on each other and guarantees that a transaction will be valid for a least two hours (hence the 120 size) after being forged.

This type links the permanent state stored in the context at the specified id together with the ephemeral diff managed by the Michelson interpreter. After a successful execution the diff can be applied to update the state at id. The first time a state is created its id is None, one will be assigned after the first application.

val empty_diff : Sapling_repr.diff
val empty_state : ?id:Lazy_storage_kind.Sapling_state.Id.t -> memo_size:Sapling_repr.Memo_size.t -> unit -> state

Returns a state from an existing id.

Applies a diff to a state id stored in the context. Updates Commitments, Ciphertexts and Nullifiers using the diff and updates the Roots using the new Commitments tree.

val root_encoding : Mavryk_protocol_environment_alpha.Sapling.Hash.t Data_encoding.t