diff --git a/core/src/accounts_hash_verifier.rs b/core/src/accounts_hash_verifier.rs index 43601d8552..4be8537672 100644 --- a/core/src/accounts_hash_verifier.rs +++ b/core/src/accounts_hash_verifier.rs @@ -83,17 +83,17 @@ impl AccountsHashVerifier { snapshot_interval_slots: u64, ) { if fault_injection_rate_slots != 0 - && accounts_package.root % fault_injection_rate_slots == 0 + && accounts_package.slot % fault_injection_rate_slots == 0 { // For testing, publish an invalid hash to gossip. use rand::{thread_rng, Rng}; use solana_sdk::hash::extend_and_hash; - warn!("inserting fault at slot: {}", accounts_package.root); + warn!("inserting fault at slot: {}", accounts_package.slot); let rand = thread_rng().gen_range(0, 10); let hash = extend_and_hash(&accounts_package.hash, &[rand]); - hashes.push((accounts_package.root, hash)); + hashes.push((accounts_package.slot, hash)); } else { - hashes.push((accounts_package.root, accounts_package.hash)); + hashes.push((accounts_package.slot, accounts_package.hash)); } while hashes.len() > MAX_SNAPSHOT_HASHES { @@ -234,7 +234,7 @@ mod tests { let accounts_package = AccountsPackage { hash: hash(&[i as u8]), block_height: 100 + i as u64, - root: 100 + i as u64, + slot: 100 + i as u64, slot_deltas: vec![], snapshot_links, tar_output_file: PathBuf::from("."), diff --git a/core/src/snapshot_packager_service.rs b/core/src/snapshot_packager_service.rs index 1fc9038651..5432d7a517 100644 --- a/core/src/snapshot_packager_service.rs +++ b/core/src/snapshot_packager_service.rs @@ -51,7 +51,7 @@ impl SnapshotPackagerService { { warn!("Failed to create snapshot archive: {}", err); } else { - hashes.push((snapshot_package.root, snapshot_package.hash)); + hashes.push((snapshot_package.slot, snapshot_package.hash)); while hashes.len() > MAX_SNAPSHOT_HASHES { hashes.remove(0); } diff --git a/runtime/src/snapshot_package.rs b/runtime/src/snapshot_package.rs index 31a8cda030..917669c41d 100644 --- a/runtime/src/snapshot_package.rs +++ b/runtime/src/snapshot_package.rs @@ -15,7 +15,7 @@ pub type AccountsPackageSendError = SendError; #[derive(Debug)] pub struct AccountsPackage { - pub root: Slot, + pub slot: Slot, pub block_height: Slot, pub slot_deltas: Vec, pub snapshot_links: TempDir, @@ -28,7 +28,7 @@ pub struct AccountsPackage { impl AccountsPackage { pub fn new( - root: Slot, + slot: Slot, block_height: u64, slot_deltas: Vec, snapshot_links: TempDir, @@ -39,7 +39,7 @@ impl AccountsPackage { snapshot_version: SnapshotVersion, ) -> Self { Self { - root, + slot, block_height, slot_deltas, snapshot_links, diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index ba37f2489b..c86555e4d4 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -229,11 +229,11 @@ pub fn remove_tmp_snapshot_archives(snapshot_path: &Path) { pub fn archive_snapshot_package(snapshot_package: &AccountsPackage) -> Result<()> { info!( "Generating snapshot archive for slot {}", - snapshot_package.root + snapshot_package.slot ); serialize_status_cache( - snapshot_package.root, + snapshot_package.slot, &snapshot_package.slot_deltas, &snapshot_package.snapshot_links.path().join(SNAPSHOT_STATUS_CACHE_FILE_NAME), )?; @@ -360,13 +360,13 @@ pub fn archive_snapshot_package(snapshot_package: &AccountsPackage) -> Result<() info!( "Successfully created {:?}. slot: {}, elapsed ms: {}, size={}", snapshot_package.tar_output_file, - snapshot_package.root, + snapshot_package.slot, timer.as_ms(), metadata.len() ); datapoint_info!( "snapshot-package", - ("slot", snapshot_package.root, i64), + ("slot", snapshot_package.slot, i64), ("duration_ms", timer.as_ms(), i64), ("size", metadata.len(), i64) );