pub struct StakingParams {
pub min_validator_stake: Balance,
pub max_validators: u32,
pub unbonding_period: BlockHeight,
pub max_commission_bps: u16,
pub double_sign_slash_bps: u16,
pub downtime_slash_bps: u16,
pub double_sign_jail_duration: BlockHeight,
pub downtime_jail_duration: BlockHeight,
pub downtime_threshold: u64,
pub epoch_length: BlockHeight,
pub stake_weighted_selection: bool,
}Expand description
Staking parameters from genesis
Fields§
§min_validator_stake: BalanceMinimum stake required to be a validator
max_validators: u32Maximum number of active validators
unbonding_period: BlockHeightUnbonding period in blocks
max_commission_bps: u16Maximum commission rate in basis points
double_sign_slash_bps: u16Slash penalty for double signing (basis points)
downtime_slash_bps: u16Slash penalty for downtime (basis points)
double_sign_jail_duration: BlockHeightJail duration for double signing (blocks)
downtime_jail_duration: BlockHeightJail duration for downtime (blocks)
downtime_threshold: u64Number of missed blocks before downtime slash
epoch_length: BlockHeightEpoch length in blocks (validator set updates at epoch boundaries)
stake_weighted_selection: boolEnable stake-weighted proposer selection (vs round-robin)
Implementations§
Source§impl StakingParams
impl StakingParams
Sourcepub fn epoch_for_height(&self, height: BlockHeight) -> u64
pub fn epoch_for_height(&self, height: BlockHeight) -> u64
Get the epoch number for a given block height
Sourcepub fn is_epoch_boundary(&self, height: BlockHeight) -> bool
pub fn is_epoch_boundary(&self, height: BlockHeight) -> bool
Check if a block height is at an epoch boundary
Sourcepub fn epoch_start_height(&self, epoch: u64) -> BlockHeight
pub fn epoch_start_height(&self, epoch: u64) -> BlockHeight
Get the first block height of an epoch
Sourcepub fn epoch_end_height(&self, epoch: u64) -> BlockHeight
pub fn epoch_end_height(&self, epoch: u64) -> BlockHeight
Get the last block height of an epoch
Trait Implementations§
Source§impl Clone for StakingParams
impl Clone for StakingParams
Source§fn clone(&self) -> StakingParams
fn clone(&self) -> StakingParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StakingParams
impl Debug for StakingParams
Source§impl Default for StakingParams
impl Default for StakingParams
Source§impl<'de> Deserialize<'de> for StakingParams
impl<'de> Deserialize<'de> for StakingParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StakingParams
impl PartialEq for StakingParams
Source§fn eq(&self, other: &StakingParams) -> bool
fn eq(&self, other: &StakingParams) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for StakingParams
impl Serialize for StakingParams
impl Eq for StakingParams
impl StructuralPartialEq for StakingParams
Auto Trait Implementations§
impl Freeze for StakingParams
impl RefUnwindSafe for StakingParams
impl Send for StakingParams
impl Sync for StakingParams
impl Unpin for StakingParams
impl UnsafeUnpin for StakingParams
impl UnwindSafe for StakingParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more