Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit f5c8bb7

Browse files
remove unused bank creation/freezing progress (#32699)
1 parent 33c33f5 commit f5c8bb7

File tree

4 files changed

+0
-153
lines changed

4 files changed

+0
-153
lines changed

runtime/src/accounts_db.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ use {
5555
aligned_stored_size, AppendVec, MatchAccountOwnerError, APPEND_VEC_MMAPPED_FILES_OPEN,
5656
STORE_META_OVERHEAD,
5757
},
58-
bank_creation_freezing_progress::BankCreationFreezingProgress,
5958
cache_hash_data::{CacheHashData, CacheHashDataFile},
6059
contains::Contains,
6160
epoch_accounts_hash::EpochAccountsHashManager,
@@ -1505,8 +1504,6 @@ pub struct AccountsDb {
15051504
/// Some time later (to allow for slow calculation time), the bank hash at a slot calculated using 'M' includes the full accounts hash.
15061505
/// Thus, the state of all accounts on a validator is known to be correct at least once per epoch.
15071506
pub epoch_accounts_hash_manager: EpochAccountsHashManager,
1508-
1509-
pub(crate) bank_progress: BankCreationFreezingProgress,
15101507
}
15111508

15121509
#[derive(Debug, Default)]
@@ -2383,7 +2380,6 @@ impl AccountsDb {
23832380
const ACCOUNTS_STACK_SIZE: usize = 8 * 1024 * 1024;
23842381

23852382
AccountsDb {
2386-
bank_progress: BankCreationFreezingProgress::default(),
23872383
create_ancient_storage: CreateAncientStorage::Pack,
23882384
verify_accounts_hash_in_bg: VerifyAccountsHashInBackground::default(),
23892385
filler_accounts_per_slot: AtomicU64::default(),
@@ -4042,7 +4038,6 @@ impl AccountsDb {
40424038

40434039
Self::update_shrink_stats(&self.shrink_stats, stats_sub);
40444040
self.shrink_stats.report();
4045-
self.bank_progress.report();
40464041
}
40474042

40484043
pub(crate) fn update_shrink_stats(shrink_stats: &ShrinkStats, stats_sub: ShrinkStatsSub) {

runtime/src/bank.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ impl PartialEq for Bank {
491491
return true;
492492
}
493493
let Self {
494-
bank_freeze_or_destruction_incremented: _,
495494
rc: _,
496495
status_cache: _,
497496
blockhash_queue,
@@ -820,9 +819,6 @@ pub struct Bank {
820819

821820
pub check_program_modification_slot: bool,
822821

823-
/// true when the bank's freezing or destruction has completed
824-
bank_freeze_or_destruction_incremented: AtomicBool,
825-
826822
epoch_reward_status: EpochRewardStatus,
827823
}
828824

@@ -1029,7 +1025,6 @@ impl Bank {
10291025

10301026
fn default_with_accounts(accounts: Accounts) -> Self {
10311027
let mut bank = Self {
1032-
bank_freeze_or_destruction_incremented: AtomicBool::default(),
10331028
incremental_snapshot_persistence: None,
10341029
rc: BankRc::new(accounts, Slot::default()),
10351030
status_cache: Arc::<RwLock<BankStatusCache>>::default(),
@@ -1092,7 +1087,6 @@ impl Bank {
10921087
epoch_reward_status: EpochRewardStatus::default(),
10931088
};
10941089

1095-
bank.bank_created();
10961090
let accounts_data_size_initial = bank.get_total_accounts_stats().unwrap().data_len as u64;
10971091
bank.accounts_data_size_initial = accounts_data_size_initial;
10981092

@@ -1359,9 +1353,7 @@ impl Bank {
13591353
let (feature_set, feature_set_time_us) = measure_us!(parent.feature_set.clone());
13601354

13611355
let accounts_data_size_initial = parent.load_accounts_data_size();
1362-
parent.bank_created();
13631356
let mut new = Self {
1364-
bank_freeze_or_destruction_incremented: AtomicBool::default(),
13651357
incremental_snapshot_persistence: None,
13661358
rc,
13671359
status_cache,
@@ -1728,27 +1720,6 @@ impl Bank {
17281720
self.vote_only_bank
17291721
}
17301722

1731-
fn bank_created(&self) {
1732-
self.rc
1733-
.accounts
1734-
.accounts_db
1735-
.bank_progress
1736-
.increment_bank_creation_count();
1737-
}
1738-
1739-
fn bank_frozen_or_destroyed(&self) {
1740-
if !self
1741-
.bank_freeze_or_destruction_incremented
1742-
.swap(true, AcqRel)
1743-
{
1744-
self.rc
1745-
.accounts
1746-
.accounts_db
1747-
.bank_progress
1748-
.increment_bank_frozen_or_destroyed();
1749-
}
1750-
}
1751-
17521723
/// Like `new_from_parent` but additionally:
17531724
/// * Doesn't assume that the parent is anywhere near `slot`, parent could be millions of slots
17541725
/// in the past
@@ -1832,7 +1803,6 @@ impl Bank {
18321803
let feature_set = new();
18331804
let mut bank = Self {
18341805
incremental_snapshot_persistence: fields.incremental_snapshot_persistence,
1835-
bank_freeze_or_destruction_incremented: AtomicBool::default(),
18361806
rc: bank_rc,
18371807
status_cache: new(),
18381808
blockhash_queue: RwLock::new(fields.blockhash_queue),
@@ -1893,8 +1863,6 @@ impl Bank {
18931863
check_program_modification_slot: false,
18941864
epoch_reward_status: EpochRewardStatus::default(),
18951865
};
1896-
bank.bank_created();
1897-
18981866
bank.finish_init(
18991867
genesis_config,
19001868
additional_builtins,
@@ -3774,7 +3742,6 @@ impl Bank {
37743742
self.freeze_started.store(true, Relaxed);
37753743
*hash = self.hash_internal_state();
37763744
self.rc.accounts.accounts_db.mark_slot_frozen(self.slot());
3777-
self.bank_frozen_or_destroyed();
37783745
}
37793746
}
37803747

@@ -8333,7 +8300,6 @@ impl TotalAccountsStats {
83338300

83348301
impl Drop for Bank {
83358302
fn drop(&mut self) {
8336-
self.bank_frozen_or_destroyed();
83378303
if let Some(drop_callback) = self.drop_callback.read().unwrap().0.as_ref() {
83388304
drop_callback.callback(self);
83398305
} else {

runtime/src/bank_creation_freezing_progress.rs

Lines changed: 0 additions & 113 deletions
This file was deleted.

runtime/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ mod ancient_append_vecs;
2424
pub mod append_vec;
2525
pub mod bank;
2626
pub mod bank_client;
27-
mod bank_creation_freezing_progress;
2827
pub mod bank_forks;
2928
pub mod bank_utils;
3029
pub mod blockhash_queue;

0 commit comments

Comments
 (0)