diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 5142a1cea9..95ba4943b4 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -34,10 +34,6 @@ pub mod transaction_utils; pub mod vote_account; pub mod vote_sender_types; -extern crate solana_config_program; -extern crate solana_stake_program; -extern crate solana_vote_program; - #[macro_use] extern crate solana_metrics; #[macro_use] @@ -45,6 +41,3 @@ extern crate serde_derive; #[macro_use] extern crate solana_frozen_abi_macro; - -extern crate fs_extra; -extern crate tempfile; diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index eb7652a860..8a0efb0ece 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -11,7 +11,6 @@ use crate::{ use bincode::{config::Options, serialize_into}; use bzip2::bufread::BzDecoder; use flate2::read::GzDecoder; -use fs_extra::dir::CopyOptions; use log::*; use regex::Regex; use solana_measure::measure::Measure; @@ -111,9 +110,6 @@ pub enum SnapshotError { #[error("serialization error: {0}")] Serialize(#[from] bincode::Error), - #[error("file system error: {0}")] - FsExtra(#[from] fs_extra::error::Error), - #[error("archive generation failure {0}")] ArchiveGenerationFailure(ExitStatus), @@ -547,7 +543,7 @@ pub fn add_snapshot>( }) } -pub fn serialize_status_cache( +fn serialize_status_cache( slot: Slot, slot_deltas: &[BankSlotDelta], snapshot_links: &TempDir, @@ -627,20 +623,6 @@ pub fn bank_from_archive>( measure.stop(); info!("{}", measure); - // Move the unpacked snapshots into `snapshot_path` - let dir_files = fs::read_dir(&unpacked_snapshots_dir).unwrap_or_else(|err| { - panic!( - "Invalid snapshot path {:?}: {}", - unpacked_snapshots_dir, err - ) - }); - let paths: Vec = dir_files - .filter_map(|entry| entry.ok().map(|e| e.path())) - .collect(); - let mut copy_options = CopyOptions::new(); - copy_options.overwrite = true; - fs_extra::move_items(&paths, &snapshot_path, ©_options)?; - Ok(bank) } @@ -800,7 +782,10 @@ where .pop() .ok_or_else(|| get_io_error("No snapshots found in snapshots directory"))?; - info!("Loading bank from {:?}", &root_paths.snapshot_file_path); + info!( + "Loading bank from {}", + &root_paths.snapshot_file_path.display() + ); let bank = deserialize_snapshot_data_file(&root_paths.snapshot_file_path, |mut stream| { Ok(match snapshot_version_enum { SnapshotVersion::V1_2_0 => bank_from_stream( @@ -819,7 +804,10 @@ where let status_cache_path = unpacked_snapshots_dir.join(SNAPSHOT_STATUS_CACHE_FILE_NAME); let slot_deltas = deserialize_snapshot_data_file(&status_cache_path, |stream| { - info!("Rebuilding status cache..."); + info!( + "Rebuilding status cache from {}", + status_cache_path.display() + ); let slot_deltas: Vec = bincode::options() .with_limit(MAX_SNAPSHOT_DATA_FILE_SIZE) .with_fixint_encoding()