pub struct ValidatorSigningInfo {
pub validator_pubkey: [u8; 32],
pub start_height: BlockHeight,
pub index_offset: u64,
pub missed_blocks_counter: u64,
pub tombstoned: bool,
pub jailed_until: BlockHeight,
}Expand description
Validator signing info for tracking liveness
Fields§
§validator_pubkey: [u8; 32]Validator’s public key
start_height: BlockHeightBlock height when signing info was last updated
index_offset: u64Index offset into signed blocks bit array
missed_blocks_counter: u64Number of blocks missed in the current window
tombstoned: boolWhether the validator has been tombstoned (permanently jailed)
jailed_until: BlockHeightBlock height of the last time validator was jailed
Implementations§
Source§impl ValidatorSigningInfo
impl ValidatorSigningInfo
Sourcepub fn new(validator_pubkey: [u8; 32], start_height: BlockHeight) -> Self
pub fn new(validator_pubkey: [u8; 32], start_height: BlockHeight) -> Self
Create new signing info for a validator
Sourcepub fn increment_missed(&mut self)
pub fn increment_missed(&mut self)
Increment missed blocks counter
Sourcepub fn reset_missed(&mut self)
pub fn reset_missed(&mut self)
Reset missed blocks counter (e.g., when validator is slashed)
Sourcepub fn exceeds_threshold(&self, threshold: u64) -> bool
pub fn exceeds_threshold(&self, threshold: u64) -> bool
Check if validator has exceeded downtime threshold
Trait Implementations§
Source§impl Clone for ValidatorSigningInfo
impl Clone for ValidatorSigningInfo
Source§fn clone(&self) -> ValidatorSigningInfo
fn clone(&self) -> ValidatorSigningInfo
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 ValidatorSigningInfo
impl Debug for ValidatorSigningInfo
Source§impl<'de> Deserialize<'de> for ValidatorSigningInfo
impl<'de> Deserialize<'de> for ValidatorSigningInfo
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 ValidatorSigningInfo
impl PartialEq for ValidatorSigningInfo
Source§fn eq(&self, other: &ValidatorSigningInfo) -> bool
fn eq(&self, other: &ValidatorSigningInfo) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ValidatorSigningInfo
impl Serialize for ValidatorSigningInfo
impl Eq for ValidatorSigningInfo
impl StructuralPartialEq for ValidatorSigningInfo
Auto Trait Implementations§
impl Freeze for ValidatorSigningInfo
impl RefUnwindSafe for ValidatorSigningInfo
impl Send for ValidatorSigningInfo
impl Sync for ValidatorSigningInfo
impl Unpin for ValidatorSigningInfo
impl UnsafeUnpin for ValidatorSigningInfo
impl UnwindSafe for ValidatorSigningInfo
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