Rename new_banks_from_blockstore => new_banks_from_ledger (#10864)

This commit is contained in:
Ryo Onodera
2020-07-01 15:19:40 +09:00
committed by GitHub
parent d97850f1d9
commit ecf6fb2cd2
2 changed files with 8 additions and 11 deletions

View File

@ -321,7 +321,7 @@ impl Tower {
} }
#[cfg(test)] #[cfg(test)]
pub fn record_vote(&mut self, slot: Slot, hash: Hash) -> Option<Slot> { fn record_vote(&mut self, slot: Slot, hash: Hash) -> Option<Slot> {
let vote = Vote::new(vec![slot], hash); let vote = Vote::new(vec![slot], hash);
self.record_bank_vote(vote) self.record_bank_vote(vote)
} }

View File

@ -204,7 +204,7 @@ impl Validator {
completed_slots_receiver, completed_slots_receiver,
leader_schedule_cache, leader_schedule_cache,
snapshot_hash, snapshot_hash,
) = new_banks_from_blockstore(config, ledger_path, poh_verify); ) = new_banks_from_ledger(config, ledger_path, poh_verify);
let leader_schedule_cache = Arc::new(leader_schedule_cache); let leader_schedule_cache = Arc::new(leader_schedule_cache);
let bank = bank_forks.working_bank(); let bank = bank_forks.working_bank();
@ -565,9 +565,9 @@ impl Validator {
} }
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
fn new_banks_from_blockstore( fn new_banks_from_ledger(
config: &ValidatorConfig, config: &ValidatorConfig,
blockstore_path: &Path, ledger_path: &Path,
poh_verify: bool, poh_verify: bool,
) -> ( ) -> (
GenesisConfig, GenesisConfig,
@ -578,8 +578,8 @@ fn new_banks_from_blockstore(
LeaderScheduleCache, LeaderScheduleCache,
Option<(Slot, Hash)>, Option<(Slot, Hash)>,
) { ) {
let genesis_config = info!("loading ledger from {:?}...", ledger_path);
open_genesis_config(blockstore_path, config.max_genesis_archive_unpacked_size); let genesis_config = open_genesis_config(ledger_path, config.max_genesis_archive_unpacked_size);
// This needs to be limited otherwise the state in the VoteAccount data // This needs to be limited otherwise the state in the VoteAccount data
// grows too large // grows too large
@ -594,16 +594,13 @@ fn new_banks_from_blockstore(
if let Some(expected_genesis_hash) = config.expected_genesis_hash { if let Some(expected_genesis_hash) = config.expected_genesis_hash {
if genesis_hash != expected_genesis_hash { if genesis_hash != expected_genesis_hash {
error!("genesis hash mismatch: expected {}", expected_genesis_hash); error!("genesis hash mismatch: expected {}", expected_genesis_hash);
error!( error!("Delete the ledger directory to continue: {:?}", ledger_path);
"Delete the ledger directory to continue: {:?}",
blockstore_path
);
process::exit(1); process::exit(1);
} }
} }
let (mut blockstore, ledger_signal_receiver, completed_slots_receiver) = let (mut blockstore, ledger_signal_receiver, completed_slots_receiver) =
Blockstore::open_with_signal(blockstore_path).expect("Failed to open ledger database"); Blockstore::open_with_signal(ledger_path).expect("Failed to open ledger database");
blockstore.set_no_compaction(config.no_rocksdb_compaction); blockstore.set_no_compaction(config.no_rocksdb_compaction);
let process_options = blockstore_processor::ProcessOptions { let process_options = blockstore_processor::ProcessOptions {