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