[][src]Struct solana_runtime::bank::EpochSchedule

pub struct EpochSchedule {
    pub slots_per_epoch: u64,
    pub stakers_slot_offset: u64,
    pub first_normal_epoch: u64,
    pub first_normal_slot: u64,
}

Reasons a transaction might be rejected.

Fields

slots_per_epoch: u64

The maximum number of slots in each epoch.

stakers_slot_offset: u64

A number of slots before slot_index 0. Used to calculate finalized staked nodes.

first_normal_epoch: u64

basically: log2(slots_per_epoch)

first_normal_slot: u64

basically: 2.pow(first_normal_epoch)

Methods

impl EpochSchedule[src]

pub fn new(slots_per_epoch: u64, stakers_slot_offset: u64, warmup: bool) -> Self[src]

pub fn get_slots_in_epoch(&self, epoch: u64) -> u64[src]

get the length of the given epoch (in slots)

pub fn get_stakers_epoch(&self, slot: u64) -> u64[src]

get the epoch for which the given slot should save off information about stakers

pub fn get_epoch_and_slot_index(&self, slot: u64) -> (u64, u64)[src]

get epoch and offset into the epoch for the given slot

Trait Implementations

impl Copy for EpochSchedule[src]

impl PartialEq<EpochSchedule> for EpochSchedule[src]

impl Default for EpochSchedule[src]

impl Clone for EpochSchedule[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for EpochSchedule[src]

impl Debug for EpochSchedule[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> Same for T

type Output = T

Should always be Self

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T