diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index de485e637845ac..06468d15b69486 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -24,7 +24,7 @@ use { append_vec::AppendVec, hardened_unpack::{self, ParallelSelector, UnpackError}, shared_buffer_reader::{SharedBuffer, SharedBufferReader}, - utils::delete_contents_of_path, + utils::{delete_contents_of_path, ACCOUNTS_RUN_DIR, ACCOUNTS_SNAPSHOT_DIR}, }, solana_measure::{measure, measure::Measure}, solana_sdk::{clock::Slot, hash::Hash}, @@ -1172,7 +1172,7 @@ fn get_account_path_from_appendvec_path(appendvec_path: &Path) -> Option/run/. // When generating the bank snapshot directory, they are hardlinked to /snapshot// - if run_file_name != "run" { + if run_file_name != ACCOUNTS_RUN_DIR { error!( "The account path {} does not have run/ as its immediate parent directory.", run_path.display() @@ -1195,7 +1195,9 @@ fn get_snapshot_accounts_hardlink_dir( GetSnapshotAccountsHardLinkDirError::GetAccountPath(appendvec_path.to_path_buf()) })?; - let snapshot_hardlink_dir = account_path.join("snapshot").join(bank_slot.to_string()); + let snapshot_hardlink_dir = account_path + .join(ACCOUNTS_SNAPSHOT_DIR) + .join(bank_slot.to_string()); // Use the hashset to track, to avoid checking the file system. Only set up the hardlink directory // and the symlink to it at the first time of seeing the account_path. @@ -1536,7 +1538,7 @@ pub fn rebuild_storages_from_snapshot_dir( .ok_or_else(|| SnapshotError::InvalidAccountPath(account_snapshot_path.clone()))? .parent() .ok_or_else(|| SnapshotError::InvalidAccountPath(account_snapshot_path.clone()))? - .join("run"); + .join(ACCOUNTS_RUN_DIR); if !account_run_paths.contains(&account_run_path) { // The appendvec from the bank snapshot storage does not match any of the provided account_paths set. // The accout paths have changed so the snapshot is no longer usable.