Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

v1.17: Fix non-determinism in account_hash_ignore_slot on genesis (backport of #33692) #33720

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3841,6 +3841,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(),
Expand Down