Struct mina_rs_base::consensus_state::ConsensusState
source · [−]pub struct ConsensusState {Show 15 fields
pub blockchain_length: Length,
pub epoch_count: Length,
pub min_window_density: Length,
pub sub_window_densities: Vec<Length>,
pub last_vrf_output: VrfOutputTruncated,
pub total_currency: Amount,
pub curr_global_slot: GlobalSlot,
pub global_slot_since_genesis: GlobalSlotNumber,
pub staking_epoch_data: EpochData,
pub next_epoch_data: EpochData,
pub has_ancestor_in_same_checkpoint_window: bool,
pub block_stake_winner: CompressedPubKey,
pub block_creator: CompressedPubKey,
pub coinbase_receiver: CompressedPubKey,
pub supercharge_coinbase: bool,
}
Expand description
This structure encapsulates the succinct state of the consensus protocol.
The stake distribution information is contained by the staking_epoch_data field.
Due to its succinct nature, Samasika cannot look back into the past to obtain ledger snapshots for the stake distribution. Instead, Samasika implements a novel approach where the future stake distribution snapshot is prepared by the current consensus epoch.
Samasika prepares the past for the future! This future state is stored in the next_epoch_data field.
Fields
blockchain_length: Length
Height of block
epoch_count: Length
Epoch number
min_window_density: Length
Minimum window density oberved on the chain
sub_window_densities: Vec<Length>
Current sliding window of densities
last_vrf_output: VrfOutputTruncated
Additional VRS output from leader (for seeding Random Oracle)
total_currency: Amount
Total supply of currency
curr_global_slot: GlobalSlot
Current global slot number relative to the current hard fork
global_slot_since_genesis: GlobalSlotNumber
Absolute global slot number since genesis
staking_epoch_data: EpochData
Epoch data for previous epoch
next_epoch_data: EpochData
Epoch data for current epoch
has_ancestor_in_same_checkpoint_window: bool
If the block has an ancestor in the same checkpoint window
block_stake_winner: CompressedPubKey
Compressed public key of winning account
block_creator: CompressedPubKey
Compressed public key of the block producer
coinbase_receiver: CompressedPubKey
Compresed public key of account receiving the block reward
supercharge_coinbase: bool
true if block_stake_winner has no locked tokens, false otherwise
Implementations
sourceimpl ConsensusState
impl ConsensusState
sourcepub fn sub_window_densities(&self) -> Vec<u32>
pub fn sub_window_densities(&self) -> Vec<u32>
Returns the sub-window densities as a vec of u32
Trait Implementations
sourceimpl Clone for ConsensusState
impl Clone for ConsensusState
sourcefn clone(&self) -> ConsensusState
fn clone(&self) -> ConsensusState
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ConsensusState
impl Debug for ConsensusState
sourceimpl Default for ConsensusState
impl Default for ConsensusState
sourcefn default() -> Self
fn default() -> Self
Return ConsensusState { blockchain_length: Default::default(), epoch_count: Default::default(), min_window_density: Default::default(), sub_window_densities: Default::default(), last_vrf_output: Default::default(), total_currency: Default::default(), curr_global_slot: Default::default(), global_slot_since_genesis: Default::default(), staking_epoch_data: Default::default(), next_epoch_data: Default::default(), has_ancestor_in_same_checkpoint_window: Default::default(), block_stake_winner: CompressedPubKey :: from_address("B62qiy32p8kAKnny8ZFwoMhYpBppM1DWVCqAPBYNcXnsAHhnfAAuXgg").unwrap(), block_creator: CompressedPubKey :: from_address("B62qiy32p8kAKnny8ZFwoMhYpBppM1DWVCqAPBYNcXnsAHhnfAAuXgg").unwrap(), coinbase_receiver: CompressedPubKey :: from_address("B62qiy32p8kAKnny8ZFwoMhYpBppM1DWVCqAPBYNcXnsAHhnfAAuXgg").unwrap(), supercharge_coinbase: Default::default() }
sourceimpl From<ConsensusState> for ConsensusState
impl From<ConsensusState> for ConsensusState
sourcefn from(item: ConsensusState) -> Self
fn from(item: ConsensusState) -> Self
sourceimpl From<ConsensusState> for ConsensusState
impl From<ConsensusState> for ConsensusState
sourceimpl From<ConsensusState> for ConsensusStateJson
impl From<ConsensusState> for ConsensusStateJson
sourcefn from(t: ConsensusState) -> Self
fn from(t: ConsensusState) -> Self
sourceimpl<const V: u16> From<ConsensusState> for Versioned<ConsensusState, V>
impl<const V: u16> From<ConsensusState> for Versioned<ConsensusState, V>
sourcefn from(t: ConsensusState) -> Self
fn from(t: ConsensusState) -> Self
sourceimpl<const V1: u16, const V2: u16> From<ConsensusState> for Versioned<Versioned<ConsensusState, V1>, V2>
impl<const V1: u16, const V2: u16> From<ConsensusState> for Versioned<Versioned<ConsensusState, V1>, V2>
sourcefn from(t: ConsensusState) -> Self
fn from(t: ConsensusState) -> Self
sourceimpl<const V1: u16, const V2: u16, const V3: u16> From<ConsensusState> for Versioned<Versioned<Versioned<ConsensusState, V1>, V2>, V3>
impl<const V1: u16, const V2: u16, const V3: u16> From<ConsensusState> for Versioned<Versioned<Versioned<ConsensusState, V1>, V2>, V3>
sourcefn from(t: ConsensusState) -> Self
fn from(t: ConsensusState) -> Self
sourceimpl<const V1: u16, const V2: u16, const V3: u16, const V4: u16> From<ConsensusState> for Versioned<Versioned<Versioned<Versioned<ConsensusState, V1>, V2>, V3>, V4>
impl<const V1: u16, const V2: u16, const V3: u16, const V4: u16> From<ConsensusState> for Versioned<Versioned<Versioned<Versioned<ConsensusState, V1>, V2>, V3>, V4>
sourcefn from(t: ConsensusState) -> Self
fn from(t: ConsensusState) -> Self
sourceimpl From<ConsensusStateJson> for ConsensusState
impl From<ConsensusStateJson> for ConsensusState
sourceimpl<const V: u16> From<Versioned<ConsensusState, V>> for ConsensusState
impl<const V: u16> From<Versioned<ConsensusState, V>> for ConsensusState
sourceimpl<const V1: u16, const V2: u16> From<Versioned<Versioned<ConsensusState, V1>, V2>> for ConsensusState
impl<const V1: u16, const V2: u16> From<Versioned<Versioned<ConsensusState, V1>, V2>> for ConsensusState
sourceimpl<const V1: u16, const V2: u16, const V3: u16> From<Versioned<Versioned<Versioned<ConsensusState, V1>, V2>, V3>> for ConsensusState
impl<const V1: u16, const V2: u16, const V3: u16> From<Versioned<Versioned<Versioned<ConsensusState, V1>, V2>, V3>> for ConsensusState
sourceimpl<const V1: u16, const V2: u16, const V3: u16, const V4: u16> From<Versioned<Versioned<Versioned<Versioned<ConsensusState, V1>, V2>, V3>, V4>> for ConsensusState
impl<const V1: u16, const V2: u16, const V3: u16, const V4: u16> From<Versioned<Versioned<Versioned<Versioned<ConsensusState, V1>, V2>, V3>, V4>> for ConsensusState
sourceimpl FromGraphQLJson for ConsensusState
impl FromGraphQLJson for ConsensusState
sourcefn from_graphql_json(json: &Value) -> Result<Self>
fn from_graphql_json(json: &Value) -> Result<Self>
sourceimpl Hashable for ConsensusState
impl Hashable for ConsensusState
sourcefn to_roinput(&self) -> ROInput
fn to_roinput(&self) -> ROInput
sourcefn domain_string(_: Self::D) -> Option<String>
fn domain_string(_: Self::D) -> Option<String>
<= 20
. Read moresourceimpl PartialEq<ConsensusState> for ConsensusState
impl PartialEq<ConsensusState> for ConsensusState
sourcefn eq(&self, other: &ConsensusState) -> bool
fn eq(&self, other: &ConsensusState) -> bool
sourceimpl ToChunkedROInput for ConsensusState
impl ToChunkedROInput for ConsensusState
fn to_chunked_roinput(&self) -> ChunkedROInput
fn roinput(&self) -> ROInput
impl Eq for ConsensusState
impl StructuralEq for ConsensusState
impl StructuralPartialEq for ConsensusState
Auto Trait Implementations
impl RefUnwindSafe for ConsensusState
impl Send for ConsensusState
impl Sync for ConsensusState
impl Unpin for ConsensusState
impl UnwindSafe for ConsensusState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
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 morefn 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 morefn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
self
, then passes self.as_ref()
into the pipe function.fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
self
, then passes self.deref()
into the pipe function.impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Tap for T
impl<T> Tap for T
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Borrow<B>
of a value. Read morefn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
BorrowMut<B>
of a value. Read morefn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
AsRef<R>
view of a value. Read morefn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
AsMut<R>
view of a value. Read morefn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
Deref::Target
of a value. Read morefn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Deref::Target
of a value. Read morefn 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.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. Read morefn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
.tap_borrow()
only in debug builds, and is erased in release
builds. Read morefn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
.tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read morefn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
.tap_ref()
only in debug builds, and is erased in release
builds. Read morefn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
.tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more