package tezos-protocol-alpha
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Sc_rollup_stake_storage/index.html
Module Tezos_raw_protocol_alpha.Sc_rollup_stake_storageSource
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.tremove_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.tpublish_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.predecessorexists. - The
commitmentcontains 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 ->
(Raw_context.t
* Sc_rollup_commitment_repr.t
* Sc_rollup_commitment_repr.Hash.t)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.tcement context rollup tries to cement the next inbox level commitment, that is, the LCC's successor. Returns the cemented commitment hash and its hash.
For cementing to succeed, we need to have **one** commitment respecting the following properties:
- The deadline for
commitmentmust have passed. - The predecessor of
commitmentmust 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 found 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.tfind_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.tis_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.tcommitments_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.tstakers_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.tstaker_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.tstakers_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.twithdraw_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.tcommitments_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.tstakers_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.tfind_commitment_of_staker_in_commitments ctxt rollup staker_index commitments selects in commitments the hash of the commitment staked by staker_index, if any.