Skip to content

Commit

Permalink
Bank equality includes accounts lt hash (anza-xyz#3103)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored and ray-kast committed Nov 27, 2024
1 parent 8f776b7 commit 818fba1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: _,
Expand All @@ -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
Expand Down Expand Up @@ -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())
}
}

Expand Down

0 comments on commit 818fba1

Please sign in to comment.