Skip to content

Commit

Permalink
add caching_enabled option to test-validator
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid authored and mvines committed Dec 15, 2021
1 parent ed924e3 commit 5fb7da1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test-validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 6 additions & 0 deletions validator/src/bin/solana-test-validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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()));

Expand Down

0 comments on commit 5fb7da1

Please sign in to comment.