@@ -1454,15 +1454,15 @@ fn winning_post<Tree: 'static + MerkleTreeTrait>(
14541454 assert_eq ! ( challenged_sectors. len( ) , sector_count) ;
14551455 assert_eq ! ( challenged_sectors[ 0 ] , 0 ) ; // with a sector_count of 1, the only valid index is 0
14561456
1457- let pub_replicas = vec ! [ ( sector_id, PublicReplicaInfo :: new( comm_r) ?) ] ;
1457+ let pub_replicas = [ ( sector_id, PublicReplicaInfo :: new ( comm_r) ?) ] ;
14581458 let private_replica_info =
14591459 PrivateReplicaInfo :: new ( replica. path ( ) . into ( ) , comm_r, cache_dir. path ( ) . into ( ) ) ?;
14601460
14611461 /////////////////////////////////////////////
14621462 // The following methods of proof generation are functionally equivalent:
14631463 // 1)
14641464 //
1465- let priv_replicas = vec ! [ ( sector_id, private_replica_info. clone( ) ) ] ;
1465+ let priv_replicas = [ ( sector_id, private_replica_info. clone ( ) ) ] ;
14661466 let proof = generate_winning_post :: < Tree > ( & config, & randomness, & priv_replicas[ ..] , prover_id) ?;
14671467
14681468 let valid =
@@ -2629,6 +2629,7 @@ fn create_seal_for_upgrade<R: Rng, Tree: 'static + MerkleTreeTrait<Hasher = Tree
26292629 . read ( true )
26302630 . write ( true )
26312631 . create ( true )
2632+ . truncate ( true )
26322633 . open ( new_sealed_sector_file. path ( ) )
26332634 . with_context ( || format ! ( "could not open path={:?}" , new_sealed_sector_file. path( ) ) ) ?;
26342635 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
27342735 . read ( true )
27352736 . write ( true )
27362737 . create ( true )
2738+ . truncate ( true )
27372739 . open ( decoded_sector_file. path ( ) )
27382740 . with_context ( || format ! ( "could not open path={:?}" , decoded_sector_file. path( ) ) ) ?;
27392741 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
27802782 . read ( true )
27812783 . write ( true )
27822784 . create ( true )
2785+ . truncate ( true )
27832786 . open ( remove_encoded_file. path ( ) )
27842787 . with_context ( || format ! ( "could not open path={:?}" , remove_encoded_file. path( ) ) ) ?;
27852788 f_remove_encoded. set_len ( remove_encoded_target_len) ?;
@@ -2895,6 +2898,7 @@ fn create_seal_for_upgrade_aggregation<
28952898 . read ( true )
28962899 . write ( true )
28972900 . create ( true )
2901+ . truncate ( true )
28982902 . open ( new_sealed_sector_file. path ( ) )
28992903 . with_context ( || format ! ( "could not open path={:?}" , new_sealed_sector_file. path( ) ) ) ?;
29002904 f_sealed_sector. set_len ( new_replica_target_len) ?;
0 commit comments