pub struct AccountsDb {
Show 23 fields pub accounts_index: AccountsIndex<AccountInfo>, pub accounts_hash_complete_one_epoch_old: RwLock<Slot>, pub skip_rewrites: bool, pub ancient_append_vecs: bool, pub skip_initial_hash_calc: bool, pub storage: AccountStorage, pub accounts_cache: AccountsCache, pub next_id: AtomicAppendVecId, pub shrink_candidate_slots: Mutex<HashMap<Slot, HashMap<AppendVecId, Arc<AccountStorageEntry>>>>, pub shrink_candidate_slots_v1: Mutex<Vec<Slot>>, pub shrink_paths: RwLock<Option<Vec<PathBuf>>>, pub thread_pool: ThreadPool, pub thread_pool_clean: ThreadPool, pub bank_hashes: RwLock<HashMap<Slot, BankHashInfo>>, pub stats: AccountsStats, pub cluster_type: Option<ClusterType>, pub account_indexes: AccountSecondaryIndexes, pub caching_enabled: bool, pub startup_verification_complete: Arc<AtomicBool>, pub filler_account_suffix: Option<Pubkey>, pub filler_accounts_per_slot: AtomicU64, pub filler_account_slots_remaining: AtomicU64, pub num_hash_scan_passes: Option<usize>, /* private fields */
}

Fields

accounts_index: AccountsIndex<AccountInfo>

Keeps tracks of index into AppendVec on a per slot basis

accounts_hash_complete_one_epoch_old: RwLock<Slot>

slot that is one epoch older than the highest slot where accounts hash calculation has completed

skip_rewrites: bool

true iff rent exempt accounts are not rewritten in their normal rent collection slot

ancient_append_vecs: bool

true iff we want to squash old append vecs together into ‘ancient append vecs’

skip_initial_hash_calc: bool

true iff we want to skip the initial hash calculation on startup

storage: AccountStorageaccounts_cache: AccountsCachenext_id: AtomicAppendVecId

distribute the accounts across storage lists

shrink_candidate_slots: Mutex<HashMap<Slot, HashMap<AppendVecId, Arc<AccountStorageEntry>>>>

Set of shrinkable stores organized by map of slot to append_vec_id

shrink_candidate_slots_v1: Mutex<Vec<Slot>>

Legacy shrink slots to support non-cached code-path.

shrink_paths: RwLock<Option<Vec<PathBuf>>>thread_pool: ThreadPool

Thread pool used for par_iter

thread_pool_clean: ThreadPoolbank_hashes: RwLock<HashMap<Slot, BankHashInfo>>stats: AccountsStatscluster_type: Option<ClusterType>account_indexes: AccountSecondaryIndexescaching_enabled: boolstartup_verification_complete: Arc<AtomicBool>filler_account_suffix: Option<Pubkey>filler_accounts_per_slot: AtomicU64

number of filler accounts to add for each slot

filler_account_slots_remaining: AtomicU64

number of slots remaining where filler accounts should be added

num_hash_scan_passes: Option<usize>

Implementations

Notify the plugins of of account data when AccountsDb is restored from a snapshot. The data is streamed in the reverse order of the slots so that an account is only streamed once. At a slot, if the accounts is updated multiple times only the last write (with highest write_version) is notified.

hash calc is completed as of ‘slot’ so, any process that wants to take action on really old slots can now proceed up to ‘completed_slot’-slots per epoch

return true if the accounts in this slot should be moved to an ancient append vec otherwise, return false and the caller can skip this slot side effect could be updating ‘current_ancient’

Only guaranteed to be safe when called from rent collection

Scan a specific slot through all the account storage in parallel

This should only be called after the Bank::drop() runs in bank.rs, See BANK_DROP_SAFETY comment below for more explanation.

  • is_serialized_with_abs - indicates whehter this call runs sequentially with all other accounts_db relevant calls, such as shrinking, purging etc., in account background service.

find slot >= ‘slot’ which is a root or in ‘ancestors’

Only called from startup or test code.

Only called from startup or test code.

Scan a slot in the account storage for dirty pubkeys and insert them into the list of uncleaned pubkeys

This function is called in Bank::drop() when the bank is not frozen, so that its pubkeys are considered for cleanup.

Store the account update. only called by tests

true if ‘pubkey’ is a filler account

true if it is possible that there are filler accounts present

filler accounts are space-holding accounts which are ignored by hash calculations and rent. They are designed to allow a validator to run against a network successfully while simulating having many more accounts present. All filler accounts share a common pubkey suffix. The suffix is randomly generated per validator on startup. The filler accounts are added to each slot in the snapshot after index generation. The accounts added in a slot are setup to have pubkeys such that rent will be collected from them before (or when?) their slot becomes an epoch old. Thus, the filler accounts are rewritten by rent and the old slot can be thrown away successfully.

Legacy shrink functions to support non-cached path. Should be able to be deleted after cache path is the only path.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

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

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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