Account for possibility of cache flush in load() (#15454)
* Account for possibility of cache flush in load() * More cleaning * More cleaning * Remove unused method and some comment cleaning * Fix typo * Make the detected impossible purge race panic()! * Finally revert to original .expect() * Fix typos... * Add assertion for max_root for easier reasoning * Reframe races with LoadHint as possible opt. * Fix test * Make race bug tests run longer for less flaky * Delay the clone-in-lock slow path even for RPC * Make get_account panic-free & add its onchain ver. * Fix rebase conflicts... * Clean up * Clean up comment * Revert fn name change * Fix flaky test... * fmt... Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
use log::*;
|
||||
use rand::{thread_rng, Rng};
|
||||
use rayon::prelude::*;
|
||||
use solana_runtime::{accounts_db::AccountsDb, accounts_index::Ancestors};
|
||||
use solana_runtime::{
|
||||
accounts_db::{AccountsDb, LoadHint},
|
||||
accounts_index::Ancestors,
|
||||
};
|
||||
use solana_sdk::genesis_config::ClusterType;
|
||||
use solana_sdk::{account::AccountSharedData, clock::Slot, pubkey::Pubkey};
|
||||
use std::collections::HashSet;
|
||||
@@ -112,7 +115,8 @@ fn test_bad_bank_hash() {
|
||||
|
||||
for (key, account) in &account_refs {
|
||||
assert_eq!(
|
||||
db.load_account_hash(&ancestors, &key),
|
||||
db.load_account_hash(&ancestors, &key, None, LoadHint::Unspecified)
|
||||
.unwrap(),
|
||||
AccountsDb::hash_account(some_slot, &account, &key)
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user