Module snapshot_utils

Source

Structs§

BankFromArchiveTimings
BankSnapshotInfo
Information about a bank snapshot. Namely the slot of the bank, the path to the snapshot, and the type of the snapshot.

Enums§

ArchiveFormat
The different archive formats used for snapshots
BankSnapshotType
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.
ParseError
SnapshotError
SnapshotVersion
VerifyBank
allow tests to specify what happened to the serialized format
VerifySlotDeltasError
Errors that can happen in verify_slot_deltas()

Constants§

BANK_SNAPSHOT_PRE_FILENAME_EXTENSION
DEFAULT_ARCHIVE_COMPRESSION
DEFAULT_FULL_SNAPSHOT_ARCHIVE_INTERVAL_SLOTS
DEFAULT_INCREMENTAL_SNAPSHOT_ARCHIVE_INTERVAL_SLOTS
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_BANK_SNAPSHOTS_TO_RETAIN
SNAPSHOT_ARCHIVE_DOWNLOAD_DIR
SNAPSHOT_STATUS_CACHE_FILENAME
SUPPORTED_ARCHIVE_COMPRESSION
TAR_BZIP2_EXTENSION
TAR_EXTENSION
TAR_GZIP_EXTENSION
TAR_LZ4_EXTENSION
TAR_ZSTD_EXTENSION
TMP_SNAPSHOT_ARCHIVE_PREFIX

Functions§

add_bank_snapshot
Serialize a bank to a snapshot
archive_snapshot_package
Make a snapshot archive out of the snapshot package
bank_fields_from_snapshot_archives
Utility for parsing out bank specific information from a snapshot archive. This utility can be used to parse out bank specific information like the leader schedule, epoch schedule, etc.
bank_from_latest_snapshot_archives
Rebuild bank from snapshot archives. This function searches full_snapshot_archives_dir and incremental_snapshot_archives_dir for the highest full snapshot and highest corresponding incremental snapshot, then rebuilds the bank.
bank_from_snapshot_archives
Rebuild bank from snapshot archives. Handles either just a full snapshot, or both a full snapshot and an incremental snapshot.
bank_to_full_snapshot_archive
Convenience function to create a full snapshot archive out of any Bank, regardless of state. The Bank will be frozen during the process. This is only called from ledger-tool or tests. Warping is a special case as well.
bank_to_incremental_snapshot_archive
Convenience function to create an incremental snapshot archive out of any Bank, regardless of state. The Bank will be frozen during the process. This is only called from ledger-tool or tests. Warping is a special case as well.
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
deserialize_snapshot_data_file
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_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_incremental_snapshot_archives
Get a list of the incremental snapshot archives from a directory
package_and_archive_full_snapshot
Helper function to hold shared code to package, process, and archive full snapshots
package_and_archive_incremental_snapshot
Helper function to hold shared code to package, process, and archive incremental snapshots
path_to_file_name_str
Get the &str from a &Path
purge_old_bank_snapshots
Remove outdated bank snapshots
purge_old_snapshot_archives
remove_bank_snapshot
Remove the snapshot directory for this slot
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_data_file
should_take_full_snapshot
should_take_incremental_snapshot
snapshot_bank
Gather the necessary elements for a snapshot of the given root_bank.
verify_snapshot_archive

Type Aliases§

Result