Tower loading doesn't need to be in new_banks_from_ledger
This commit is contained in:
parent
390dc24608
commit
2e7ee0f177
|
@ -475,10 +475,7 @@ impl Validator {
|
||||||
cache_block_meta_sender,
|
cache_block_meta_sender,
|
||||||
cache_block_meta_service,
|
cache_block_meta_service,
|
||||||
},
|
},
|
||||||
tower,
|
|
||||||
) = new_banks_from_ledger(
|
) = new_banks_from_ledger(
|
||||||
&id,
|
|
||||||
vote_account,
|
|
||||||
config,
|
config,
|
||||||
ledger_path,
|
ledger_path,
|
||||||
&exit,
|
&exit,
|
||||||
|
@ -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);
|
info!("Tower state: {:?}", tower);
|
||||||
|
|
||||||
|
@ -1209,8 +1206,6 @@ fn post_process_restored_tower(
|
||||||
|
|
||||||
#[allow(clippy::type_complexity)]
|
#[allow(clippy::type_complexity)]
|
||||||
fn new_banks_from_ledger(
|
fn new_banks_from_ledger(
|
||||||
validator_identity: &Pubkey,
|
|
||||||
vote_account: &Pubkey,
|
|
||||||
config: &ValidatorConfig,
|
config: &ValidatorConfig,
|
||||||
ledger_path: &Path,
|
ledger_path: &Path,
|
||||||
exit: &Arc<AtomicBool>,
|
exit: &Arc<AtomicBool>,
|
||||||
|
@ -1228,7 +1223,6 @@ fn new_banks_from_ledger(
|
||||||
Option<Slot>,
|
Option<Slot>,
|
||||||
Option<StartingSnapshotHashes>,
|
Option<StartingSnapshotHashes>,
|
||||||
TransactionHistoryServices,
|
TransactionHistoryServices,
|
||||||
Tower,
|
|
||||||
) {
|
) {
|
||||||
info!("loading ledger from {:?}...", ledger_path);
|
info!("loading ledger from {:?}...", ledger_path);
|
||||||
*start_progress.write().unwrap() = ValidatorStartProgress::LoadingLedger;
|
*start_progress.write().unwrap() = ValidatorStartProgress::LoadingLedger;
|
||||||
|
@ -1272,14 +1266,6 @@ fn new_banks_from_ledger(
|
||||||
.expect("Failed to open ledger database");
|
.expect("Failed to open ledger database");
|
||||||
blockstore.set_no_compaction(config.no_rocksdb_compaction);
|
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 = Arc::new(blockstore);
|
||||||
let blockstore_root_scan = if config.rpc_addrs.is_some()
|
let blockstore_root_scan = if config.rpc_addrs.is_some()
|
||||||
&& config.rpc_config.enable_rpc_transaction_history
|
&& config.rpc_config.enable_rpc_transaction_history
|
||||||
|
@ -1433,7 +1419,6 @@ fn new_banks_from_ledger(
|
||||||
last_full_snapshot_slot,
|
last_full_snapshot_slot,
|
||||||
starting_snapshot_hashes,
|
starting_snapshot_hashes,
|
||||||
transaction_history_services,
|
transaction_history_services,
|
||||||
tower,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue