Module solana_runtime::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
- A set of utility functions used for testing and benchmarking
Structs
- Persistent storage structure holding the accounts
- hold alive accounts alive means in the accounts index
- while combining into ancient append vecs, we need to keep track of the current one that is receiving new data The pattern for callers is:
- Removing unrooted slots in Accounts Background Service needs to be synchronized with flushing slots from the Accounts Cache. This keeps track of those slots and the Mutex + Condvar for synchronization.
- state to keep while scanning append vec accounts for hash calculation These would have been captured in a fn from within the scan function. Some of these are constant across all pubkeys, some are constant across a slot. Some could be unique per pubkey.
- separate pubkeys into those with a single refcount and those with > 1 refcount
- results from ‘split_storages_ancient’
- Configuration Parameters for running accounts hash and total lamports verification
Enums
- Specify the source of the accounts data when calculating the accounts hash
- Which accounts hash calculation is being performed?
- temporary enum during feature activation of ignore slot when calculating an account hash #28420
- specifies how to return zero lamport accounts from a load
- StoreTo 🔒
- __Field 🔒
Constants
- FIELDS 🔒
- used by tests for ‘include_slot_in_hash’ parameter Tests just need to be self-consistent, so any value should work here.
- LIMIT 🔒
Statics
Traits
- called on a struct while scanning append vecs
Functions
Type Definitions
- An offset into the AccountsDb::storage vector