Skip to content

Updates test_bank_hash_internal_state_verify() for accounts lt hash#3291

Merged
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:lthash/test-hash-internal-state-verify
Oct 23, 2024
Merged

Updates test_bank_hash_internal_state_verify() for accounts lt hash#3291
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:lthash/test-hash-internal-state-verify

Conversation

@brooksprumo
Copy link
Copy Markdown

Problem

When adding feature gate logic for accounts lt hash and mixing it into the bank hash, the test_bank_hash_internal_state_verify test failed. This is because it wasn't always freezing the bank before calling hash_internal_state().

There's also an issue with the test in general that is roots slots on two different forks, which is not valid. I put more comments in the code that discuss the issue.

This test was first added here: solana-labs#5573
And the invalid bank3 part was originally added here: solana-labs#7892

Back then we didn't call verify_accounts_hash() at all (maybe didn't exist?), and so we didn't need to root the slots either. This meant we weren't creating an invalid fork graph. But ultimately I'm not really sure what value this test is adding over the other test_bank_hash_internal_state() tests. Maybe one could argue that this test ensures freezing bank2 doesn't impact bank3's hash/state? I could see making an argument to remove this test entirely, but that's beyond the scope of this PR.

Summary of Changes

Update the test so that it works with the non-featurized accounts lt hash code, so that when we add the featurization code, this test won't need to change (or will have minimal changes).

@brooksprumo brooksprumo self-assigned this Oct 23, 2024
@brooksprumo brooksprumo force-pushed the lthash/test-hash-internal-state-verify branch from 8f5b428 to f680ce5 Compare October 23, 2024 18:52
@brooksprumo brooksprumo marked this pull request as ready for review October 23, 2024 19:40
Copy link
Copy Markdown

@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
Copy Markdown

@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.

seems like a more correct update for the test.
lgtm.

@brooksprumo brooksprumo merged commit b5aa45f into anza-xyz:master Oct 23, 2024
@brooksprumo brooksprumo deleted the lthash/test-hash-internal-state-verify branch October 23, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants