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

Ensures duplicates_lt_hash is Some if accounts lt hash is enabled #3534

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

brooksprumo
Copy link

Problem

At startup, if we're using accounts lt hash, then generate_index() is tasked with finding the duplicate accounts and tracking them. This value is used later when verifying accounts.

However, if there are no duplicates, the value (since it is an Option), is returned as None. And then verify_accounts sees the None and concludes "since this value is None, I should not do lattice-based accounts verification, and instead use the original merkle-based accounts verification".

This is wrong. Even if there are no duplicates, generate_index() must always return Some when accounts lt hash is enabled.

Summary of Changes

Ensure duplicates is always Some when accounts lt hash is enabled.

@brooksprumo brooksprumo self-assigned this Nov 7, 2024
@brooksprumo brooksprumo changed the title Ensures duplicates_lt_hash is always Some when accounts lt hash is enabled Ensures duplicates_lt_hash is Some when accounts lt hash is enabled Nov 7, 2024
@brooksprumo brooksprumo changed the title Ensures duplicates_lt_hash is Some when accounts lt hash is enabled Ensures duplicates_lt_hash is Some if accounts lt hash is enabled Nov 7, 2024
@brooksprumo brooksprumo marked this pull request as ready for review November 8, 2024 02:02
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.

lgtm.

@brooksprumo brooksprumo merged commit 7a720d9 into anza-xyz:master Nov 8, 2024
40 checks passed
@brooksprumo brooksprumo deleted the lthash/duplicates branch November 8, 2024 15:14
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