Removes epoch_accounts_hash featurization (#34417)

This commit is contained in:
Brooks 2023-12-13 15:30:39 -05:00 committed by GitHub
parent 2dfcdce630
commit 0b6d939e21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 26 deletions

View File

@ -32,7 +32,6 @@ use {
solana_sdk::{ solana_sdk::{
clock::Slot, clock::Slot,
epoch_schedule::EpochSchedule, epoch_schedule::EpochSchedule,
feature_set,
native_token::LAMPORTS_PER_SOL, native_token::LAMPORTS_PER_SOL,
pubkey::Pubkey, pubkey::Pubkey,
signature::{Keypair, Signer}, signature::{Keypair, Signer},
@ -145,9 +144,6 @@ impl TestEnvironment {
Arc::clone(&bank_forks), Arc::clone(&bank_forks),
); );
let bank = bank_forks.read().unwrap().working_bank(); 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)); assert!(epoch_accounts_hash_utils::is_enabled_this_epoch(&bank));
bank.set_startup_verification_complete(); bank.set_startup_verification_complete();

View File

@ -7013,13 +7013,6 @@ impl Bank {
/// The epoch accounts hash is hashed into the bank's hash once per epoch at a predefined slot. /// 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? /// Should it be included in *this* bank?
fn should_include_epoch_accounts_hash(&self) -> bool { 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) { if !epoch_accounts_hash_utils::is_enabled_this_epoch(self) {
return false; return false;
} }
@ -8089,10 +8082,7 @@ impl Bank {
/// EAH *must* be included. This means if an EAH calculation is currently in-flight we will /// EAH *must* be included. This means if an EAH calculation is currently in-flight we will
/// wait for it to complete. /// wait for it to complete.
pub fn get_epoch_accounts_hash_to_serialize(&self) -> Option<EpochAccountsHash> { pub fn get_epoch_accounts_hash_to_serialize(&self) -> Option<EpochAccountsHash> {
let should_get_epoch_accounts_hash = self let should_get_epoch_accounts_hash = epoch_accounts_hash_utils::is_enabled_this_epoch(self)
.feature_set
.is_active(&feature_set::epoch_accounts_hash::id())
&& epoch_accounts_hash_utils::is_enabled_this_epoch(self)
&& epoch_accounts_hash_utils::is_in_calculation_window(self); && epoch_accounts_hash_utils::is_in_calculation_window(self);
if !should_get_epoch_accounts_hash { if !should_get_epoch_accounts_hash {
return None; return None;

View File

@ -6,7 +6,7 @@ mod tests {
epoch_accounts_hash_utils, test_utils as bank_test_utils, Bank, BankTestConfig, epoch_accounts_hash_utils, test_utils as bank_test_utils, Bank, BankTestConfig,
EpochRewardStatus, StartBlockHeightAndRewards, EpochRewardStatus, StartBlockHeightAndRewards,
}, },
genesis_utils::{activate_all_features, activate_feature}, genesis_utils::activate_all_features,
runtime_config::RuntimeConfig, runtime_config::RuntimeConfig,
serde_snapshot::{ serde_snapshot::{
reserialize_bank_with_new_accounts_hash, BankIncrementalSnapshotPersistence, reserialize_bank_with_new_accounts_hash, BankIncrementalSnapshotPersistence,
@ -34,7 +34,6 @@ mod tests {
}, },
solana_sdk::{ solana_sdk::{
epoch_schedule::EpochSchedule, epoch_schedule::EpochSchedule,
feature_set,
genesis_config::create_genesis_config, genesis_config::create_genesis_config,
hash::Hash, hash::Hash,
pubkey::Pubkey, pubkey::Pubkey,
@ -100,7 +99,6 @@ mod tests {
) { ) {
solana_logger::setup(); solana_logger::setup();
let (mut genesis_config, _) = create_genesis_config(500); 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); genesis_config.epoch_schedule = EpochSchedule::custom(400, 400, false);
let bank0 = Arc::new(Bank::new_for_tests(&genesis_config)); let bank0 = Arc::new(Bank::new_for_tests(&genesis_config));
let eah_start_slot = epoch_accounts_hash_utils::calculation_start(&bank0); let eah_start_slot = epoch_accounts_hash_utils::calculation_start(&bank0);

View File

@ -14,7 +14,6 @@ use {
solana_program_runtime::loaded_programs::{BlockRelation, ForkGraph}, solana_program_runtime::loaded_programs::{BlockRelation, ForkGraph},
solana_sdk::{ solana_sdk::{
clock::{Epoch, Slot}, clock::{Epoch, Slot},
feature_set,
hash::Hash, hash::Hash,
timing, timing,
}, },
@ -678,13 +677,6 @@ impl BankForks {
/// Determine if this bank should request an epoch accounts hash /// Determine if this bank should request an epoch accounts hash
#[must_use] #[must_use]
fn should_request_epoch_accounts_hash(&self, bank: &Bank) -> bool { 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) { if !epoch_accounts_hash_utils::is_enabled_this_epoch(bank) {
return false; return false;
} }