package tezos-protocol-014-PtKathma

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

remove_staker context rollup staker forcibly removes the given staker and confiscates their frozen deposits.

Any commitments no longer staked on are removed and storage reclaimed by remove_staker. Because of this there is no need to explicitly reject commitments.

May fail with:

  • Sc_rollup_does_not_exist if rollup does not exist
  • Sc_rollup_not_staked if staker is not staked
  • Sc_rollup_remove_lcc if staker is staked on a cemented commitment

This is a wrapper around deposit_stake and refine_stake that deposits a stake and then refines it to the specified commitment, creating that commitment if necessary. Before calling deposit_stake it checks that the staker is not already staked, and if so will skip that step and go straight to calling refine_stake.

May fail with:

  • Sc_rollup_does_not_exist if rollup does not exist
  • Sc_rollup_too_far_ahead if staker would be more than sc_rollup_max_future_commitments ahead of the Last Cemented Commitment
  • Sc_rollup_bad_inbox_level if commitment's predecessor is less than sc_rollup_commitment_period blocks ahead
  • Sc_rollup_staker_backtracked if staker is not staked on an ancestor of commitment
  • Sc_rollup_unknown_commitment if the parent of the given commitment does not exist
  • Sc_rollup_staker_funds_too_low if staker is not previously a staker, and does not have enough funds to cover the deposit

Returns the hash of the given commitment, and the level when the commitment was first published by some staker.

This function does not authenticate the staker.

cement_commitment context rollup commitment cements the given commitment.

Subsequent calls to refine_stake and cement_commitment must use a context with greater level, or behavior is undefined.

For cementing to succeed, the following must hold:

  1. The deadline for commitment must have passed.
  2. The predecessor of commitment must be the Last Cemented Commitment.
  3. There must be at least one staker.
  4. All stakers must be indirectly staked on commitment.

If successful, last_cemented_commitment is set to the given commitment and the appropriate amount of inbox messages is consumed. The old LCC is also deallocated.

May fail with:

  • Sc_rollup_does_not_exist if rollup does not exist
  • Sc_rollup_unknown_commitment if commitment does not exist
  • Sc_rollup_parent_not_lcc if commitment is not the child of the last cemented commitment
  • Sc_rollup_too_recent if commitment has not passed its deadline
  • Sc_rollup_no_stakers if there are zero stakers
  • Sc_rollup_disputed if at least one staker is not staked on commitment

find_staker ctxt rollup staker returns the branch on which the stake is deposited for the rollup's staker.

May fail with Sc_rollup_not_staked if staker is not staked.

val commitment_storage_size_in_bytes : int

The storage size requirement (in bytes) of a commitment

withdraw_stake context rollup staker removes staker and returns any deposit previously frozen by deposit_stake.

May fail with:

  • Sc_rollup_does_not_exist if rollup does not exist
  • Sc_rollup_not_staked_on_lcc if staker is not staked on the last cemented commitment

Note that it is not possible to be staked on a Cemented commitment other than the Last, because of Cementation Rule #4. See cement_commitment for details.

By design, the operation wrapping this might not be authenticated, as it may be necessary for nodes on the honest branch to refund stakers on the LCC. They must do so by using withdraw_stake as they are implicitly staked on the LCC and can not dispute it.

OCaml

Innovation. Community. Security.