pub struct AccountsDb {
Show 15 fields pub accounts_index: AccountsIndex<AccountInfo>, pub storage: AccountStorage, pub accounts_cache: AccountsCache, pub next_id: AtomicUsize, 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 cluster_type: Option<ClusterType>, pub account_indexes: AccountSecondaryIndexes, pub caching_enabled: bool, pub filler_account_suffix: Option<Pubkey>, 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

storage: AccountStorageaccounts_cache: AccountsCachenext_id: AtomicUsize

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>>cluster_type: Option<ClusterType>account_indexes: AccountSecondaryIndexescaching_enabled: boolfiller_account_suffix: Option<Pubkey>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.

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_from_abs is true if the caller is the AccountsBackgroundService

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