pub struct RentPayingAccountsByPartition {
pub accounts: Vec<HashSet<Pubkey>>,
/* private fields */
}
Expand description
populated at startup with the accounts that were found that are rent paying. These are the ‘possible’ rent paying accounts. This set can never grow during runtime since it is not possible to create rent paying accounts now. It can shrink during execution if a rent paying account is dropped to lamports=0 or is topped off. The next time the validator restarts, it will remove the account from this list.
Fields§
§accounts: Vec<HashSet<Pubkey>>
1st index is partition end index, 0..=432_000 2nd dimension is list of pubkeys which were identified at startup to be rent paying At the moment, we use this data structure to verify all rent paying accounts are expected. When we stop iterating the accounts index to FIND rent paying accounts, we will no longer need this to be a hashset. It can just be a vec.
Implementations§
Source§impl RentPayingAccountsByPartition
impl RentPayingAccountsByPartition
Sourcepub fn new(epoch_schedule: &EpochSchedule) -> Self
pub fn new(epoch_schedule: &EpochSchedule) -> Self
create new struct. Need slots per epoch from ‘epoch_schedule’
Sourcepub fn add_account(&mut self, pubkey: &Pubkey)
pub fn add_account(&mut self, pubkey: &Pubkey)
Remember that ‘pubkey’ can possibly be rent paying.
Sourcepub fn get_pubkeys_in_partition_index(
&self,
partition_end_index: PartitionIndex,
) -> &HashSet<Pubkey>
pub fn get_pubkeys_in_partition_index( &self, partition_end_index: PartitionIndex, ) -> &HashSet<Pubkey>
return all pubkeys that can possibly be rent paying with this partition end_index
pub fn is_initialized(&self) -> bool
Trait Implementations§
Source§impl Default for RentPayingAccountsByPartition
impl Default for RentPayingAccountsByPartition
Source§fn default() -> RentPayingAccountsByPartition
fn default() -> RentPayingAccountsByPartition
Auto Trait Implementations§
impl Freeze for RentPayingAccountsByPartition
impl RefUnwindSafe for RentPayingAccountsByPartition
impl Send for RentPayingAccountsByPartition
impl Sync for RentPayingAccountsByPartition
impl Unpin for RentPayingAccountsByPartition
impl UnwindSafe for RentPayingAccountsByPartition
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> 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 more