solana_accounts_db

Module accounts_db

Source
Expand description

Persistent accounts are stored at this path location: <path>/<pid>/data/

The persistent store would allow for this mode of operation:

  • Concurrent single thread append with many concurrent readers.

The underlying memory is memory mapped to a file. The accounts would be stored across multiple files and the mappings of file and offset of a particular account would be stored in a shared index. This will allow for concurrent commits without blocking reads, which will sequentially write to memory, ssd or disk, and should be as fast as the hardware allow for. The only required in memory data structure with a write lock is the index, which should be fast to update.

[AppendVec]’s only store accounts for single slots. To bootstrap the index from a persistent store of [AppendVec]’s, the entries include a “write_version”. A single global atomic AccountsDb::write_version tracks the number of commits to the entire data store. So the latest commit for each slot entry would be indexed.

Modules§

stats

Structs§

AccountFromStorage
reference an account found during scanning a storage. This is a byval struct to replace StoredAccountMeta
AccountStorageEntry
Persistent storage structure holding the accounts
AccountsAddRootTiming
AccountsDb
AccountsDbConfig
DuplicatesLtHash
The lt hash of old/duplicate accounts
GetUniqueAccountsResult
IndexGenerationInfo
PubkeyHashAccount
VerifyAccountsHashAndLamportsConfig
Configuration Parameters for running accounts hash and total lamports verification

Enums§

AccountShrinkThreshold
AccountsHashVerificationError
CalcAccountsHashDataSource
Specify the source of the accounts data when calculating the accounts hash
CalcAccountsHashKind
Which accounts hash calculation is being performed?
CreateAncientStorage
LoadHint
LoadedAccount
LoadedAccountAccessor
OldStoragesPolicy
How should old storages be handled in clean_accounts()?
ScanStorageResult
StoreReclaims

Constants§

ACCOUNTS_DB_CONFIG_FOR_BENCHMARKS
ACCOUNTS_DB_CONFIG_FOR_TESTING
DEFAULT_ACCOUNTS_SHRINK_OPTIMIZE_TOTAL_SPACE
DEFAULT_ACCOUNTS_SHRINK_RATIO
MAX_ANCIENT_SLOTS_DEFAULT
Default value for the number of ancient storages the ancient slot combining should converge to.
PUBKEY_BINS_FOR_CALCULATING_HASHES

Functions§

default_num_foreground_threads
default_num_hash_threads
Returns the default number of threads to use for background accounts hashing
get_temp_accounts_paths
make_hash_thread_pool
make_min_priority_thread_pool
quarter_thread_count

Type Aliases§

AccountsFileId
AtomicAccountsFileId
An offset into the AccountsDb::storage vector
BinnedHashData