pub struct ConsensusInfo {Show 34 fields
pub best_block: Option<BlockHash>,
pub genesis_block: Option<BlockHash>,
pub genesis_time: Option<Timestamp>,
pub slot_duration: Option<Duration>,
pub epoch_duration: Option<Duration>,
pub last_finalized_block: Option<BlockHash>,
pub best_block_height: Option<AbsoluteBlockHeight>,
pub last_finalized_block_height: Option<AbsoluteBlockHeight>,
pub blocks_received_count: u32,
pub block_last_received_time: Option<Timestamp>,
pub block_receive_latency_ema: f64,
pub block_receive_latency_emsd: f64,
pub block_receive_period_ema: Option<f64>,
pub block_receive_period_emsd: Option<f64>,
pub blocks_verified_count: u32,
pub block_last_arrived_time: Option<Timestamp>,
pub block_arrive_latency_ema: f64,
pub block_arrive_latency_emsd: f64,
pub block_arrive_period_ema: Option<f64>,
pub block_arrive_period_emsd: Option<f64>,
pub transactions_per_block_ema: f64,
pub transactions_per_block_emsd: f64,
pub finalization_count: u32,
pub last_finalized_time: Option<Timestamp>,
pub finalization_period_ema: Option<f64>,
pub finalization_period_emsd: Option<f64>,
pub protocol_version: i32,
pub genesis_index: Option<GenesisIndex>,
pub current_era_genesis_block: Option<BlockHash>,
pub current_era_genesis_time: Option<Timestamp>,
pub current_timeout_duration: Option<Duration>,
pub current_round: Option<Round>,
pub current_epoch: Option<Epoch>,
pub trigger_block_time: Option<Timestamp>,
}Expand description
The response for GetConsensusInfo.
Fields§
§best_block: Option<BlockHash>Hash of the current best block.
genesis_block: Option<BlockHash>Hash of the (original) genesis block.
genesis_time: Option<Timestamp>Time of the (original) genesis block.
slot_duration: Option<Duration>(Current) slot duration in milliseconds. Present only in protocol versions 1-5.
epoch_duration: Option<Duration>(Current) epoch duration in milliseconds.
last_finalized_block: Option<BlockHash>Hash of the last finalized block.
best_block_height: Option<AbsoluteBlockHeight>Absolute height of the best block.
last_finalized_block_height: Option<AbsoluteBlockHeight>Absolute height of the last finalized block.
blocks_received_count: u32Total number of blocks received.
block_last_received_time: Option<Timestamp>The last time a block was received.
block_receive_latency_ema: f64Exponential moving average latency between a block’s slot time and received time.
block_receive_latency_emsd: f64Standard deviation of exponential moving average latency between a block’s slot time and received time.
block_receive_period_ema: Option<f64>Exponential moving average time between receiving blocks.
block_receive_period_emsd: Option<f64>Standard deviation of exponential moving average time between receiving blocks.
blocks_verified_count: u32Total number of blocks received and verified.
block_last_arrived_time: Option<Timestamp>The last time a block was verified (added to the tree).
block_arrive_latency_ema: f64Exponential moving average latency between a block’s slot time and its arrival.
block_arrive_latency_emsd: f64Standard deviation of exponential moving average latency between a block’s slot time and its arrival.
block_arrive_period_ema: Option<f64>Exponential moving average time between block arrivals.
block_arrive_period_emsd: Option<f64>Standard deviation of exponential moving average time between block arrivals.
transactions_per_block_ema: f64Exponential moving average number of transactions per block.
transactions_per_block_emsd: f64Standard deviation of exponential moving average number of transactions per block.
finalization_count: u32Number of finalizations.
last_finalized_time: Option<Timestamp>Time of last verified finalization.
finalization_period_ema: Option<f64>Exponential moving average time between finalizations.
finalization_period_emsd: Option<f64>Standard deviation of exponential moving average time between finalizations.
protocol_version: i32Currently active protocol version.
genesis_index: Option<GenesisIndex>The number of chain restarts via a protocol update. A completed protocol update instruction might not change the protocol version specified in the previous field, but it always increments the genesis index.
current_era_genesis_block: Option<BlockHash>Block hash of the genesis block of current era, i.e., since the last protocol update. Initially this is equal to ‘genesis_block’.
current_era_genesis_time: Option<Timestamp>Time when the current era started.
current_timeout_duration: Option<Duration>The current duration to wait before a round times out. Present from protocol version 6.
current_round: Option<Round>The current round. Present from protocol version 6.
current_epoch: Option<Epoch>The current epoch. Present from protocol version 6.
trigger_block_time: Option<Timestamp>The first block in the epoch with timestamp at least this is considered to be the trigger block for the epoch transition. Present from protocol version 6.
Implementations§
Source§impl ConsensusInfo
impl ConsensusInfo
Sourcepub fn block_receive_period_ema(&self) -> f64
pub fn block_receive_period_ema(&self) -> f64
Returns the value of block_receive_period_ema, or the default value if block_receive_period_ema is unset.
Sourcepub fn block_receive_period_emsd(&self) -> f64
pub fn block_receive_period_emsd(&self) -> f64
Returns the value of block_receive_period_emsd, or the default value if block_receive_period_emsd is unset.
Sourcepub fn block_arrive_period_ema(&self) -> f64
pub fn block_arrive_period_ema(&self) -> f64
Returns the value of block_arrive_period_ema, or the default value if block_arrive_period_ema is unset.
Sourcepub fn block_arrive_period_emsd(&self) -> f64
pub fn block_arrive_period_emsd(&self) -> f64
Returns the value of block_arrive_period_emsd, or the default value if block_arrive_period_emsd is unset.
Sourcepub fn finalization_period_ema(&self) -> f64
pub fn finalization_period_ema(&self) -> f64
Returns the value of finalization_period_ema, or the default value if finalization_period_ema is unset.
Sourcepub fn finalization_period_emsd(&self) -> f64
pub fn finalization_period_emsd(&self) -> f64
Returns the value of finalization_period_emsd, or the default value if finalization_period_emsd is unset.
Sourcepub fn protocol_version(&self) -> ProtocolVersion
pub fn protocol_version(&self) -> ProtocolVersion
Returns the enum value of protocol_version, or the default if the field is set to an invalid enum value.
Sourcepub fn set_protocol_version(&mut self, value: ProtocolVersion)
pub fn set_protocol_version(&mut self, value: ProtocolVersion)
Sets protocol_version to the provided enum value.
Trait Implementations§
Source§impl Clone for ConsensusInfo
impl Clone for ConsensusInfo
Source§fn clone(&self) -> ConsensusInfo
fn clone(&self) -> ConsensusInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConsensusInfo
impl Debug for ConsensusInfo
Source§impl Default for ConsensusInfo
impl Default for ConsensusInfo
Source§impl Message for ConsensusInfo
impl Message for ConsensusInfo
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for ConsensusInfo
impl PartialEq for ConsensusInfo
Source§impl TryFrom<ConsensusInfo> for ConsensusInfo
impl TryFrom<ConsensusInfo> for ConsensusInfo
impl StructuralPartialEq for ConsensusInfo
Auto Trait Implementations§
impl Freeze for ConsensusInfo
impl RefUnwindSafe for ConsensusInfo
impl Send for ConsensusInfo
impl Sync for ConsensusInfo
impl Unpin for ConsensusInfo
impl UnwindSafe for ConsensusInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.