From 0b6d939e21926c8e9cb2e071c40f4c2dd6af0472 Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 13 Dec 2023 15:30:39 -0500 Subject: [PATCH] Removes epoch_accounts_hash featurization (#34417) --- core/tests/epoch_accounts_hash.rs | 4 ---- runtime/src/bank.rs | 12 +----------- runtime/src/bank/serde_snapshot.rs | 4 +--- runtime/src/bank_forks.rs | 8 -------- 4 files changed, 2 insertions(+), 26 deletions(-) diff --git a/core/tests/epoch_accounts_hash.rs b/core/tests/epoch_accounts_hash.rs index 2ee63e6ef68708..f0fdad6cf5c561 100755 --- a/core/tests/epoch_accounts_hash.rs +++ b/core/tests/epoch_accounts_hash.rs @@ -32,7 +32,6 @@ use { solana_sdk::{ clock::Slot, epoch_schedule::EpochSchedule, - feature_set, native_token::LAMPORTS_PER_SOL, pubkey::Pubkey, signature::{Keypair, Signer}, @@ -145,9 +144,6 @@ impl TestEnvironment { Arc::clone(&bank_forks), ); let bank = bank_forks.read().unwrap().working_bank(); - assert!(bank - .feature_set - .is_active(&feature_set::epoch_accounts_hash::id())); assert!(epoch_accounts_hash_utils::is_enabled_this_epoch(&bank)); bank.set_startup_verification_complete(); diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 72d564ed68685f..b9231db8f9918b 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -7013,13 +7013,6 @@ impl Bank { /// The epoch accounts hash is hashed into the bank's hash once per epoch at a predefined slot. /// Should it be included in *this* bank? fn should_include_epoch_accounts_hash(&self) -> bool { - if !self - .feature_set - .is_active(&feature_set::epoch_accounts_hash::id()) - { - return false; - } - if !epoch_accounts_hash_utils::is_enabled_this_epoch(self) { return false; } @@ -8089,10 +8082,7 @@ impl Bank { /// EAH *must* be included. This means if an EAH calculation is currently in-flight we will /// wait for it to complete. pub fn get_epoch_accounts_hash_to_serialize(&self) -> Option { - let should_get_epoch_accounts_hash = self - .feature_set - .is_active(&feature_set::epoch_accounts_hash::id()) - && epoch_accounts_hash_utils::is_enabled_this_epoch(self) + let should_get_epoch_accounts_hash = epoch_accounts_hash_utils::is_enabled_this_epoch(self) && epoch_accounts_hash_utils::is_in_calculation_window(self); if !should_get_epoch_accounts_hash { return None; diff --git a/runtime/src/bank/serde_snapshot.rs b/runtime/src/bank/serde_snapshot.rs index e1746c52b79f75..9c7ad83b5fd778 100644 --- a/runtime/src/bank/serde_snapshot.rs +++ b/runtime/src/bank/serde_snapshot.rs @@ -6,7 +6,7 @@ mod tests { epoch_accounts_hash_utils, test_utils as bank_test_utils, Bank, BankTestConfig, EpochRewardStatus, StartBlockHeightAndRewards, }, - genesis_utils::{activate_all_features, activate_feature}, + genesis_utils::activate_all_features, runtime_config::RuntimeConfig, serde_snapshot::{ reserialize_bank_with_new_accounts_hash, BankIncrementalSnapshotPersistence, @@ -34,7 +34,6 @@ mod tests { }, solana_sdk::{ epoch_schedule::EpochSchedule, - feature_set, genesis_config::create_genesis_config, hash::Hash, pubkey::Pubkey, @@ -100,7 +99,6 @@ mod tests { ) { solana_logger::setup(); let (mut genesis_config, _) = create_genesis_config(500); - activate_feature(&mut genesis_config, feature_set::epoch_accounts_hash::id()); genesis_config.epoch_schedule = EpochSchedule::custom(400, 400, false); let bank0 = Arc::new(Bank::new_for_tests(&genesis_config)); let eah_start_slot = epoch_accounts_hash_utils::calculation_start(&bank0); diff --git a/runtime/src/bank_forks.rs b/runtime/src/bank_forks.rs index dabd90e4c2c835..7e06375ec69fe9 100644 --- a/runtime/src/bank_forks.rs +++ b/runtime/src/bank_forks.rs @@ -14,7 +14,6 @@ use { solana_program_runtime::loaded_programs::{BlockRelation, ForkGraph}, solana_sdk::{ clock::{Epoch, Slot}, - feature_set, hash::Hash, timing, }, @@ -678,13 +677,6 @@ impl BankForks { /// Determine if this bank should request an epoch accounts hash #[must_use] fn should_request_epoch_accounts_hash(&self, bank: &Bank) -> bool { - if !bank - .feature_set - .is_active(&feature_set::epoch_accounts_hash::id()) - { - return false; - } - if !epoch_accounts_hash_utils::is_enabled_this_epoch(bank) { return false; }