@@ -1454,15 +1454,15 @@ fn winning_post<Tree: 'static + MerkleTreeTrait>(
1454
1454
assert_eq ! ( challenged_sectors. len( ) , sector_count) ;
1455
1455
assert_eq ! ( challenged_sectors[ 0 ] , 0 ) ; // with a sector_count of 1, the only valid index is 0
1456
1456
1457
- let pub_replicas = vec ! [ ( sector_id, PublicReplicaInfo :: new( comm_r) ?) ] ;
1457
+ let pub_replicas = [ ( sector_id, PublicReplicaInfo :: new ( comm_r) ?) ] ;
1458
1458
let private_replica_info =
1459
1459
PrivateReplicaInfo :: new ( replica. path ( ) . into ( ) , comm_r, cache_dir. path ( ) . into ( ) ) ?;
1460
1460
1461
1461
/////////////////////////////////////////////
1462
1462
// The following methods of proof generation are functionally equivalent:
1463
1463
// 1)
1464
1464
//
1465
- let priv_replicas = vec ! [ ( sector_id, private_replica_info. clone( ) ) ] ;
1465
+ let priv_replicas = [ ( sector_id, private_replica_info. clone ( ) ) ] ;
1466
1466
let proof = generate_winning_post :: < Tree > ( & config, & randomness, & priv_replicas[ ..] , prover_id) ?;
1467
1467
1468
1468
let valid =
@@ -2629,6 +2629,7 @@ fn create_seal_for_upgrade<R: Rng, Tree: 'static + MerkleTreeTrait<Hasher = Tree
2629
2629
. read ( true )
2630
2630
. write ( true )
2631
2631
. create ( true )
2632
+ . truncate ( true )
2632
2633
. open ( new_sealed_sector_file. path ( ) )
2633
2634
. with_context ( || format ! ( "could not open path={:?}" , new_sealed_sector_file. path( ) ) ) ?;
2634
2635
f_sealed_sector. set_len ( new_replica_target_len) ?;
@@ -2734,6 +2735,7 @@ fn create_seal_for_upgrade<R: Rng, Tree: 'static + MerkleTreeTrait<Hasher = Tree
2734
2735
. read ( true )
2735
2736
. write ( true )
2736
2737
. create ( true )
2738
+ . truncate ( true )
2737
2739
. open ( decoded_sector_file. path ( ) )
2738
2740
. with_context ( || format ! ( "could not open path={:?}" , decoded_sector_file. path( ) ) ) ?;
2739
2741
f_decoded_sector. set_len ( decoded_sector_target_len) ?;
@@ -2780,6 +2782,7 @@ fn create_seal_for_upgrade<R: Rng, Tree: 'static + MerkleTreeTrait<Hasher = Tree
2780
2782
. read ( true )
2781
2783
. write ( true )
2782
2784
. create ( true )
2785
+ . truncate ( true )
2783
2786
. open ( remove_encoded_file. path ( ) )
2784
2787
. with_context ( || format ! ( "could not open path={:?}" , remove_encoded_file. path( ) ) ) ?;
2785
2788
f_remove_encoded. set_len ( remove_encoded_target_len) ?;
@@ -2895,6 +2898,7 @@ fn create_seal_for_upgrade_aggregation<
2895
2898
. read ( true )
2896
2899
. write ( true )
2897
2900
. create ( true )
2901
+ . truncate ( true )
2898
2902
. open ( new_sealed_sector_file. path ( ) )
2899
2903
. with_context ( || format ! ( "could not open path={:?}" , new_sealed_sector_file. path( ) ) ) ?;
2900
2904
f_sealed_sector. set_len ( new_replica_target_len) ?;
0 commit comments