in testing, hash_internal_state ignores epoch_rewards_sysvar (#32122)

This commit is contained in:
Jeff Washington (jwash) 2023-06-14 12:57:29 -05:00 committed by GitHub
parent 9cf10b7aae
commit 4eb7db8737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -7293,11 +7293,18 @@ 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()
&& (self
.partitioned_epoch_rewards_config()
.test_enable_partitioned_rewards
&& self.get_reward_calculation_num_blocks() == 0
&& self.partitioned_rewards_stake_account_stores_per_block() == u64::MAX))
.then_some(sysvar::epoch_rewards::id());
let accounts_delta_hash = self
.rc
.accounts
.accounts_db
.calculate_accounts_delta_hash(slot);
.calculate_accounts_delta_hash_internal(slot, ignore);
let mut signature_count_buf = [0u8; 8];
LittleEndian::write_u64(&mut signature_count_buf[..], self.signature_count());