add caching_enabled option to test-validator

This commit is contained in:
Kirill Fomichev 2021-12-15 08:17:22 +02:00 committed by Michael Vines
parent ed924e3bc4
commit 5fb7da12f2
2 changed files with 8 additions and 0 deletions

View File

@ -104,6 +104,7 @@ pub struct TestValidatorGenesis {
pub max_ledger_shreds: Option<u64>,
pub max_genesis_archive_unpacked_size: Option<u64>,
pub accountsdb_plugin_config_files: Option<Vec<PathBuf>>,
pub accounts_db_caching_enabled: bool,
}
impl TestValidatorGenesis {
@ -556,6 +557,7 @@ impl TestValidator {
let mut validator_config = ValidatorConfig {
accountsdb_plugin_config_files: config.accountsdb_plugin_config_files.clone(),
accounts_db_caching_enabled: config.accounts_db_caching_enabled,
rpc_addrs: Some((
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), node.info.rpc.port()),
SocketAddr::new(

View File

@ -305,6 +305,11 @@ fn main() {
.hidden(true)
.help("Specify the configuration file for the AccountsDb plugin."),
)
.arg(
Arg::with_name("no_accounts_db_caching")
.long("no-accounts-db-caching")
.help("Disables accounts caching"),
)
.get_matches();
let output = if matches.is_present("quiet") {
@ -550,6 +555,7 @@ fn main() {
let mut genesis = TestValidatorGenesis::default();
genesis.max_ledger_shreds = value_of(&matches, "limit_ledger_size");
genesis.max_genesis_archive_unpacked_size = Some(u64::MAX);
genesis.accounts_db_caching_enabled = !matches.is_present("no_accounts_db_caching");
let tower_storage = Arc::new(FileTowerStorage::new(ledger_path.clone()));