Skip to content

Commit

Permalink
Removes epoch_accounts_hash featurization (solana-labs#34417)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Dec 13, 2023
1 parent 2dfcdce commit 0b6d939
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 26 deletions.
4 changes: 0 additions & 4 deletions core/tests/epoch_accounts_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use {
solana_sdk::{
clock::Slot,
epoch_schedule::EpochSchedule,
feature_set,
native_token::LAMPORTS_PER_SOL,
pubkey::Pubkey,
signature::{Keypair, Signer},
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 1 addition & 11 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions runtime/src/bank/serde_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -34,7 +34,6 @@ mod tests {
},
solana_sdk::{
epoch_schedule::EpochSchedule,
feature_set,
genesis_config::create_genesis_config,
hash::Hash,
pubkey::Pubkey,
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions runtime/src/bank_forks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use {
solana_program_runtime::loaded_programs::{BlockRelation, ForkGraph},
solana_sdk::{
clock::{Epoch, Slot},
feature_set,
hash::Hash,
timing,
},
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0b6d939

Please sign in to comment.