Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,11 +1029,6 @@ impl AccountsDb {
let accounts_index_config = accounts_db_config.index.unwrap_or_default();
let accounts_index = AccountsIndex::new(&accounts_index_config, exit);

let bank_hash_details_dir = accounts_db_config.bank_hash_details_dir.unwrap_or_else(|| {
warn!("bank hash details dir is unset");
PathBuf::new()
});

let (paths, temp_paths) = if paths.is_empty() {
// Create a temporary set of accounts directories, used primarily
// for testing
Expand Down Expand Up @@ -1083,7 +1078,7 @@ impl AccountsDb {
let new = Self {
accounts_index,
paths,
bank_hash_details_dir,
bank_hash_details_dir: accounts_db_config.bank_hash_details_dir,
temp_paths,
shrink_paths,
skip_initial_hash_calc: accounts_db_config.skip_initial_hash_calc,
Expand Down
10 changes: 3 additions & 7 deletions accounts-db/src/accounts_db/accounts_db_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ use {
pub struct AccountsDbConfig {
pub index: Option<AccountsIndexConfig>,
pub account_indexes: Option<AccountSecondaryIndexes>,
// We need the Option wrapper until we're on Rust 1.91 or newer,
// because PathBuf::new() is non-const until then.
// For now, the only way for ACCOUNTS_DB_CONFIG_FOR_TESTING/BENCHMARKS
// to indicate they do not use bank_hash_details_dir is to use None.
pub bank_hash_details_dir: Option<PathBuf>,
pub bank_hash_details_dir: PathBuf,
pub shrink_paths: Option<Vec<PathBuf>>,
pub shrink_ratio: AccountShrinkThreshold,
/// The low and high watermark sizes for the read cache, in bytes.
Expand Down Expand Up @@ -57,7 +53,7 @@ pub struct AccountsDbConfig {
pub const ACCOUNTS_DB_CONFIG_FOR_TESTING: AccountsDbConfig = AccountsDbConfig {
index: Some(ACCOUNTS_INDEX_CONFIG_FOR_TESTING),
account_indexes: None,
bank_hash_details_dir: None, // tests don't use bank hash details
bank_hash_details_dir: PathBuf::new(), // tests don't use bank hash details
shrink_paths: None,
shrink_ratio: DEFAULT_ACCOUNTS_SHRINK_THRESHOLD_OPTION,
read_cache_limit_bytes: None,
Expand All @@ -80,7 +76,7 @@ pub const ACCOUNTS_DB_CONFIG_FOR_TESTING: AccountsDbConfig = AccountsDbConfig {
pub const ACCOUNTS_DB_CONFIG_FOR_BENCHMARKS: AccountsDbConfig = AccountsDbConfig {
index: Some(ACCOUNTS_INDEX_CONFIG_FOR_BENCHMARKS),
account_indexes: None,
bank_hash_details_dir: None, // benches don't use bank hash details
bank_hash_details_dir: PathBuf::new(), // benches don't use bank hash details
shrink_paths: None,
shrink_ratio: DEFAULT_ACCOUNTS_SHRINK_THRESHOLD_OPTION,
read_cache_limit_bytes: None,
Expand Down
2 changes: 1 addition & 1 deletion ledger-tool/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ pub fn get_accounts_db_config(

AccountsDbConfig {
index: Some(accounts_index_config),
bank_hash_details_dir: Some(ledger_tool_ledger_path),
bank_hash_details_dir: ledger_tool_ledger_path,
ancient_append_vec_offset: value_t!(arg_matches, "accounts_db_ancient_append_vecs", i64)
.ok(),
ancient_storage_ideal_size: value_t!(
Expand Down
2 changes: 1 addition & 1 deletion validator/src/commands/run/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ pub fn execute(
let accounts_db_config = AccountsDbConfig {
index: Some(accounts_index_config),
account_indexes: Some(account_indexes.clone()),
bank_hash_details_dir: Some(ledger_path.clone()),
bank_hash_details_dir: ledger_path.clone(),
shrink_paths: account_shrink_run_paths,
shrink_ratio,
read_cache_limit_bytes,
Expand Down
Loading