4
4
snapshot_hash:: {
5
5
FullSnapshotHash , IncrementalSnapshotHash , SnapshotHash , StartingSnapshotHashes ,
6
6
} ,
7
- snapshot_package:: { retain_max_n_elements , SnapshotKind } ,
7
+ snapshot_package:: SnapshotKind ,
8
8
} ,
9
9
solana_sdk:: { clock:: Slot , hash:: Hash } ,
10
10
std:: sync:: Arc ,
14
14
pub struct SnapshotGossipManager {
15
15
cluster_info : Arc < ClusterInfo > ,
16
16
latest_snapshot_hashes : Option < LatestSnapshotHashes > ,
17
- max_legacy_full_snapshot_hashes : usize ,
18
- legacy_full_snapshot_hashes : Vec < FullSnapshotHash > ,
19
17
}
20
18
21
19
impl SnapshotGossipManager {
@@ -24,14 +22,11 @@ impl SnapshotGossipManager {
24
22
#[ must_use]
25
23
pub fn new (
26
24
cluster_info : Arc < ClusterInfo > ,
27
- max_legacy_full_snapshot_hashes : usize ,
28
25
starting_snapshot_hashes : Option < StartingSnapshotHashes > ,
29
26
) -> Self {
30
27
let mut this = SnapshotGossipManager {
31
28
cluster_info,
32
29
latest_snapshot_hashes : None ,
33
- max_legacy_full_snapshot_hashes,
34
- legacy_full_snapshot_hashes : Vec :: default ( ) ,
35
30
} ;
36
31
if let Some ( starting_snapshot_hashes) = starting_snapshot_hashes {
37
32
this. push_starting_snapshot_hashes ( starting_snapshot_hashes) ;
@@ -49,10 +44,6 @@ impl SnapshotGossipManager {
49
44
) ;
50
45
}
51
46
self . push_latest_snapshot_hashes_to_cluster ( ) ;
52
-
53
- // Handle legacy snapshot hashes here too
54
- // Once LegacySnapshotHashes are removed from CRDS, also remove them here
55
- self . push_legacy_full_snapshot_hash ( starting_snapshot_hashes. full ) ;
56
47
}
57
48
58
49
/// Push new snapshot hash to the cluster via CRDS
@@ -78,10 +69,6 @@ impl SnapshotGossipManager {
78
69
fn push_full_snapshot_hash ( & mut self , full_snapshot_hash : FullSnapshotHash ) {
79
70
self . update_latest_full_snapshot_hash ( full_snapshot_hash) ;
80
71
self . push_latest_snapshot_hashes_to_cluster ( ) ;
81
-
82
- // Handle legacy snapshot hashes here too
83
- // Once LegacySnapshotHashes are removed from CRDS, also remove them here
84
- self . push_legacy_full_snapshot_hash ( full_snapshot_hash) ;
85
72
}
86
73
87
74
/// Push new incremental snapshot hash to the cluster via CRDS
@@ -146,22 +133,6 @@ impl SnapshotGossipManager {
146
133
and a new error case has been added that has not been handled here.",
147
134
) ;
148
135
}
149
-
150
- /// Add `full_snapshot_hash` to the vector of full snapshot hashes, then push that vector to
151
- /// the cluster via CRDS.
152
- fn push_legacy_full_snapshot_hash ( & mut self , full_snapshot_hash : FullSnapshotHash ) {
153
- self . legacy_full_snapshot_hashes . push ( full_snapshot_hash) ;
154
-
155
- retain_max_n_elements (
156
- & mut self . legacy_full_snapshot_hashes ,
157
- self . max_legacy_full_snapshot_hashes ,
158
- ) ;
159
-
160
- self . cluster_info
161
- . push_legacy_snapshot_hashes ( clone_hashes_for_crds (
162
- self . legacy_full_snapshot_hashes . as_slice ( ) ,
163
- ) ) ;
164
- }
165
136
}
166
137
167
138
#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
@@ -191,8 +162,3 @@ impl AsSnapshotHash for IncrementalSnapshotHash {
191
162
& self . 0
192
163
}
193
164
}
194
-
195
- /// Clones and maps snapshot hashes into what CRDS expects
196
- fn clone_hashes_for_crds ( hashes : & [ impl AsSnapshotHash ] ) -> Vec < ( Slot , Hash ) > {
197
- hashes. iter ( ) . map ( AsSnapshotHash :: clone_for_crds) . collect ( )
198
- }
0 commit comments