package tezos-protocol-014-PtKathma
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-014-PtKathma.raw/Tezos_raw_protocol_014_PtKathma/Sapling_storage/index.html
Module Tezos_raw_protocol_014_PtKathma.Sapling_storage
Source
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.
type state = {
id : Lazy_storage_kind.Sapling_state.Id.t option;
diff : Sapling_repr.diff;
memo_size : Sapling_repr.Memo_size.t;
}
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_state :
?id:Lazy_storage_kind.Sapling_state.Id.t ->
memo_size:Sapling_repr.Memo_size.t ->
unit ->
state
val state_from_id :
Raw_context.t ->
Lazy_storage_kind.Sapling_state.Id.t ->
(state * Raw_context.t,
Tezos_protocol_environment_014_PtKathma.Error_monad.error
Tezos_protocol_environment_014_PtKathma.Error_monad.trace)
Tezos_protocol_environment_014_PtKathma.Pervasives.result
Tezos_protocol_environment_014_PtKathma.Lwt.t
Returns a state from an existing id.
val init :
Raw_context.t ->
Lazy_storage_kind.Sapling_state.Id.t ->
memo_size:Storage.Sapling.Memo_size.value ->
(Raw_context.t,
Tezos_protocol_environment_014_PtKathma.Error_monad.error
Tezos_protocol_environment_014_PtKathma.Error_monad.trace)
Tezos_protocol_environment_014_PtKathma.Pervasives.result
Tezos_protocol_environment_014_PtKathma.Lwt.t
val sapling_apply_diff_cost :
inputs:int ->
outputs:int ->
Saturation_repr.may_saturate Saturation_repr.t
val apply_diff :
Raw_context.t ->
Lazy_storage_kind.Sapling_state.Id.t ->
Sapling_repr.diff ->
(Raw_context.t * Tezos_protocol_environment_014_PtKathma.Z.t,
Tezos_protocol_environment_014_PtKathma.Error_monad.error
Tezos_protocol_environment_014_PtKathma.Error_monad.trace)
Tezos_protocol_environment_014_PtKathma.Pervasives.result
Tezos_protocol_environment_014_PtKathma.Lwt.t
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_mem :
Raw_context.t ->
state ->
Tezos_protocol_environment_014_PtKathma.Sapling.Hash.t ->
(bool,
Tezos_protocol_environment_014_PtKathma.Error_monad.error
Tezos_protocol_environment_014_PtKathma.Error_monad.trace)
Tezos_protocol_environment_014_PtKathma.Pervasives.result
Tezos_protocol_environment_014_PtKathma.Lwt.t
val nullifiers_mem :
Raw_context.t ->
state ->
Tezos_protocol_environment_014_PtKathma.Sapling.Nullifier.t ->
(Raw_context.t * bool,
Tezos_protocol_environment_014_PtKathma.Error_monad.error
Tezos_protocol_environment_014_PtKathma.Error_monad.trace)
Tezos_protocol_environment_014_PtKathma.Pervasives.result
Tezos_protocol_environment_014_PtKathma.Lwt.t
val nullifiers_add :
state ->
Tezos_protocol_environment_014_PtKathma.Sapling.Nullifier.t ->
state
val get_diff :
Raw_context.t ->
Storage.Sapling.id ->
?offset_commitment:Storage.Sapling.Ciphertexts.key ->
?offset_nullifier:Storage.Sapling.Nullifiers_ordered.key ->
unit ->
(Storage.Sapling.Roots.value * Sapling_repr.diff,
Tezos_protocol_environment_014_PtKathma.Error_monad.error
Tezos_protocol_environment_014_PtKathma.Error_monad.trace)
Tezos_protocol_environment_014_PtKathma.Pervasives.result
Tezos_protocol_environment_014_PtKathma.Lwt.t