package tezos-protocol-alpha
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Sc_rollup_stake_storage/index.html
Module Tezos_raw_protocol_alpha.Sc_rollup_stake_storage
Source
val remove_staker :
Raw_context.t ->
Sc_rollup_repr.t ->
Sc_rollup_repr.Staker.t ->
(Raw_context.t * Receipt_repr.balance_updates)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
remove_staker context rollup staker
forcibly removes the given staker
and confiscates their frozen deposits.
Removes staker
from the list of active stakers on the rollup
and clean its metadata.
val publish_commitment :
Raw_context.t ->
Sc_rollup_repr.t ->
Sc_rollup_repr.Staker.t ->
Sc_rollup_commitment_repr.t ->
(Sc_rollup_commitment_repr.Hash.t
* Raw_level_repr.t
* Raw_context.t
* Receipt_repr.balance_updates)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
publish_commitment context rollup staker commitment
published commitment
.
Starts by depositing a stake for staker
if staker
is not a known staker of rollup
. Then, staker
will use its stake to stake on commitment
.
For publishing to succeed, the following must hold:
- A deposit exists (or can be deposited) for
staker
. - The commitment respects the commitment period and is not published in advance.
- The commitment is not past the curfew, i.e., stakers has a limit on the available time to publish, if a staker already published for this inbox level.
- The
commitment.predecessor
exists. - The
commitment
contains at least one tick.
Returns the hash of the given commitment, the level when the commitment was first published by some staker, the modified context and the balance updates if a stake was deposited.
This function does not authenticate the staker.
val cement_commitment :
Raw_context.t ->
Sc_rollup_repr.t ->
Sc_rollup_commitment_repr.Hash.t ->
(Raw_context.t * Sc_rollup_commitment_repr.t)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
cement_commitment context rollup commitment
cements the given commitment whose hash is given (and returns the corresponding commitment).
For cementing to succeed, the following must hold:
- The deadline for
commitment
must have passed. - The predecessor of
commitment
must be the Last Cemented Commitment. - There must be at least one staker.
- All stakers must be indirectly staked on
commitment
.
If successful, Last Cemented commitment is set to the given commitment
, and deallocate the old cemented commitment accordingly to the number of stored cemented commitments.
Clean the storage for the metadata added for this inbox level.
val find_staker :
Raw_context.t ->
Sc_rollup_repr.t ->
Sc_rollup_repr.Staker.t ->
(Raw_context.t * Sc_rollup_commitment_repr.Hash.t option)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
find_staker context rollup staker
returns the most recent commitment staker
staked on, or None
if its last staked commitment is older or equal than the last cemented commitment.
val is_staked_on :
Raw_context.t ->
Sc_rollup_repr.t ->
Sc_rollup_repr.Staker.t ->
Sc_rollup_commitment_repr.Hash.t ->
(Raw_context.t * bool) Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
is_staked_on context rollup staker commitment_hash
returns true iff staker
is an active staker and has staked on commitment_hash
.
val commitments_uncarbonated :
Raw_context.t ->
rollup:Sc_rollup_repr.t ->
inbox_level:Raw_level_repr.t ->
Sc_rollup_commitment_repr.Hash.t list option
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
commitments_uncarbonated ctxt ~rollup ~inbox_level
returns the list of commitments associated to rollup
at inbox_level
val stakers_ids_uncarbonated :
Raw_context.t ->
rollup:Sc_rollup_repr.t ->
commitment:Sc_rollup_commitment_repr.Hash.t ->
Sc_rollup_staker_index_repr.t list
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
stakers_ids_uncarbonated ctxt ~rollup ~commitment
returns the list of stakers' indexes associated to rollup
for a specific commitment
val staker_id_uncarbonated :
Raw_context.t ->
rollup:Sc_rollup_repr.t ->
pkh:Tezos_protocol_environment_alpha.Signature.public_key_hash ->
Sc_rollup_staker_index_repr.t
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
staker_id_uncarbonated ctxt ~rollup ~pkh
returns the staker's index associated to the public key hash pkh
val stakers_pkhs_uncarbonated :
Raw_context.t ->
rollup:Sc_rollup_repr.t ->
Tezos_protocol_environment_alpha.Signature.public_key_hash list
Tezos_protocol_environment_alpha.Lwt.t
stakers_pkhs_uncarbonated ctxt ~rollup
returns the public key hashes of stakers that are currently actively staking on rollup
val withdraw_stake :
Raw_context.t ->
Sc_rollup_repr.t ->
Sc_rollup_repr.Staker.t ->
(Raw_context.t * Receipt_repr.balance_updates)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
withdraw_stake context rollup staker
removes staker
and cleans its metadata. staker
is allowed to withdraw if it latest staked commitment is older than the last cemented commitment.
val commitments_of_inbox_level :
Raw_context.t ->
Sc_rollup_repr.t ->
Raw_level_repr.t ->
(Raw_context.t * Sc_rollup_commitment_repr.Hash.t list)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
commitments_of_inbox_level ctxt rollup inbox_level
returns the list of commitments for inbox_level
.
val stakers_of_commitment :
Raw_context.t ->
Sc_rollup_repr.t ->
Sc_rollup_commitment_repr.Hash.t ->
(Raw_context.t * Sc_rollup_staker_index_repr.t list)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
stakers_of_commitment ctxt rollup commitment_hash
returns the list of stakers staking on commitment_hash
.
val find_commitment_of_staker_in_commitments :
Raw_context.t ->
Sc_rollup_repr.t ->
Sc_rollup_staker_index_repr.t ->
Sc_rollup_commitment_repr.Hash.t list ->
(Raw_context.t * Sc_rollup_commitment_repr.Hash.t option)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
find_commitment_of_staker_in_commitments ctxt rollup staker_index commitments
selects in commitments
the hash of the commitment staked by staker_index
, if any.