Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Fix bootstrap without known validators #25293

Merged
merged 1 commit into from
May 18, 2022
Merged
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
15 changes: 8 additions & 7 deletions validator/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,14 +1114,15 @@ mod with_incremental_snapshots {
validator_config: &ValidatorConfig,
rpc_peers: &[ContactInfo],
) -> Vec<PeerSnapshotHash> {
let known_snapshot_hashes =
get_snapshot_hashes_from_known_validators(cluster_info, validator_config);

let mut peer_snapshot_hashes = get_eligible_peer_snapshot_hashes(cluster_info, rpc_peers);
retain_peer_snapshot_hashes_that_match_known_snapshot_hashes(
&known_snapshot_hashes,
&mut peer_snapshot_hashes,
);
if validator_config.known_validators.is_some() {
let known_snapshot_hashes =
get_snapshot_hashes_from_known_validators(cluster_info, validator_config);
retain_peer_snapshot_hashes_that_match_known_snapshot_hashes(
&known_snapshot_hashes,
&mut peer_snapshot_hashes,
);
}
retain_peer_snapshot_hashes_with_highest_full_snapshot_slot(&mut peer_snapshot_hashes);
retain_peer_snapshot_hashes_with_highest_incremental_snapshot_slot(
&mut peer_snapshot_hashes,
Expand Down