pub trait ValidatorUptimeTracker: StateWrite {
// Provided methods
fn track_uptime<'life0, 'life1, 'async_trait>(
&'life0 mut self,
last_commit_info: &'life1 CommitInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn spawn_validator_lookup_fut(
&self,
identity_key: IdentityKey,
lookups: &mut JoinSet<Result<Option<(IdentityKey, PublicKey, Uptime)>>>,
) -> AbortHandle { ... }
fn process_validator_uptime<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
__arg1: (IdentityKey, PublicKey, Uptime),
did_address_vote: &'life1 BTreeMap<[u8; 20], bool>,
params: &'life2 StakeParameters,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}
Available on crate feature
component
only.Expand description
Tracks validator uptimes.
Use track_uptime()
to process a block’s CommitInfo
and update validator uptime
bookkeeping.
Provided Methods§
fn track_uptime<'life0, 'life1, 'async_trait>(
&'life0 mut self,
last_commit_info: &'life1 CommitInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn spawn_validator_lookup_fut(
&self,
identity_key: IdentityKey,
lookups: &mut JoinSet<Result<Option<(IdentityKey, PublicKey, Uptime)>>>,
) -> AbortHandle
fn spawn_validator_lookup_fut( &self, identity_key: IdentityKey, lookups: &mut JoinSet<Result<Option<(IdentityKey, PublicKey, Uptime)>>>, ) -> AbortHandle
Spawns a future that will retrieve validator information.
NB: This function is synchronous, but the lookup will run asynchronously as part of the
provided [JoinSet
]. This permits us to fetch information about all of the validators
in the consensus set in parallel.
§Panics
This will panic if there is no recorded state for a validator with the given
IdentityKey
.
fn process_validator_uptime<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
__arg1: (IdentityKey, PublicKey, Uptime),
did_address_vote: &'life1 BTreeMap<[u8; 20], bool>,
params: &'life2 StakeParameters,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.