package tezos-protocol-017-PtNairob
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-protocol-017-PtNairob.raw/Tezos_raw_protocol_017_PtNairob/Delegate_sampler/index.html
Module Tezos_raw_protocol_017_PtNairob.Delegate_sampler
Source
This module draws random values for a cycle based on the Seed_repr.seed
associated that cycle. These random values are:
- delegates associated with slots
- snapshot indexes. The selection of delegates is done by sampling from a particular distribution of the stake among the active delegates.
This module is responsible for maintaining the table Storage.Delegate_sampler_state
.
val slot_owner :
Raw_context.t ->
Level_repr.t ->
Slot_repr.t ->
(Raw_context.t * Delegate_consensus_key.pk)
Tezos_protocol_environment_017_PtNairob.Error_monad.tzresult
Tezos_protocol_environment_017_PtNairob.Lwt.t
Participation slots potentially associated to accounts. The accounts that didn't place a deposit will be excluded from this list. This function should only be used to compute the deposits to freeze or initialize the protocol while stitching. RPCs can use this function to predict an approximation of long term future slot allocations. It shouldn't be used in the baker.
val baking_rights_owner :
Raw_context.t ->
Level_repr.t ->
round:Round_repr.round ->
(Raw_context.t * Slot_repr.t * Delegate_consensus_key.pk)
Tezos_protocol_environment_017_PtNairob.Error_monad.tzresult
Tezos_protocol_environment_017_PtNairob.Lwt.t
val load_sampler_for_cycle :
Raw_context.t ->
Cycle_repr.t ->
Raw_context.t Tezos_protocol_environment_017_PtNairob.Error_monad.tzresult
Tezos_protocol_environment_017_PtNairob.Lwt.t
load_sampler_for_cycle ctxt cycle
caches the seeded stake sampler for cycle
in ctxt
. If the sampler was already cached, then ctxt
is returned unchanged.
This function has the same effect on ctxt
as slot_owner
and baking_rights_owner
.
val compute_snapshot_index :
Raw_context.t ->
Cycle_repr.t ->
max_snapshot_index:int ->
int Tezos_protocol_environment_017_PtNairob.Error_monad.tzresult
Tezos_protocol_environment_017_PtNairob.Lwt.t
compute_snapshot_index ctxt cycle max_snapshot_index
Returns the index of the selected snapshot for the cycle
passed as argument, and for the max index of snapshots taken so far, max_snapshot_index
(see Stake_storage.max_snapshot_index
.
val select_new_distribution_at_cycle_end :
Raw_context.t ->
new_cycle:Cycle_repr.t ->
Raw_context.t Tezos_protocol_environment_017_PtNairob.Error_monad.tzresult
Tezos_protocol_environment_017_PtNairob.Lwt.t
val clear_outdated_sampling_data :
Raw_context.t ->
new_cycle:Cycle_repr.t ->
Raw_context.t Tezos_protocol_environment_017_PtNairob.Error_monad.tzresult
Tezos_protocol_environment_017_PtNairob.Lwt.t
val select_distribution_for_cycle :
Raw_context.t ->
Cycle_repr.t ->
Raw_context.t Tezos_protocol_environment_017_PtNairob.Error_monad.tzresult
Tezos_protocol_environment_017_PtNairob.Lwt.t