struct SplitAncientStorages {
    ancient_slot_count: usize,
    ancient_slots: Vec<Slot>,
    first_non_ancient_slot: Slot,
    first_chunk_start: Slot,
    non_ancient_slot_count: usize,
    chunk_count: usize,
    normal_slot_range: Range<Slot>,
}
Expand description

results from ‘split_storages_ancient’

Fields§

§ancient_slot_count: usize§ancient_slots: Vec<Slot>

the specific ancient slots

§first_non_ancient_slot: Slot

lowest slot that is not an ancient append vec

§first_chunk_start: Slot

slot # of beginning of first aligned chunk starting from the first non ancient slot

§non_ancient_slot_count: usize§chunk_count: usize

chunks to use to iterate the storages

all ancient chunks, the special 0 and last chunks for non-full chunks, and all the ‘full’ chunks of normal slots

§normal_slot_range: Range<Slot>

start and end(exclusive) of normal (non-ancient) slots to be scanned

Implementations§

source§

impl SplitAncientStorages

source

fn new(one_epoch_old_slot: Slot, snapshot_storages: &SortedStorages<'_>) -> Self

When calculating accounts hash, we break the slots/storages into chunks that remain the same during an entire epoch. a slot is in this chunk of slots: start: (slot / MAX_ITEMS_PER_CHUNK) * MAX_ITEMS_PER_CHUNK end_exclusive: start + MAX_ITEMS_PER_CHUNK So a slot remains in the same chunk whenever it is included in the accounts hash. When the slot gets deleted or gets consumed in an ancient append vec, it will no longer be in its chunk. The results of scanning a chunk of appendvecs can be cached to avoid scanning large amounts of data over and over.

source

fn get_ancient_slots( one_epoch_old_slot: Slot, snapshot_storages: &SortedStorages<'_> ) -> Vec<Slot>

return all ancient append vec slots from the early slots referenced by ‘snapshot_storages’

source

fn new_with_ancient_info( range: &Range<Slot>, ancient_slots: Vec<Slot>, first_non_ancient_slot: Slot ) -> Self

create once ancient slots have been identified This is easier to test, removing SortedStorages as a type to deal with here.

source

fn get_starting_slot_from_normal_chunk(&self, normal_chunk: usize) -> Slot

given ‘normal_chunk’, return the starting slot of that chunk in the normal/non-ancient range a normal_chunk is 0<=normal_chunk<=non_ancient_chunk_count non_ancient_chunk_count is chunk_count-ancient_slot_count

source

fn is_chunk_ancient(&self, chunk: usize) -> bool

ancient slots are the first chunks

source

fn get_slot_range(&self, chunk: usize) -> Option<Range<Slot>>

given chunk in 0<=chunk<self.chunk_count return the range of slots in that chunk None indicates the range is empty for that chunk.

Trait Implementations§

source§

impl Debug for SplitAncientStorages

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SplitAncientStorages

source§

fn default() -> SplitAncientStorages

Returns the “default value” for a type. Read more
source§

impl PartialEq<SplitAncientStorages> for SplitAncientStorages

source§

fn eq(&self, other: &SplitAncientStorages) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for SplitAncientStorages

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> AbiExample for T

source§

default fn example() -> T

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more