Cache account stores, flush from AccountsBackgroundService (#13140)

This commit is contained in:
carllin
2021-01-11 17:00:23 -08:00
committed by GitHub
parent 4a66e3eddc
commit 6dfad0652f
25 changed files with 2604 additions and 833 deletions

View File

@ -78,6 +78,7 @@ pub struct TvuConfig {
pub trusted_validators: Option<HashSet<Pubkey>>,
pub repair_validators: Option<HashSet<Pubkey>>,
pub accounts_hash_fault_injection_slots: u64,
pub accounts_db_caching_enabled: bool,
}
impl Tvu {
@ -272,6 +273,7 @@ impl Tvu {
bank_forks.clone(),
&exit,
accounts_background_request_handler,
tvu_config.accounts_db_caching_enabled,
);
Tvu {

View File

@ -119,6 +119,7 @@ pub struct ValidatorConfig {
pub no_poh_speed_test: bool,
pub poh_pinned_cpu_core: usize,
pub account_indexes: HashSet<AccountIndex>,
pub accounts_db_caching_enabled: bool,
}
impl Default for ValidatorConfig {
@ -164,6 +165,7 @@ impl Default for ValidatorConfig {
no_poh_speed_test: true,
poh_pinned_cpu_core: poh_service::DEFAULT_PINNED_CPU_CORE,
account_indexes: HashSet::new(),
accounts_db_caching_enabled: false,
}
}
}
@ -629,6 +631,7 @@ impl Validator {
trusted_validators: config.trusted_validators.clone(),
repair_validators: config.repair_validators.clone(),
accounts_hash_fault_injection_slots: config.accounts_hash_fault_injection_slots,
accounts_db_caching_enabled: config.accounts_db_caching_enabled,
},
);
@ -960,6 +963,7 @@ fn new_banks_from_ledger(
frozen_accounts: config.frozen_accounts.clone(),
debug_keys: config.debug_keys.clone(),
account_indexes: config.account_indexes.clone(),
accounts_db_caching_enabled: config.accounts_db_caching_enabled,
..blockstore_processor::ProcessOptions::default()
};