Skip to main content

Module snapshot_utils

Module snapshot_utils 

Source

Modules§

snapshot_storage_rebuilder
Provides interfaces for rebuilding snapshot storages

Structs§

BankSnapshotInfo
Information about a bank snapshot. Namely the slot of the bank, the path to the snapshot, and the kind of the snapshot.
SnapshotRootPaths
Helper type when rebuilding from snapshots. Designed to handle when rebuilding from just a full snapshot, or from both a full snapshot and an incremental snapshot.
UnarchivedSnapshot
Helper type to bundle up the results from unarchive_snapshot()
UnarchivedSnapshots
Helper type to bundle up the results from verify_and_unarchive_snapshots().
UnarchivedSnapshotsGuard
Guard type that keeps the unpack directories of snapshots alive. Once dropped, the unpack directories are removed.
UnpackedSnapshotsDirAndVersion
Helper type for passing around the unpacked snapshots dir and the snapshot version together

Enums§

SnapshotFrom
When constructing a bank a snapshot, traditionally the snapshot was from a snapshot archive. Now, the snapshot can be from a snapshot directory, or from a snapshot archive. This is the flag to indicate which.
VerifyBank
allow tests to specify what happened to the serialized format

Constants§

MAX_OBSOLETE_ACCOUNTS_FILE_SIZE
Limit the size of the obsolete accounts file If it exceeds this limit, remove the file which will force restore from archives Limit is set assuming 24 bytes per entry, 5% of 10 billion accounts = 500 million entries * 24 bytes = 12 GB
MAX_SNAPSHOT_DATA_FILE_SIZE
MAX_STORAGES_LIST_FILE_SIZE
Limit the size of the storages list file. Each (slot, id) entry encodes to 12 bytes; 100 MiB covers ~8.7 million entries, well past any realistic storage count.

Functions§

archive_snapshot_package
Creates an archive based on the bank snapshot and snapshot storages
create_tmp_accounts_dir_for_tests
Creates an “accounts path” directory for tests
deserialize_snapshot_data_file
deserialize_snapshot_data_files
get_bank_snapshots
Get the bank snapshots in a directory
get_highest_bank_snapshot
Get the bank snapshot with the highest slot in a directory
get_highest_loadable_bank_snapshot
Gets the highest, loadable, bank snapshot
mark_bank_snapshot_as_loadable
Writes files that indicate the bank snapshot is loadable by fastboot
purge_all_bank_snapshots
Purges all bank snapshots
purge_bank_snapshot
Remove the bank snapshot at this path
purge_bank_snapshots_older_than_slot
Purges bank snapshots that are older than slot
purge_incomplete_bank_snapshots
Purges incomplete bank snapshots
purge_old_bank_snapshots
Purges bank snapshots, retaining the newest num_bank_snapshots_to_retain
purge_old_bank_snapshots_at_startup
At startup, purge old (i.e. unusable) bank snapshots
purge_old_snapshot_archives
remove_tmp_snapshot_archives
If the validator halts in the middle of archive_snapshot_package(), the temporary staging directory won’t be cleaned up. Call this function to clean them up.
serialize_snapshot
Serializes a snapshot into bank_snapshots_dir
serialize_snapshot_data_file
should_take_full_snapshot
should_take_incremental_snapshot
verify_and_unarchive_snapshots
Unarchives the given full and incremental snapshot archives, as long as they are compatible.
verify_unpacked_snapshots_dir_and_version
wipe_account_snapshot_dirs
For each account run dir, wipes the sibling snapshot/ dir.
write_obsolete_accounts_to_snapshot
write_storages_list_to_snapshot