Add struct BlockstoreOptions (#22121)

This commit is contained in:
Yueh-Hsuan Chiang
2022-01-03 18:30:45 -10:00
committed by GitHub
parent 33ad74fbcd
commit e8b7f96a89
7 changed files with 93 additions and 67 deletions

View File

@ -398,6 +398,7 @@ pub mod tests {
solana_gossip::cluster_info::{ClusterInfo, Node},
solana_ledger::{
blockstore::BlockstoreSignals,
blockstore_db::BlockstoreOptions,
create_new_tmp_ledger,
genesis_utils::{create_genesis_config, GenesisConfigInfo},
},
@ -438,7 +439,7 @@ pub mod tests {
blockstore,
ledger_signal_receiver,
..
} = Blockstore::open_with_signal(&blockstore_path, None, true)
} = Blockstore::open_with_signal(&blockstore_path, BlockstoreOptions::default())
.expect("Expected to successfully open ledger");
let blockstore = Arc::new(blockstore);
let bank = bank_forks.working_bank();

View File

@ -36,7 +36,7 @@ use {
solana_ledger::{
bank_forks_utils,
blockstore::{Blockstore, BlockstoreSignals, CompletedSlotsReceiver, PurgeType},
blockstore_db::BlockstoreRecoveryMode,
blockstore_db::{BlockstoreOptions, BlockstoreRecoveryMode},
blockstore_processor::{self, TransactionStatusSender},
leader_schedule::FixedSchedule,
leader_schedule_cache::LeaderScheduleCache,
@ -1265,8 +1265,11 @@ fn new_banks_from_ledger(
..
} = Blockstore::open_with_signal(
ledger_path,
config.wal_recovery_mode.clone(),
enforce_ulimit_nofile,
BlockstoreOptions {
recovery_mode: config.wal_recovery_mode.clone(),
enforce_ulimit_nofile,
..BlockstoreOptions::default()
},
)
.expect("Failed to open ledger database");
blockstore.set_no_compaction(config.no_rocksdb_compaction);