BfcStaking
Description
The core DPoS consensus mechanism of the Bifrost Node is defined in pallet_bfc_staking. The pallet_bfc_staking is a custom pallet that defines the concepts of validators and nominators and also manages their self-bonds and nominations. In addition, it defines the concept of rounds as well as the logic within the rounds.
Extrinsics
set_staking_expectations(expectations: Range<BalanceOf>)
interface:
api.tx.bfcStaking.setStakingExpectationssummary: Sets the expectations for total staked. These expectations determine the issuance of the round. The origin should be the root.
set_inflation(schedule: Range<Perbill>)
interface:
api.tx.bfcStaking.setInflationsummary: Sets the annual inflation rate to derive per-round inflation. The origin should be the root.
set_max_full_selected(new: u32)
interface:
api.tx.bfcStaking.setMaxFullSelectedsummary: Sets the maximum number of full validator candidates selected per round. The origin should be the root.
set_basic_full_selected(new: u32)
interface:
api.tx.bfcStaking.setMaxBasicSelectedsummary: Sets the maximum number of basic validator candidates selected per round. The origin should be the root.
set_min_total_selected(new: u32)
interface:
api.tx.bfcStaking.setMinTotalSelectedsummary: Sets the minimum number of validator candidates selected per round. The origin should be the root.
set_default_validator_commission(new: Perbill, tier: TierType)
interface:
api.tx.bfcStaking.setDefaultValidatorCommissionsummary: Sets the default commission rate for all validators of the given tier. The origin should be the root.
set_max_validator_commission(new: Perbill, tier: TierType)
interface:
api.tx.bfcStaking.setMaxValidatorCommissionsummary: Sets the maximum commission rate for all validators of the given tier. The origin should be the root.
set_validator_commission(new: Perbill)
interface:
api.tx.bfcStaking.setValidatorCommissionsummary: Sets the commission rate of the given validator. The origin should be the controller account.
set_validator_tier(more: BalanceOf, new: TierType, relayer?: AccountId)
interface:
api.tx.bfcStaking.setValidatorTiersummary: Modifies validator candidate tier. The actual state reflection will apply at the next round. The origin should be the stash account.
set_blocks_per_round(new: u32)
interface:
api.tx.bfcStaking.setBlocksPerRoundsummary: Sets blocks per round. The
newround length will be updated immediately in the next block. This also updates the per-round inflation config. The origin should be the root.
set_storage_cache_lifetime(new: u32)
interface:
api.tx.bfcStaking.setStorageCacheLifetimesummary: Sets the
StorageCacheLifetimeround length. The origin should be the root.
join_candidates(controller: AccountId, relayer?: AccountId, bond: BalanceOf, candidate_count: u32)
interface:
api.tx.bfcStaking.joinCandidatessummary: Join the set of validator candidates. The origin should be the stash account.
schedule_leave_candidates(candidate_count: u32)
interface:
api.tx.bfcStaking.scheduleLeaveCandidatessummary: Requests to leave the set of candidates. If successful, the account is immediately removed from the candidate pool to prevent selection as a validator. The origin should be the controller account.
execute_leave_candidates(candidate_nomination_count: u32)
interface:
api.tx.bfcStaking.executeLeaveCandidatessummary: Executes leave candidates request. The origin should be the stash account.
cancel_leave_candidates(candidate_count: u32)
interface:
api.tx.bfcStaking.cancelLeaveCandidatessummary: Cancels open request to leave candidates. The origin should be the controller account.
set_controller(new: AccountId)
interface:
api.tx.bfcStaking.setControllersummary: (Re-)sets the bonded controller account. The origin must be the bonded stash account. The actual change will apply on the next round update. The origin should be the stash account.
set_candidate_reward_dst(new_reward_dst: RewardDestination)
interface:
api.tx.bfcStaking.setCandidateRewardDstsummary: Sets the validator candidate reward destination. The origin should be the controller account.
set_nominator_reward_dst(new_reward_dst: RewardDestination)
interface:
api.tx.bfcStaking.setNominatorRewardDstsummary: Sets the nominator reward destination.
go_offline()
interface:
api.tx.bfcStaking.goOfflinesummary: Temporarily leaves the set of validator candidates without unbonding. The origin should be the controller account.
go_online()
interface:
api.tx.bfcStaking.goOnlinesummary: Rejoins the set of validator candidates if previously been kicked out or went offline. The origin should be the controller account.
candidate_bond_more(more: BalanceOf)
interface:
api.tx.bfcStaking.candidateBondMoresummary: Increases validator candidate self-bond by
more. The origin should be the stash account.
schedule_candidate_bond_less(less: BalanceOf)
interface:
api.tx.bfcStaking.scheduleCandidateBondLesssummary: Requests by validator candidate to decrease self-bond by
less. The origin should be the controller account.
execute_candidate_bond_less()
interface:
api.tx.bfcStaking.executeCandidateBondLesssummary: Executes pending request to adjust the validator candidate self-bond. The origin should be the stash account.
cancel_candidate_bond_less()
interface:
api.tx.bfcStaking.cancelCandidateBondLesssummary: Cancels pending request to adjust the validator candidate self bond. The origin should be the controller account.
nominate(candidate: AccountId, amount: BalanceOf, candidate_nomination_count: u32, nomination_count: u32)
interface:
api.tx.bfcStaking.nominatesummary: Nominates the given
candidate.
schedule_leave_nominators()
interface:
api.tx.bfcStaking.scheduleLeaveNominatorssummary: Requests to leave the set of nominators.
execute_leave_nominators(nomination_count: u32)
interface:
api.tx.bfcStaking.executeLeaveNominatorssummary: Executes the right to exit the set of nominators and revoke all ongoing nominations.
cancel_leave_nominators()
interface:
api.tx.bfcStaking.cancelLeaveNominatorssummary: Cancels a pending request to exit the set of nominators.
schedule_revoke_nomination(validator: AccountId)
interface:
api.tx.bfcStaking.scheduleRevokeNominationsummary: Requests to revoke an existing nomination.
nominator_bond_more(candidate: AccountId, more: BalanceOf)
interface:
api.tx.bfcStaking.nominatorBondMoresummary: Bonds more for a specific validator candidate.
schedule_nominator_bond_less(candidate: AccountId, less: BalanceOf)
interface:
api.tx.bfcStaking.scheduleNominatorBondLesssummary: Requests bond less for a specific validator candidate.
execute_nomination_request(candidate: AccountId)
interface:
api.tx.bfcStaking.executeNominationRequestsummary: Executes pending request to change an existing nomination.
cancel_nomination_request(candidate: AccountId)
interface:
api.tx.bfcStaking.cancelNominationRequestsummary: Cancels request to change an existing nomination.
Storage Values
Session(): SessionIndex
interface:
api.query.bfcStaking.sessionsummary: Current session index of current round.
Round(): RoundInfo<T::BlockNumber>
interface:
api.query.bfcStaking.roundsummary: Current round index and specific information.
StorageCacheLifetime(): u32
interface:
api.query.bfcStaking.storageCacheLifetimesummary: The maximum storage lifetime for storage data to be cached.
DefaultFullValidatorCommission(): Perbill
interface:
api.query.bfcStaking.defaultFullValidatorCommissionsummary: Default commission rate for full validators.
DefaultBasicValidatorCommission(): Perbill
interface:
api.query.bfcStaking.defaultBasicValidatorCommissionsummary: Default commission rate for basic validators.
MaxFullValidatorCommission(): Perbill
interface:
api.query.bfcStaking.maxFullValidatorCommissionsummary: Maximum commission rate for full validators.
MaxBasicValidatorCommission(): Perbill
interface:
api.query.bfcStaking.maxBasicValidatorCommissionsummary: Maximum commission rate for basic validators.
MaxTotalSelected(): u32
interface:
api.query.bfcStaking.maxTotalSelectedsummary: Maximum node candidates selected every round.
MaxFullSelected(): u32
interface:
api.query.bfcStaking.maxFullSelectedsummary: Maximum full node candidates selected every round.
MaxBasicSelected(): u32
interface:
api.query.bfcStaking.maxBasicSelectedsummary: Maximum basic node candidates selected every round.
MinTotalSelected(): u32
interface:
api.query.bfcStaking.minTotalSelectedsummary: Minimum candidates selected every round.
ProductivityPerBlock(): Perbill
interface:
api.query.bfcStaking.productivityPerBlocksummary: Productivity rate per block in the current round.
NominatorState(AccountId): Option<Nominator<AccountId, BalanceOf>>
interface:
api.query.bfcStaking.nominatorStatesummary: Gets nominator state associated with an account if the account is nominating else None.
CandidateInfo(AccountId): Option<CandidateMetadata<AccountId, BalanceOf, BlockNumberOf>>
interface:
api.query.bfcStaking.candidateInfosummary: Gets validator candidate info associated with an account if the account is candidate else None.
BondedStash(AccountId): Option<AccountId>
interface:
api.query.bfcStaking.bondedStashsummary: Map from all locked "stash" accounts to the controller account.
TopNominations(AccountId): Option<Nominations<AccountId, BalanceOf>>
interface:
api.query.bfcStaking.topNominationssummary: Top nominations for validator candidate.
BottomNominations(AccountId): Option<Nominations<AccountId, BalanceOf>>
interface:
api.query.bfcStaking.bottomNominationssummary: Bottom nominations for validator candidate.
SelectedCandidates(): Vec<AccountId>
interface:
api.query.bfcStaking.selectedCandidatessummary: Active validator set (full and basic) selected for the current round.
SelectedFullCandidates(): Vec<AccountId>
interface:
api.query.bfcStaking.selectedFullCandidatessummary: Active full validator set selected for the current round.
SelectedBasicCandidates(): Vec<AccountId>
interface:
api.query.bfcStaking.selectedBasicCandidatessummary: Active basic validator set selected for the current round.
CachedSelectedCandidates(): Vec<(RoundIndex, Vec<AccountId>)>
interface:
api.query.bfcStaking.cachedSelectedCandidatessummary: Cached active validator set selected from previous rounds.
Majority(): u32
interface:
api.query.bfcStaking.majoritysummary: Majority of the current active validator set.
CachedMajority(): Vec<(RoundIndex, u32)>
interface:
api.query.bfcStaking.cachedMajoritysummary: Cached majority based on the active validator set selected from previous rounds.
Total(): BalanceOf
interface:
api.query.bfcStaking.totalsummary: Total capital locked by this staking pallet.
CandidatePool(): Vec<Bond<AccountId, BalanceOf>>
interface:
api.query.bfcStaking.candidatePoolsummary: The pool of validator candidates, each with their total voting power.
AtStake(RoundIndex): ValidatorSnapshot<AccountId, BalanceOf>
interface:
api.query.bfcStaking.atStakesummary: Snapshot of validator nomination stake at the start of the round.
TotalAtStake(RoundIndex): Option<TotalSnapshot<BalanceOf>>
interface:
api.query.bfcStaking.totalAtStakesummary: Snapshot of the network state at the start of the round.
DelayedPayouts(RoundIndex): Option<DelayedPayout<BalanceOf>>
interface:
api.query.bfcStaking.delayedPayoutssummary: Delayed reward payouts.
DelayedControllerSets(RoundIndex): Vec<DelayedControllerSet<AccountId>>
interface:
api.query.bfcStaking.delayedControllerSetssummary: Delayed new controller account set requests.
Staked(RoundIndex): BalanceOf
interface:
api.query.bfcStaking.stakedsummary: Total counted stake for selected candidates in the round.
InflationConfig(): InflationInfo<BalanceOf>
interface:
api.query.bfcStaking.inflationConfigsummary: Inflation configuration.
Points(RoundIndex): RewardPoint
interface:
api.query.bfcStaking.pointssummary: Total points awarded to validators for block production in the round.
AwardedPts(AccountId): RewardPoint
interface:
api.query.bfcStaking.awardedPtssummary: Points for each validator per round.
AwardedTokens(): BalanceOf
interface:
api.query.bfcStaking.awardedTokenssummary: Tokens awarded to validators and nominators since genesis.
Constants
DefaultBlocksPerSession: u32
interface:
api.consts.bfcStaking.defaultBlocksPerSessionsummary: Default number of blocks per session at genesis.
DefaultBlocksPerRound: u32
interface:
api.consts.bfcStaking.defaultBlocksPerRoundsummary: Default number of blocks per round at genesis.
MinBlocksPerRound: u32
interface:
api.consts.bfcStaking.minBlocksPerRoundsummary: Default minimum number of blocks per round at genesis.
StorageCacheLifetimeInRounds: u32
interface:
api.consts.bfcStaking.storageCacheLifetimeInRoundssummary: Maximum lifetime in rounds for certain storage data to be cached.
LeaveCandidatesDelay: RoundIndex
interface:
api.consts.bfcStaking.leaveCandidatesDelaysummary: Number of rounds that candidates remain bonded before exit request is executable.
CandidateBondLessDelay: RoundIndex
interface:
api.consts.bfcStaking.candidateBondLessDelaysummary: Number of rounds candidate requests to decrease self-bond must wait to be executable.
LeaveNominatorsDelay: RoundIndex
interface:
api.consts.bfcStaking.leaveNominatorsDelaysummary: Number of rounds that nominators remain bonded before exit request is executable.
RevokeNominationDelay: RoundIndex
interface:
api.consts.bfcStaking.revokeNominationDelaysummary: Number of rounds that nominations remain bonded before revocation request is executable.
NominationBondLessDelay: RoundIndex
interface:
api.consts.bfcStaking.nominationBondLessDelaysummary: Number of rounds that nomination less requests must wait before executable.
RewardPaymentDelay: RoundIndex
interface:
api.consts.bfcStaking.rewardPaymentDelaysummary: Number of rounds after which block authors are rewarded.
DefaultMaxSelectedFullCandidates: u32
interface:
api.consts.bfcStaking.defaultMaxSelectedFullCandidatessummary: Default maximum number of selected full node candidates every round.
DefaultMaxSelectedBasicCandidates: u32
interface:
api.consts.bfcStaking.defaultMaxSelectedBasicCandidatessummary: Default maximum number of selected basic node candidates every round.
DefaultMinSelectedCandidates: u32
interface:
api.consts.bfcStaking.defaultMinSelectedCandidatessummary: Default minimum number of selected candidates (full and basic) every round.
MaxTopNominationsPerCandidate: u32
interface:
api.consts.bfcStaking.maxTopNominationsPerCandidatesummary: Maximum top nominations counted per candidate.
MaxBottomNominationsPerCandidate: u32
interface:
api.consts.bfcStaking.maxBottomNominationsPerCandidatesummary: Maximum bottom nominations counted per candidate.
MaxNominationsPerNominator: u32
interface:
api.consts.bfcStaking.maxNominationsPerNominatorsummary: Maximum nominations per nominator.
DefaultFullValidatorCommission: Perbill
interface:
api.consts.bfcStaking.defaultFullValidatorCommissionsummary: Default commission rate for a full validator.
DefaultBasicValidatorCommission: Perbill
interface:
api.consts.bfcStaking.defaultBasicValidatorCommissionsummary: Default commission rate for a basic validator.
MaxFullValidatorCommission: Perbill
interface:
api.consts.bfcStaking.maxFullValidatorCommissionsummary: Maximum commission rate available for a full validator.
MaxBasicValidatorCommission: Perbill
interface:
api.consts.bfcStaking.maxBasicValidatorCommissionsummary: Maximum commission rate available for a basic validator.
MinFullValidatorStk: BalanceOf
interface:
api.consts.bfcStaking.minFullValidatorStksummary: Minimum stake required for any full node candidate to be in
SelectedCandidatesfor the round.
MinBasicValidatorStk: BalanceOf
interface:
api.consts.bfcStaking.minBasicValidatorStksummary: Minimum stake required for any basic node candidate to be in
SelectedCandidatesfor the round.
MinFullCandidateStk: BalanceOf
interface:
api.consts.bfcStaking.minFullCandidateStksummary: Minimum stake required for any account to be a full validator candidate.
MinBasicCandidateStk: BalanceOf
interface:
api.consts.bfcStaking.minBasicCandidateStksummary: Minimum stake required for any account to be a basic validator candidate.
MinNominatorStk: BalanceOf
interface:
api.consts.bfcStaking.minNominatorStksummary: Minimum stake for any registered on-chain account to be a nominator.
Last updated