add is_partitioned_rewards_code_enabled (#32123)

* add partitioned_rewards_code_enabled

* renames
This commit is contained in:
Jeff Washington (jwash) 2023-06-14 14:36:53 -05:00 committed by GitHub
parent e83a06d85e
commit 088ac5ec01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -1491,7 +1491,7 @@ impl Bank {
}
#[allow(dead_code)]
fn partitioned_rewards_feature_enabled(&self) -> bool {
fn is_partitioned_rewards_feature_enabled(&self) -> bool {
false // Will be feature later. It is convenient to have a constant fn at the moment.
}
@ -3889,6 +3889,16 @@ impl Bank {
report_partitioned_reward_metrics(self, metrics);
}
#[allow(dead_code)]
/// true if it is ok to run partitioned rewards code.
/// This means the feature is activated or certain testing situations.
fn is_partitioned_rewards_code_enabled(&self) -> bool {
self.is_partitioned_rewards_feature_enabled()
|| self
.partitioned_epoch_rewards_config()
.test_enable_partitioned_rewards
}
fn update_recent_blockhashes_locked(&self, locked_blockhash_queue: &BlockhashQueue) {
#[allow(deprecated)]
self.update_sysvar_account(&sysvar::recent_blockhashes::id(), |account| {
@ -7330,7 +7340,7 @@ impl Bank {
/// of the delta of the ledger since the last vote and up to now
fn hash_internal_state(&self) -> Hash {
let slot = self.slot();
let ignore = (!self.partitioned_rewards_feature_enabled()
let ignore = (!self.is_partitioned_rewards_feature_enabled()
&& (self
.partitioned_epoch_rewards_config()
.test_enable_partitioned_rewards