Skip to content

Commit

Permalink
Fix non-determinism in account_hash_ignore_slot on genesis (#33692)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Oct 16, 2023
1 parent d948e5b commit 69495f4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 69495f4

Please sign in to comment.