Add snapshot hash of full accounts state (#8295)
* Add snapshot hash of full accounts state * Use normal hashing for the accounts delta state * Add merkle
This commit is contained in:
@ -72,5 +72,29 @@ fn test_accounts_hash_bank_hash(bencher: &mut Bencher) {
|
||||
let mut pubkeys: Vec<Pubkey> = vec![];
|
||||
create_test_accounts(&accounts, &mut pubkeys, 60000, 0);
|
||||
let ancestors = vec![(0, 0)].into_iter().collect();
|
||||
accounts.accounts_db.update_accounts_hash(0, &ancestors);
|
||||
bencher.iter(|| assert!(accounts.verify_bank_hash(0, &ancestors)));
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn test_update_accounts_hash(bencher: &mut Bencher) {
|
||||
solana_logger::setup();
|
||||
let accounts = Accounts::new(vec![PathBuf::from("update_accounts_hash")]);
|
||||
let mut pubkeys: Vec<Pubkey> = vec![];
|
||||
create_test_accounts(&accounts, &mut pubkeys, 50_000, 0);
|
||||
let ancestors = vec![(0, 0)].into_iter().collect();
|
||||
bencher.iter(|| {
|
||||
accounts.accounts_db.update_accounts_hash(0, &ancestors);
|
||||
});
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn test_accounts_delta_hash(bencher: &mut Bencher) {
|
||||
solana_logger::setup();
|
||||
let accounts = Accounts::new(vec![PathBuf::from("accounts_delta_hash")]);
|
||||
let mut pubkeys: Vec<Pubkey> = vec![];
|
||||
create_test_accounts(&accounts, &mut pubkeys, 100_000, 0);
|
||||
bencher.iter(|| {
|
||||
accounts.accounts_db.get_accounts_delta_hash(0);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user