Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bank equality includes accounts lt hash #3103

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

brooksprumo
Copy link

Problem

Banks can compare equal even if their accounts lt hashes are different.

Summary of Changes

Check accounts lt hash when comparing banks.

@brooksprumo brooksprumo self-assigned this Oct 7, 2024
Comment on lines +619 to +620
&& !(self.is_accounts_lt_hash_enabled() && other.is_accounts_lt_hash_enabled()
&& *accounts_lt_hash.lock().unwrap() != *other.accounts_lt_hash.lock().unwrap())
Copy link
Author

@brooksprumo brooksprumo Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only time the accounts lt hashes compare false is when

  • both banks have the accounts lt hash enabled
  • and the values of the accounts lt hashes are different

all other cases return true. (e.g. one or both banks have the accounts lt hash disabled.)

@brooksprumo brooksprumo marked this pull request as ready for review October 7, 2024 22:01
Copy link

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks logically correct to me.

@brooksprumo brooksprumo merged commit c7b643d into anza-xyz:master Oct 8, 2024
38 checks passed
@brooksprumo brooksprumo deleted the lthash/2 branch October 8, 2024 01:44
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants