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

Commit

Permalink
Fix bootstrap without known validators (backport #25293) (#25318)
Browse files Browse the repository at this point in the history
* fix bootstrap without known validators (#25293)

(cherry picked from commit 2412276)

# Conflicts:
#	validator/src/bootstrap.rs

* pr: fix merge conflicts

* pr: checks

Co-authored-by: DimAn <diman@diman.io>
Co-authored-by: Brooks Prumo <brooks@solana.com>
  • Loading branch information
3 people authored May 18, 2022
1 parent b19e86d commit a227f9a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions validator/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,19 +1107,20 @@ mod with_incremental_snapshots {
bootstrap_config: &RpcBootstrapConfig,
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,
validator_config,
bootstrap_config,
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

0 comments on commit a227f9a

Please sign in to comment.