From 463cd564cf395efc2a7fafaee017a97cea2bf342 Mon Sep 17 00:00:00 2001 From: HaoranYi Date: Sat, 5 Mar 2022 20:46:46 -0600 Subject: [PATCH] fix typos (#23495) * fix typos --- runtime/src/accounts_db.rs | 12 ++++++------ runtime/src/snapshot_utils.rs | 2 +- validator/src/main.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index e8866cd4d5..86689345bf 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -170,14 +170,14 @@ type DashMapVersionHash = DashMap; #[derive(Debug, Clone, Copy)] pub enum AccountShrinkThreshold { - /// Measure the total space sparseness across all candididates - /// And select the candidiates by using the top sparse account storage entries to shrink. + /// Measure the total space sparseness across all candidates + /// And select the candidates by using the top sparse account storage entries to shrink. /// The value is the overall shrink threshold measured as ratio of the total live bytes /// over the total bytes. TotalSpace { shrink_ratio: f64 }, /// Use the following option to shrink all stores whose alive ratio is below /// the specified threshold. - IndividalStore { shrink_ratio: f64 }, + IndividualStore { shrink_ratio: f64 }, } pub const DEFAULT_ACCOUNTS_SHRINK_OPTIMIZE_TOTAL_SPACE: bool = true; pub const DEFAULT_ACCOUNTS_SHRINK_RATIO: f64 = 0.80; @@ -6038,7 +6038,7 @@ impl AccountsDb { AccountShrinkThreshold::TotalSpace { shrink_ratio: _ } => { Self::page_align(store.alive_bytes() as u64) < store.total_bytes() } - AccountShrinkThreshold::IndividalStore { shrink_ratio } => { + AccountShrinkThreshold::IndividualStore { shrink_ratio } => { (Self::page_align(store.alive_bytes() as u64) as f64 / store.total_bytes() as f64) < shrink_ratio } @@ -13185,7 +13185,7 @@ pub mod tests { (shrink_ratio * 100.) as u64 ) } - AccountShrinkThreshold::IndividalStore { shrink_ratio: _ } => { + AccountShrinkThreshold::IndividualStore { shrink_ratio: _ } => { panic!("Expect the default to be TotalSpace") } } @@ -13196,7 +13196,7 @@ pub mod tests { accounts.shrink_ratio = AccountShrinkThreshold::TotalSpace { shrink_ratio: 0.3 }; entry.alive_bytes.store(3000, Ordering::Release); assert!(accounts.is_candidate_for_shrink(&entry)); - accounts.shrink_ratio = AccountShrinkThreshold::IndividalStore { shrink_ratio: 0.3 }; + accounts.shrink_ratio = AccountShrinkThreshold::IndividualStore { shrink_ratio: 0.3 }; assert!(!accounts.is_candidate_for_shrink(&entry)); } diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 3ec0876a92..76af3daf5a 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -2458,7 +2458,7 @@ mod tests { &expected_snapshots, ); - // retaiing 2, expecting the 2 newest to be retained + // retaining 2, expecting the 2 newest to be retained let expected_snapshots = vec![&snap2_name, &snap3_name]; common_test_purge_old_snapshot_archives( &snapshot_names, diff --git a/validator/src/main.rs b/validator/src/main.rs index da4225c83a..4996358024 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -2100,7 +2100,7 @@ pub fn main() { let accounts_shrink_ratio = if accounts_shrink_optimize_total_space { AccountShrinkThreshold::TotalSpace { shrink_ratio } } else { - AccountShrinkThreshold::IndividalStore { shrink_ratio } + AccountShrinkThreshold::IndividualStore { shrink_ratio } }; let entrypoint_addrs = values_t!(matches, "entrypoint", String) .unwrap_or_default()