@@ -27,7 +27,7 @@ use ic_types::{
27
27
ingress:: { IngressState , IngressStatus } ,
28
28
malicious_flags:: MaliciousFlags ,
29
29
messages:: MessageId ,
30
- state_sync:: { FileInfo , Manifest , StateSyncVersion } ,
30
+ state_sync:: { FileInfo , Manifest , CURRENT_STATE_SYNC_VERSION } ,
31
31
Cycles , Height ,
32
32
} ;
33
33
use std:: { path:: Path , sync:: Arc } ;
@@ -125,7 +125,7 @@ fn read_write_roundtrip() {
125
125
// Compute the manifest of the original checkpoint.
126
126
let metrics = StateManagerMetrics :: new ( & metrics_registry) ;
127
127
let manifest_metrics = & metrics. manifest_metrics ;
128
- let ( manifest_before, height_before) = compute_manifest_v3 ( & layout, manifest_metrics, & log) ;
128
+ let ( manifest_before, height_before) = compute_manifest ( & layout, manifest_metrics, & log) ;
129
129
130
130
// Read the latest checkpoint into a state.
131
131
let fd_factory = Arc :: new ( TestPageAllocatorFileDescriptorImpl :: new ( ) ) ;
@@ -150,7 +150,7 @@ fn read_write_roundtrip() {
150
150
assert_eq ! ( 2 , layout. checkpoint_heights( ) . unwrap( ) . len( ) ) ;
151
151
152
152
// Compute the manifest of the newly written checkpoint.
153
- let ( manifest_after, height_after) = compute_manifest_v3 ( & layout, manifest_metrics, & log) ;
153
+ let ( manifest_after, height_after) = compute_manifest ( & layout, manifest_metrics, & log) ;
154
154
155
155
// The two checkpoints' manifests should be identical.
156
156
assert_eq ! ( manifest_before, manifest_after) ;
@@ -168,7 +168,7 @@ fn split_subnet_a_prime() {
168
168
let tmp = new_state_layout ( log. clone ( ) ) ;
169
169
let root = tmp. path ( ) . to_path_buf ( ) ;
170
170
171
- let ( manifest_a, height_a) = compute_manifest_v3_for_root ( & root, & log) ;
171
+ let ( manifest_a, height_a) = compute_manifest_for_root ( & root, & log) ;
172
172
assert_eq ! ( SUBNET_A_FILES , manifest_files( & manifest_a) . as_slice( ) ) ;
173
173
174
174
split (
@@ -180,7 +180,7 @@ fn split_subnet_a_prime() {
180
180
)
181
181
. unwrap ( ) ;
182
182
183
- let ( manifest_a_prime, height_a_prime) = compute_manifest_v3_for_root ( & root, & log) ;
183
+ let ( manifest_a_prime, height_a_prime) = compute_manifest_for_root ( & root, & log) ;
184
184
assert_eq ! (
185
185
SUBNET_A_PRIME_FILES ,
186
186
manifest_files( & manifest_a_prime) . as_slice( )
@@ -213,7 +213,7 @@ fn split_subnet_b() {
213
213
let tmp = new_state_layout ( log. clone ( ) ) ;
214
214
let root = tmp. path ( ) . to_path_buf ( ) ;
215
215
216
- let ( manifest_a, height_a) = compute_manifest_v3_for_root ( & root, & log) ;
216
+ let ( manifest_a, height_a) = compute_manifest_for_root ( & root, & log) ;
217
217
assert_eq ! ( SUBNET_A_FILES , manifest_files( & manifest_a) . as_slice( ) ) ;
218
218
219
219
split (
@@ -225,7 +225,7 @@ fn split_subnet_b() {
225
225
)
226
226
. unwrap ( ) ;
227
227
228
- let ( manifest_b, height_b) = compute_manifest_v3_for_root ( & root, & log) ;
228
+ let ( manifest_b, height_b) = compute_manifest_for_root ( & root, & log) ;
229
229
assert_eq ! ( SUBNET_B_FILES , manifest_files( & manifest_b) . as_slice( ) ) ;
230
230
231
231
// Checkpoint heights should differ by 1.
@@ -353,8 +353,8 @@ fn new_state_layout(log: ReplicaLogger) -> TempDir {
353
353
tmp
354
354
}
355
355
356
- /// Computes the `V3` manifest of the last checkpoint under `state_layout`.
357
- fn compute_manifest_v3 (
356
+ /// Computes the manifest of the last checkpoint under `state_layout`.
357
+ fn compute_manifest (
358
358
state_layout : & StateLayout ,
359
359
manifest_metrics : & ManifestMetrics ,
360
360
log : & ReplicaLogger ,
@@ -365,7 +365,7 @@ fn compute_manifest_v3(
365
365
& mut thread_pool ( ) ,
366
366
manifest_metrics,
367
367
log,
368
- StateSyncVersion :: V3 ,
368
+ CURRENT_STATE_SYNC_VERSION ,
369
369
& last_checkpoint_layout,
370
370
1024 ,
371
371
None ,
@@ -405,16 +405,16 @@ fn file_info<'a>(file: &str, manifest: &'a Manifest) -> &'a FileInfo {
405
405
panic ! ( "file '{}' not found in manifest: {:?}" , file, manifest)
406
406
}
407
407
408
- /// Computes the V3 manifest of the latest checkpoint under the state layout at
408
+ /// Computes the manifest of the latest checkpoint under the state layout at
409
409
/// `root`.
410
- fn compute_manifest_v3_for_root ( root : & Path , log : & ReplicaLogger ) -> ( Manifest , Height ) {
410
+ fn compute_manifest_for_root ( root : & Path , log : & ReplicaLogger ) -> ( Manifest , Height ) {
411
411
let metrics_registry = MetricsRegistry :: new ( ) ;
412
412
let layout = StateLayout :: try_new ( log. clone ( ) , root. to_path_buf ( ) , & metrics_registry) . unwrap ( ) ;
413
413
414
414
// Compute the manifest of the original checkpoint.
415
415
let metrics = StateManagerMetrics :: new ( & metrics_registry) ;
416
416
let manifest_metrics = & metrics. manifest_metrics ;
417
- compute_manifest_v3 ( & layout, manifest_metrics, log)
417
+ compute_manifest ( & layout, manifest_metrics, log)
418
418
}
419
419
420
420
fn deserialize_split_from ( root : & Path , height : Height ) -> SubnetId {
0 commit comments