Fix non-determinism in account_hash_ignore_slot on genesis (#33692)

This commit is contained in:
Jeff Washington (jwash) 2023-10-16 12:47:07 -07:00 committed by GitHub
parent d948e5bf69
commit 69495f4c13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -3837,6 +3837,16 @@ impl Bank {
// Bootstrap validator collects fees until `new_from_parent` is called.
self.fee_rate_governor = genesis_config.fee_rate_governor.clone();
// Make sure to activate the account_hash_ignore_slot feature
// before calculating any account hashes.
if genesis_config
.accounts
.iter()
.any(|(pubkey, _)| pubkey == &feature_set::account_hash_ignore_slot::id())
{
self.activate_feature(&feature_set::account_hash_ignore_slot::id());
}
for (pubkey, account) in genesis_config.accounts.iter() {
assert!(
self.get_account(pubkey).is_none(),