Updates test_bank_hash_internal_state_verify() for accounts lt hash#3291
Merged
brooksprumo merged 1 commit intoanza-xyz:masterfrom Oct 23, 2024
Merged
Conversation
original pr: solana-labs#5573 pr that added bank3: solana-labs#7892
8f5b428 to
f680ce5
Compare
HaoranYi
approved these changes
Oct 23, 2024
HaoranYi
left a comment
There was a problem hiding this comment.
seems like a more correct update for the test.
lgtm.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When adding feature gate logic for accounts lt hash and mixing it into the bank hash, the
test_bank_hash_internal_state_verifytest failed. This is because it wasn't always freezing the bank before callinghash_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 othertest_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).