solana_runtime

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()
UnpackedSnapshotsDirAndVersion
Helper type for passing around the unpacked snapshots dir and the snapshot version together

Enums§

AddBankSnapshotError
Errors that can happen in add_bank_snapshot()
ArchiveFormat
The different archive formats used for snapshots
ArchiveSnapshotPackageError
Errors that can happen in archive_snapshot_package()
BankSnapshotKind
Bank snapshots traditionally had their accounts hash calculated prior to serialization. Since the hash calculation takes a long time, an optimization has been put in to offload the accounts hash calculation. The bank serialization format has not changed, so we need another way to identify if a bank snapshot contains the calculated accounts hash or not.
GetSnapshotAccountsHardLinkDirError
Errors that can happen in get_snapshot_accounts_hardlink_dir()
HardLinkStoragesToSnapshotError
Errors that can happen in hard_link_storages_to_snapshot()
ParseError
SnapshotError
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.
SnapshotNewFromDirError
SnapshotVersion
VerifyBank
allow tests to specify what happened to the serialized format
VerifyEpochStakesError
Errors that can happen in verify_epoch_stakes()
VerifySlotDeltasError
Errors that can happen in verify_slot_deltas()

Constants§

BANK_SNAPSHOT_PRE_FILENAME_EXTENSION
DEFAULT_ARCHIVE_COMPRESSION
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN
DEFAULT_MAX_INCREMENTAL_SNAPSHOT_ARCHIVES_TO_RETAIN
FULL_SNAPSHOT_ARCHIVE_FILENAME_REGEX
INCREMENTAL_SNAPSHOT_ARCHIVE_FILENAME_REGEX
MAX_SNAPSHOT_DATA_FILE_SIZE
SNAPSHOT_ACCOUNTS_HARDLINKS
SNAPSHOT_ARCHIVE_DOWNLOAD_DIR
SNAPSHOT_FULL_SNAPSHOT_SLOT_FILENAME
SNAPSHOT_STATE_COMPLETE_FILENAME
SNAPSHOT_STATUS_CACHE_FILENAME
SNAPSHOT_VERSION_FILENAME
SUPPORTED_ARCHIVE_COMPRESSION
TAR_BZIP2_EXTENSION
TAR_EXTENSION
TAR_GZIP_EXTENSION
TAR_LZ4_EXTENSION
TAR_ZSTD_EXTENSION
TMP_SNAPSHOT_ARCHIVE_PREFIX

Functions§

build_full_snapshot_archive_path
Build the full snapshot archive path from its components: the snapshot archives directory, the snapshot slot, the accounts hash, and the archive format.
build_incremental_snapshot_archive_path
Build the incremental snapshot archive path from its components: the snapshot archives directory, the snapshot base slot, the snapshot slot, the accounts hash, and the archive format.
build_snapshot_archives_remote_dir
clean_orphaned_account_snapshot_dirs
The account snapshot directories under <account_path>/snapshot/ contain account files hardlinked from <account_path>/run taken at snapshot time. They are referenced by the symlinks from the bank snapshot dir snapshot//accounts_hardlinks/. We observed that sometimes the bank snapshot dir could be deleted but the account snapshot directories were left behind, possibly by some manual operations or some legacy code not using the symlinks to clean up the account snapshot hardlink directories. This function cleans up any account snapshot directories that are no longer referenced by the bank snapshot dirs, to ensure proper snapshot operations.
deserialize_snapshot_data_file
deserialize_snapshot_data_files
get_bank_snapshot_dir
Constructs the path to the bank snapshot directory for slot within bank_snapshots_dir
get_bank_snapshots
Get the bank snapshots in a directory
get_bank_snapshots_post
Get the bank snapshots in a directory
get_bank_snapshots_pre
Get the bank snapshots in a directory
get_full_snapshot_archives
Get a list of the full snapshot archives from a directory
get_highest_bank_snapshot
Get the bank snapshot with the highest slot in a directory
get_highest_bank_snapshot_post
Get the bank snapshot with the highest slot in a directory
get_highest_bank_snapshot_pre
Get the bank snapshot with the highest slot in a directory
get_highest_full_snapshot_archive_info
Get the path (and metadata) for the full snapshot archive with the highest slot in a directory
get_highest_full_snapshot_archive_slot
Get the highest slot of the full snapshot archives in a directory
get_highest_incremental_snapshot_archive_info
Get the path for the incremental snapshot archive with the highest slot, for a given full snapshot slot, in a directory
get_highest_incremental_snapshot_archive_slot
Get the highest slot of the incremental snapshot archives in a directory, for a given full snapshot slot
get_highest_loadable_bank_snapshot
Gets the highest, loadable, bank snapshot
get_incremental_snapshot_archives
Get a list of the incremental snapshot archives from a directory
get_snapshot_file_name
Returns the file name of the bank snapshot for slot
hard_link_storages_to_snapshot
Hard-link the files from accounts/ to snapshot/<bank_slot>/accounts/ This keeps the appendvec files alive and with the bank snapshot. The slot and id in the file names are also updated in case its file is a recycled one with inconsistent slot and id.
path_to_file_name_str
Get the &str from a &Path
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
read_full_snapshot_slot_file
rebuild_storages_from_snapshot_dir
Performs the common tasks when deserializing a snapshot
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_and_archive_snapshot_package
Serializes and archives a snapshot package
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
write_full_snapshot_slot_file
Writes the full snapshot slot file into the bank snapshot dir

Type Aliases§

Result