Removes checks for bank_hash_stats in test #30480
Merged
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
AccountsDb::bank_hash_stats
is a map ofSlot
->BankHashStats
. These stats are somewhat special, in that a default value is inserted into the map whenever a new bank is created (from parent). We also have a redundant insert-default wheneverstore()
is called. And lastly new AccountsDb's will insert a default value at slot 0 too. This pre-usage insert-default-value behavior has one potential use: logging an error if a new bank was created with the same slot as a pre-existing one. To check for that case,bank_hash_stats
is consulted. This case can happen in unusual forking, and is present in the local-clustertest_optimistic_confirmation_violation_detection
test.Looking up the bank_hash_stats is used in
test_handle_dropped_roots_for_ancient()
as a way to check if the slot is present or not. The test has other checks to see if the root is dropped, and the bank_hash_stats is not needed here. By using bank_hash_stats, it prevents removing the pre-usage insert-default-value behavior.(The longer story is that these stats are also stored in snapshots, even though they aren't even used/needed, and I'd like to remove them there also. Incremental changes though!)
Summary of Changes
Remove the calls to
get_bank_hash_stats()
insidetest_handle_dropped_roots_for_ancient()
, which already has other way to assert its invariants.