Skip to content

Commit

Permalink
all TestValdiators act like validators (#23318)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Feb 24, 2022
1 parent 39c86c6 commit 2207e49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
20 changes: 7 additions & 13 deletions test-validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ pub struct TestValidatorGenesis {
pub accountsdb_plugin_config_files: Option<Vec<PathBuf>>,
pub accounts_db_caching_enabled: bool,
deactivate_feature_set: HashSet<Pubkey>,
pub started_from_validator: bool,
}

impl Default for TestValidatorGenesis {
Expand Down Expand Up @@ -137,7 +136,6 @@ impl Default for TestValidatorGenesis {
accountsdb_plugin_config_files: Option::<Vec<PathBuf>>::default(),
accounts_db_caching_enabled: bool::default(),
deactivate_feature_set: HashSet::<Pubkey>::default(),
started_from_validator: false,
}
}
}
Expand Down Expand Up @@ -658,17 +656,13 @@ impl TestValidator {
}
}

let accounts_db_config = if config.started_from_validator {
Some(AccountsDbConfig {
index: Some(AccountsIndexConfig {
started_from_validator: config.started_from_validator,
..AccountsIndexConfig::default()
}),
..AccountsDbConfig::default()
})
} else {
None
};
let accounts_db_config = Some(AccountsDbConfig {
index: Some(AccountsIndexConfig {
started_from_validator: true,
..AccountsIndexConfig::default()
}),
..AccountsDbConfig::default()
});

let mut validator_config = ValidatorConfig {
accountsdb_plugin_config_files: config.accountsdb_plugin_config_files.clone(),
Expand Down
2 changes: 0 additions & 2 deletions validator/src/bin/solana-test-validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,6 @@ fn main() {
}

let mut genesis = TestValidatorGenesis::default();
// this startup path should act like we started from a validator
genesis.started_from_validator = true;
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");
Expand Down

0 comments on commit 2207e49

Please sign in to comment.