Removes epoch_accounts_hash featurization (#34417)
This commit is contained in:
parent
2dfcdce630
commit
0b6d939e21
|
@ -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();
|
||||
|
|
|
@ -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<EpochAccountsHash> {
|
||||
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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue