Module solana_accounts_db::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
- 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
Constants§
- used by tests for ‘include_slot_in_hash’ parameter Tests just need to be self-consistent, so any value should work here.
Functions§
- To allow generating a bank snapshot directory with full state information, we need to hardlink account appendvec files from the runtime operation directory to a snapshot hardlink directory. This is to create the run/ and snapshot sub directories for an account_path provided by the user. These two sub directories are on the same file system partition to allow hard-linking.
- For all account_paths, create the run/ and snapshot/ sub directories. If an account_path directory does not exist, create it. It returns (account_run_paths, account_snapshot_paths) or error
- Delete the files and subdirectories in a directory. This is useful if the process does not have permission to delete the top level directory it might be able to delete the contents of that directory.
Type Aliases§
- An offset into the AccountsDb::storage vector