Ran cargo fmt
This commit is contained in:
parent
4dfeab3b38
commit
9052e41b32
|
@ -15,9 +15,7 @@ use {
|
||||||
ancestors::Ancestors,
|
ancestors::Ancestors,
|
||||||
rent_collector::RentCollector,
|
rent_collector::RentCollector,
|
||||||
},
|
},
|
||||||
solana_sdk::{
|
solana_sdk::{genesis_config::ClusterType, pubkey::Pubkey},
|
||||||
genesis_config::ClusterType, pubkey::Pubkey,
|
|
||||||
},
|
|
||||||
std::{env, fs, path::PathBuf},
|
std::{env, fs, path::PathBuf},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,11 +118,10 @@ fn main() {
|
||||||
} else {
|
} else {
|
||||||
let mut pubkeys: Vec<Pubkey> = vec![];
|
let mut pubkeys: Vec<Pubkey> = vec![];
|
||||||
let mut time = Measure::start("hash");
|
let mut time = Measure::start("hash");
|
||||||
let results = accounts.accounts_db.update_accounts_hash(
|
let results =
|
||||||
0,
|
accounts
|
||||||
&ancestors,
|
.accounts_db
|
||||||
&RentCollector::default(),
|
.update_accounts_hash(0, &ancestors, &RentCollector::default());
|
||||||
);
|
|
||||||
time.stop();
|
time.stop();
|
||||||
let mut time_store = Measure::start("hash using store");
|
let mut time_store = Measure::start("hash using store");
|
||||||
let results_store = accounts.accounts_db.update_accounts_hash_with_index_option(
|
let results_store = accounts.accounts_db.update_accounts_hash_with_index_option(
|
||||||
|
|
|
@ -108,11 +108,10 @@ fn test_accounts_hash_bank_hash(bencher: &mut Bencher) {
|
||||||
let slot = 0;
|
let slot = 0;
|
||||||
create_test_accounts(&accounts, &mut pubkeys, num_accounts, slot);
|
create_test_accounts(&accounts, &mut pubkeys, num_accounts, slot);
|
||||||
let ancestors = Ancestors::from(vec![0]);
|
let ancestors = Ancestors::from(vec![0]);
|
||||||
let (_, total_lamports) = accounts.accounts_db.update_accounts_hash(
|
let (_, total_lamports) =
|
||||||
0,
|
accounts
|
||||||
&ancestors,
|
.accounts_db
|
||||||
&RentCollector::default(),
|
.update_accounts_hash(0, &ancestors, &RentCollector::default());
|
||||||
);
|
|
||||||
let test_hash_calculation = false;
|
let test_hash_calculation = false;
|
||||||
bencher.iter(|| {
|
bencher.iter(|| {
|
||||||
assert!(accounts.verify_bank_hash_and_lamports(
|
assert!(accounts.verify_bank_hash_and_lamports(
|
||||||
|
@ -139,11 +138,9 @@ fn test_update_accounts_hash(bencher: &mut Bencher) {
|
||||||
create_test_accounts(&accounts, &mut pubkeys, 50_000, 0);
|
create_test_accounts(&accounts, &mut pubkeys, 50_000, 0);
|
||||||
let ancestors = Ancestors::from(vec![0]);
|
let ancestors = Ancestors::from(vec![0]);
|
||||||
bencher.iter(|| {
|
bencher.iter(|| {
|
||||||
accounts.accounts_db.update_accounts_hash(
|
accounts
|
||||||
0,
|
.accounts_db
|
||||||
&ancestors,
|
.update_accounts_hash(0, &ancestors, &RentCollector::default());
|
||||||
&RentCollector::default(),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5551,7 +5551,10 @@ impl AccountsDb {
|
||||||
Some(slot),
|
Some(slot),
|
||||||
);
|
);
|
||||||
|
|
||||||
self.mark_old_slots_as_dirty(&storages, Some(config.rent_collector.epoch_schedule.slots_per_epoch));
|
self.mark_old_slots_as_dirty(
|
||||||
|
&storages,
|
||||||
|
Some(config.rent_collector.epoch_schedule.slots_per_epoch),
|
||||||
|
);
|
||||||
sort_time.stop();
|
sort_time.stop();
|
||||||
|
|
||||||
let mut timings = HashStats {
|
let mut timings = HashStats {
|
||||||
|
@ -9465,16 +9468,8 @@ pub mod tests {
|
||||||
|
|
||||||
let ancestors = linear_ancestors(latest_slot);
|
let ancestors = linear_ancestors(latest_slot);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
daccounts.update_accounts_hash(
|
daccounts.update_accounts_hash(latest_slot, &ancestors, &RentCollector::default()),
|
||||||
latest_slot,
|
accounts.update_accounts_hash(latest_slot, &ancestors, &RentCollector::default())
|
||||||
&ancestors,
|
|
||||||
&RentCollector::default()
|
|
||||||
),
|
|
||||||
accounts.update_accounts_hash(
|
|
||||||
latest_slot,
|
|
||||||
&ancestors,
|
|
||||||
&RentCollector::default()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9753,11 +9748,7 @@ pub mod tests {
|
||||||
accounts.add_root(current_slot);
|
accounts.add_root(current_slot);
|
||||||
|
|
||||||
accounts.print_accounts_stats("pre_f");
|
accounts.print_accounts_stats("pre_f");
|
||||||
accounts.update_accounts_hash(
|
accounts.update_accounts_hash(4, &Ancestors::default(), &RentCollector::default());
|
||||||
4,
|
|
||||||
&Ancestors::default(),
|
|
||||||
&RentCollector::default(),
|
|
||||||
);
|
|
||||||
|
|
||||||
let accounts = f(accounts, current_slot);
|
let accounts = f(accounts, current_slot);
|
||||||
|
|
||||||
|
@ -10908,11 +10899,7 @@ pub mod tests {
|
||||||
);
|
);
|
||||||
|
|
||||||
let no_ancestors = Ancestors::default();
|
let no_ancestors = Ancestors::default();
|
||||||
accounts.update_accounts_hash(
|
accounts.update_accounts_hash(current_slot, &no_ancestors, &RentCollector::default());
|
||||||
current_slot,
|
|
||||||
&no_ancestors,
|
|
||||||
&RentCollector::default(),
|
|
||||||
);
|
|
||||||
accounts
|
accounts
|
||||||
.verify_bank_hash_and_lamports(
|
.verify_bank_hash_and_lamports(
|
||||||
current_slot,
|
current_slot,
|
||||||
|
|
|
@ -11,9 +11,7 @@ use {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
log::*,
|
log::*,
|
||||||
solana_sdk::{
|
solana_sdk::{clock::Slot, genesis_config::ClusterType, hash::Hash},
|
||||||
clock::Slot, genesis_config::ClusterType, hash::Hash,
|
|
||||||
},
|
|
||||||
std::{
|
std::{
|
||||||
fs,
|
fs,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
|
|
Loading…
Reference in New Issue