From 50a9bf80fc646fc046dd3adc29cd49830f5c9b3b Mon Sep 17 00:00:00 2001 From: jeff washington Date: Fri, 13 Oct 2023 10:17:51 -0500 Subject: [PATCH] Fix non-determinism in account_hash_ignore_slot on genesis --- runtime/src/bank.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 4bbd825579d0e7..c96c1c42fc597f 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -3833,6 +3833,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(),