Skip to content

Commit

Permalink
Tower loading doesn't need to be in new_banks_from_ledger
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Mar 14, 2022
1 parent 390dc24 commit 2e7ee0f
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,7 @@ impl Validator {
cache_block_meta_sender,
cache_block_meta_service,
},
tower,
) = new_banks_from_ledger(
&id,
vote_account,
config,
ledger_path,
&exit,
Expand All @@ -497,7 +494,7 @@ impl Validator {
});
}

post_process_restored_tower(restored_tower, &id, &vote_account, config, &bank_forks)
post_process_restored_tower(restored_tower, &id, vote_account, config, &bank_forks)
};
info!("Tower state: {:?}", tower);

Expand Down Expand Up @@ -1209,8 +1206,6 @@ fn post_process_restored_tower(

#[allow(clippy::type_complexity)]
fn new_banks_from_ledger(
validator_identity: &Pubkey,
vote_account: &Pubkey,
config: &ValidatorConfig,
ledger_path: &Path,
exit: &Arc<AtomicBool>,
Expand All @@ -1228,7 +1223,6 @@ fn new_banks_from_ledger(
Option<Slot>,
Option<StartingSnapshotHashes>,
TransactionHistoryServices,
Tower,
) {
info!("loading ledger from {:?}...", ledger_path);
*start_progress.write().unwrap() = ValidatorStartProgress::LoadingLedger;
Expand Down Expand Up @@ -1272,14 +1266,6 @@ fn new_banks_from_ledger(
.expect("Failed to open ledger database");
blockstore.set_no_compaction(config.no_rocksdb_compaction);

let restored_tower = Tower::restore(config.tower_storage.as_ref(), validator_identity);
if let Ok(tower) = &restored_tower {
reconcile_blockstore_roots_with_tower(tower, &blockstore).unwrap_or_else(|err| {
error!("Failed to reconcile blockstore with tower: {:?}", err);
abort()
});
}

let blockstore = Arc::new(blockstore);
let blockstore_root_scan = if config.rpc_addrs.is_some()
&& config.rpc_config.enable_rpc_transaction_history
Expand Down Expand Up @@ -1433,7 +1419,6 @@ fn new_banks_from_ledger(
last_full_snapshot_slot,
starting_snapshot_hashes,
transaction_history_services,
tower,
)
}

Expand Down

0 comments on commit 2e7ee0f

Please sign in to comment.