Module 0x3::validator_set
- Struct
ValidatorSetV1
- Struct
ValidatorSetV2
- Struct
ValidatorEpochInfoEventV1
- Struct
ValidatorJoinEvent
- Struct
ValidatorLeaveEvent
- Struct
CommitteeValidatorJoinEvent
- Struct
CommitteeValidatorLeaveEvent
- Constants
- Function
new_v1
- Function
v1_to_v2
- Function
request_add_validator_candidate
- Function
request_remove_validator_candidate
- Function
request_add_validator
- Function
assert_no_pending_or_active_duplicates
- Function
request_remove_validator
- Function
request_add_stake
- Function
request_withdraw_stake
- Function
request_set_commission_rate
- Function
advance_epoch
- Function
update_and_process_low_stake_departures
- Function
effectuate_staged_metadata
- Function
derive_reference_gas_price
- Function
total_stake
- Function
validator_total_stake_amount
- Function
validator_stake_amount
- Function
validator_voting_power
- Function
validator_staking_pool_id
- Function
staking_pool_mappings
- Function
total_stake_inner
- Function
validator_total_stake_amount_inner
- Function
validator_stake_amount_inner
- Function
validator_voting_power_inner
- Function
validator_staking_pool_id_inner
- Function
staking_pool_mappings_inner
- Function
validator_address_by_pool_id_inner
- Function
pool_exchange_rates
- Function
next_epoch_validator_count
- Function
is_active_validator_by_iota_address
- Function
is_committee_validator_by_iota_address
- Function
is_duplicate_with_active_validator
- Function
is_duplicate_validator
- Function
count_duplicates_vec
- Function
is_duplicate_with_pending_validator
- Function
count_duplicates_tablevec
- Function
get_candidate_or_active_validator_mut
- Function
find_validator
- Function
find_validator_from_table_vec
- Function
get_validator_indices_set
- Function
get_validator_mut
- Function
get_active_or_pending_or_candidate_validator_mut
- Function
get_validator_mut_with_verified_cap
- Function
get_validator_mut_with_ctx
- Function
get_validator_mut_with_ctx_including_candidates
- Function
get_validator_ref
- Function
get_active_or_pending_or_candidate_validator_ref
- Function
get_active_validator_ref
- Function
get_pending_validator_ref
- Function
get_active_validator_ref_inner
- Function
get_committee_validator_ref_inner
- Function
get_pending_validator_ref_inner
- Function
verify_cap
- Function
process_pending_removals
- Function
process_validator_departure
- Function
clean_report_records_leaving_validator
- Function
process_pending_validators
- Function
sort_removal_list
- Function
process_pending_stakes_and_withdraws
- Function
calculate_total_active_stakes
- Function
calculate_total_committee_stakes
- Function
adjust_next_epoch_commission_rate
- Function
compute_slashed_validators
- Function
compute_unadjusted_reward_distribution
- Function
compute_adjusted_reward_distribution
- Function
distribute_reward
- Function
emit_validator_epoch_events
- Function
sum_voting_power_by_addresses
- Function
sum_committee_voting_power_by_addresses
- Function
active_validators
- Function
is_validator_candidate
- Function
is_inactive_validator
- Function
active_validators_inner
- Function
is_validator_candidate_inner
- Function
is_inactive_validator_inner
- Function
active_validator_addresses
- Function
committee_validator_addresses
- Function
select_committee_members_top_n_stakers
- Function
process_new_committee
use 0x1::option;
use 0x1::vector;
use 0x2::bag;
use 0x2::balance;
use 0x2::event;
use 0x2::iota;
use 0x2::object;
use 0x2::priority_queue;
use 0x2::table;
use 0x2::table_vec;
use 0x2::transfer;
use 0x2::tx_context;
use 0x2::vec_map;
use 0x2::vec_set;
use 0x3::staking_pool;
use 0x3::validator;
use 0x3::validator_cap;
use 0x3::validator_wrapper;
use 0x3::voting_power;
Struct ValidatorSetV1
struct ValidatorSetV1 has store
Fields
total_stake: u64
Total amount of stake from all active validators at the beginning of the epoch.
active_validators: vector<validator::ValidatorV1>
The current list of active validators.
pending_active_validators: table_vec::TableVec<validator::ValidatorV1>
List of new validator candidates added during the current epoch. They will be processed at the end of the epoch.
pending_removals: vector<u64>
Removal requests from the validators. Each element is an index pointing to
active_validators
.staking_pool_mappings: table::Table<object::ID, address>
Mappings from staking pool's ID to the iota address of a validator.
inactive_validators: table::Table<object::ID, validator_wrapper::Validator>
Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool. When a validator is deactivated the validator is removed from
active_validators
it is added to this table so that stakers can continue to withdraw their stake from it.validator_candidates: table::Table<address, validator_wrapper::Validator>
Table storing preactive/candidate validators, mapping their addresses to their
ValidatorV1
structs. When an address callsrequest_add_validator_candidate
, they get added to this table and become a preactive validator. When the candidate has met the min stake requirement, they can callrequest_add_validator
to officially add them to the active validator setactive_validators
next epoch.at_risk_validators: vec_map::VecMap<address, u64>
Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
extra_fields: bag::Bag
Any extra fields that's not defined statically.
Struct ValidatorSetV2
The second version of the struct storing information about validator set.
This version is an extension on the first one, that supports a new approach to committee selection,
where committee members taking part in consensus are selected from a set of active_validators
before an epoch begins. committee_members
is a vector of indices of validators stored in active_validators
,
that have been selected to take part in consensus during the current epoch.
struct ValidatorSetV2 has store
Fields
total_stake: u64
Total amount of stake from all committee validators at the beginning of the epoch.
active_validators: vector<validator::ValidatorV1>
The current list of active validators.
committee_members: vector<u64>
Subset of validators responsible for consensus. Each element is an index pointing to
active_validators
.pending_active_validators: table_vec::TableVec<validator::ValidatorV1>
List of new validator candidates added during the current epoch. They will be processed at the end of the epoch.
pending_removals: vector<u64>
Removal requests from the validators. Each element is an index pointing to
active_validators
.staking_pool_mappings: table::Table<object::ID, address>
Mappings from staking pool's ID to the iota address of a validator.
inactive_validators: table::Table<object::ID, validator_wrapper::Validator>
Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool. When a validator is deactivated the validator is removed from
active_validators
it is added to this table so that stakers can continue to withdraw their stake from it.validator_candidates: table::Table<address, validator_wrapper::Validator>
Table storing preactive/candidate validators, mapping their addresses to their
ValidatorV1
structs. When an address callsrequest_add_validator_candidate
, they get added to this table and become a preactive validator. When the candidate has met the min stake requirement, they can callrequest_add_validator
to officially add them to the active validator setactive_validators
next epoch.at_risk_validators: vec_map::VecMap<address, u64>
Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
extra_fields: bag::Bag
Any extra fields that's not defined statically.
Struct ValidatorEpochInfoEventV1
Event containing staking and rewards related information of each validator, emitted during epoch advancement.
struct ValidatorEpochInfoEventV1 has copy, drop
Fields
epoch: u64
validator_address: address
reference_gas_survey_quote: u64
stake: u64
voting_power: u64
commission_rate: u64
pool_staking_reward: u64
pool_token_exchange_rate: staking_pool::PoolTokenExchangeRate
tallying_rule_reporters: vector<address>
tallying_rule_global_score: u64
Struct ValidatorJoinEvent
Event emitted every time a new validator becomes active. The epoch value corresponds to the first epoch this change takes place.
struct ValidatorJoinEvent has copy, drop
Fields
epoch: u64
validator_address: address
staking_pool_id: object::ID