From c7b643d5f0fc9b7a121fea49ebca587ed045799a Mon Sep 17 00:00:00 2001 From: Brooks Date: Mon, 7 Oct 2024 21:44:16 -0400 Subject: [PATCH] Bank equality includes accounts lt hash (#3103) --- runtime/src/bank.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index c617a652541b80..8b01326a44dd08 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -553,6 +553,7 @@ impl PartialEq for Bank { is_delta, #[cfg(feature = "dev-context-only-utils")] hash_overrides, + accounts_lt_hash, // TODO: Confirm if all these fields are intentionally ignored! rewards: _, cluster_type: _, @@ -577,7 +578,6 @@ impl PartialEq for Bank { compute_budget: _, transaction_account_lock_limit: _, fee_structure: _, - accounts_lt_hash: _, cache_for_accounts_lt_hash: _, // Ignore new fields explicitly if they do not impact PartialEq. // Adding ".." will remove compile-time checks that if a new field @@ -616,6 +616,8 @@ impl PartialEq for Bank { // different Mutexes. && (Arc::ptr_eq(hash_overrides, &other.hash_overrides) || *hash_overrides.lock().unwrap() == *other.hash_overrides.lock().unwrap()) + && !(self.is_accounts_lt_hash_enabled() && other.is_accounts_lt_hash_enabled() + && *accounts_lt_hash.lock().unwrap() != *other.accounts_lt_hash.lock().unwrap()) } }