@@ -83,7 +83,7 @@ impl OwnSegments<'_> {
8383 let root = BalancedMerkleTree :: compute_root_only ( & [
8484 single_block_hash ( self . first_local_segment_index . as_bytes ( ) )
8585 . expect ( "Less than a single block worth of bytes; qed" ) ,
86- * compute_segments_root :: < const { u64:: from ( u8:: MAX ) } , _ > ( self . segment_roots ) ,
86+ * compute_segments_root :: < { u64:: from ( u8:: MAX ) } , _ > ( self . segment_roots ) ,
8787 ] ) ;
8888
8989 Blake3Hash :: new ( root)
@@ -109,7 +109,7 @@ impl OwnSegments<'_> {
109109
110110 single_block_hash ( & pair) . expect ( "Less than a single block worth of bytes; qed" )
111111 } ,
112- * compute_segments_root :: < const { u64:: from ( u8:: MAX ) } , _ > ( self . segment_roots ) ,
112+ * compute_segments_root :: < { u64:: from ( u8:: MAX ) } , _ > ( self . segment_roots ) ,
113113 ] ) ;
114114
115115 Blake3Hash :: new ( root)
@@ -173,9 +173,7 @@ impl<'a> IntermediateShardBlockInfo<'a> {
173173 // SAFETY: Valid pointer and size, no alignment requirements
174174 let own_segment_roots = unsafe {
175175 slice:: from_raw_parts (
176- own_segment_roots
177- . as_ptr ( )
178- . cast :: < [ u8 ; const { SegmentRoot :: SIZE } ] > ( ) ,
176+ own_segment_roots. as_ptr ( ) . cast :: < [ u8 ; SegmentRoot :: SIZE ] > ( ) ,
179177 num_own_segment_roots,
180178 )
181179 } ;
@@ -477,7 +475,7 @@ impl<'a> IntermediateShardBlocksInfo<'a> {
477475 let segments_proof = intermediate_shard_block. segments_proof . unwrap_or ( & [ 0 ; _] ) ;
478476
479477 let leaf_shards_root =
480- UnbalancedMerkleTree :: compute_root_only :: < const { u64:: from ( u16:: MAX ) } , _ , _ > (
478+ UnbalancedMerkleTree :: compute_root_only :: < { u64:: from ( u16:: MAX ) } , _ , _ > (
481479 intermediate_shard_block. leaf_shards_segments ( ) . map (
482480 |( shard_index, own_segments) | {
483481 own_segments. root_with_shard_index ( shard_index)
@@ -559,9 +557,7 @@ impl<'a> IntermediateShardBlocksInfo<'a> {
559557 // SAFETY: Valid pointer and size, no alignment requirements
560558 let own_segment_roots = unsafe {
561559 slice:: from_raw_parts (
562- own_segment_roots
563- . as_ptr ( )
564- . cast :: < [ u8 ; const { SegmentRoot :: SIZE } ] > ( ) ,
560+ own_segment_roots. as_ptr ( ) . cast :: < [ u8 ; SegmentRoot :: SIZE ] > ( ) ,
565561 num_own_segment_roots,
566562 )
567563 } ;
@@ -629,9 +625,9 @@ impl<'a> IntermediateShardBlocksInfo<'a> {
629625 /// Returns the default value for an empty collection of segment roots.
630626 #[ inline]
631627 pub fn segments_root ( & self ) -> Blake3Hash {
632- let root = UnbalancedMerkleTree :: compute_root_only :: < const { u64:: from ( u16:: MAX ) } , _ , _ > (
628+ let root = UnbalancedMerkleTree :: compute_root_only :: < { u64:: from ( u16:: MAX ) } , _ , _ > (
633629 self . iter ( ) . map ( |shard_block_info| {
634- UnbalancedMerkleTree :: compute_root_only :: < const { u64:: from ( u32:: MAX ) } , _ , _ > (
630+ UnbalancedMerkleTree :: compute_root_only :: < { u64:: from ( u32:: MAX ) } , _ , _ > (
635631 shard_block_info
636632 . own_segments
637633 . as_ref ( )
@@ -656,7 +652,7 @@ impl<'a> IntermediateShardBlocksInfo<'a> {
656652 /// Returns the default value for an empty collection of shard blocks.
657653 #[ inline]
658654 pub fn headers_root ( & self ) -> Blake3Hash {
659- let root = UnbalancedMerkleTree :: compute_root_only :: < const { u64:: from ( u16:: MAX ) } , _ , _ > (
655+ let root = UnbalancedMerkleTree :: compute_root_only :: < { u64:: from ( u16:: MAX ) } , _ , _ > (
660656 // TODO: Keyed hash
661657 self . iter ( ) . map ( |shard_block_info| {
662658 // Hash the root again so we can prove it, otherwise the root of headers is
@@ -740,9 +736,7 @@ impl<'a> BeaconChainBody<'a> {
740736 // SAFETY: Valid pointer and size, no alignment requirements
741737 let own_segment_roots = unsafe {
742738 slice:: from_raw_parts (
743- own_segment_roots
744- . as_ptr ( )
745- . cast :: < [ u8 ; const { SegmentRoot :: SIZE } ] > ( ) ,
739+ own_segment_roots. as_ptr ( ) . cast :: < [ u8 ; SegmentRoot :: SIZE ] > ( ) ,
746740 num_own_segment_roots,
747741 )
748742 } ;
@@ -765,7 +759,7 @@ impl<'a> BeaconChainBody<'a> {
765759 slice:: from_raw_parts (
766760 pot_checkpoints
767761 . as_ptr ( )
768- . cast :: < [ u8 ; const { PotCheckpoints :: SIZE } ] > ( ) ,
762+ . cast :: < [ u8 ; PotCheckpoints :: SIZE ] > ( ) ,
769763 num_pot_checkpoints,
770764 )
771765 } ;
@@ -826,9 +820,7 @@ impl<'a> BeaconChainBody<'a> {
826820 // SAFETY: Valid pointer and size, no alignment requirements
827821 let own_segment_roots = unsafe {
828822 slice:: from_raw_parts (
829- own_segment_roots
830- . as_ptr ( )
831- . cast :: < [ u8 ; const { SegmentRoot :: SIZE } ] > ( ) ,
823+ own_segment_roots. as_ptr ( ) . cast :: < [ u8 ; SegmentRoot :: SIZE ] > ( ) ,
832824 num_own_segment_roots,
833825 )
834826 } ;
@@ -851,7 +843,7 @@ impl<'a> BeaconChainBody<'a> {
851843 slice:: from_raw_parts (
852844 pot_checkpoints
853845 . as_ptr ( )
854- . cast :: < [ u8 ; const { PotCheckpoints :: SIZE } ] > ( ) ,
846+ . cast :: < [ u8 ; PotCheckpoints :: SIZE ] > ( ) ,
855847 num_pot_checkpoints,
856848 )
857849 } ;
@@ -1204,9 +1196,7 @@ impl<'a> LeafShardBlocksInfo<'a> {
12041196 // SAFETY: Valid pointer and size, no alignment requirements
12051197 let own_segment_roots = unsafe {
12061198 slice:: from_raw_parts (
1207- own_segment_roots
1208- . as_ptr ( )
1209- . cast :: < [ u8 ; const { SegmentRoot :: SIZE } ] > ( ) ,
1199+ own_segment_roots. as_ptr ( ) . cast :: < [ u8 ; SegmentRoot :: SIZE ] > ( ) ,
12101200 num_own_segment_roots,
12111201 )
12121202 } ;
@@ -1245,7 +1235,7 @@ impl<'a> LeafShardBlocksInfo<'a> {
12451235 /// Returns the default value for an empty collection of segment roots.
12461236 #[ inline]
12471237 pub fn segments_root ( & self ) -> Blake3Hash {
1248- let root = UnbalancedMerkleTree :: compute_root_only :: < const { u64:: from ( u16:: MAX ) } , _ , _ > (
1238+ let root = UnbalancedMerkleTree :: compute_root_only :: < { u64:: from ( u16:: MAX ) } , _ , _ > (
12491239 self . iter ( ) . map ( |shard_block_info| {
12501240 shard_block_info
12511241 . segments
@@ -1267,7 +1257,7 @@ impl<'a> LeafShardBlocksInfo<'a> {
12671257 /// Returns the default value for an empty collection of shard blocks.
12681258 #[ inline]
12691259 pub fn headers_root ( & self ) -> Blake3Hash {
1270- let root = UnbalancedMerkleTree :: compute_root_only :: < const { u64:: from ( u16:: MAX ) } , _ , _ > (
1260+ let root = UnbalancedMerkleTree :: compute_root_only :: < { u64:: from ( u16:: MAX ) } , _ , _ > (
12711261 self . iter ( ) . map ( |shard_block_info| {
12721262 // Hash the root again so we can prove it, otherwise root of headers is
12731263 // indistinguishable from individual block roots and can be used to confuse
@@ -1340,9 +1330,7 @@ impl<'a> IntermediateShardBody<'a> {
13401330 // SAFETY: Valid pointer and size, no alignment requirements
13411331 let own_segment_roots = unsafe {
13421332 slice:: from_raw_parts (
1343- own_segment_roots
1344- . as_ptr ( )
1345- . cast :: < [ u8 ; const { SegmentRoot :: SIZE } ] > ( ) ,
1333+ own_segment_roots. as_ptr ( ) . cast :: < [ u8 ; SegmentRoot :: SIZE ] > ( ) ,
13461334 num_own_segment_roots,
13471335 )
13481336 } ;
@@ -1405,9 +1393,7 @@ impl<'a> IntermediateShardBody<'a> {
14051393 // SAFETY: Valid pointer and size, no alignment requirements
14061394 let own_segment_roots = unsafe {
14071395 slice:: from_raw_parts (
1408- own_segment_roots
1409- . as_ptr ( )
1410- . cast :: < [ u8 ; const { SegmentRoot :: SIZE } ] > ( ) ,
1396+ own_segment_roots. as_ptr ( ) . cast :: < [ u8 ; SegmentRoot :: SIZE ] > ( ) ,
14111397 num_own_segment_roots,
14121398 )
14131399 } ;
@@ -1571,7 +1557,7 @@ impl<'a> Transactions<'a> {
15711557 /// Returns the default value for an empty collection of transactions.
15721558 #[ inline]
15731559 pub fn root ( & self ) -> Blake3Hash {
1574- let root = UnbalancedMerkleTree :: compute_root_only :: < const { u64:: from ( u32:: MAX ) } , _ , _ > (
1560+ let root = UnbalancedMerkleTree :: compute_root_only :: < { u64:: from ( u32:: MAX ) } , _ , _ > (
15751561 self . iter ( ) . map ( |transaction| {
15761562 // Hash the hash again so we can prove it, otherwise root of transactions is
15771563 // indistinguishable from individual transaction roots and can be used to
@@ -1644,9 +1630,7 @@ impl<'a> LeafShardBody<'a> {
16441630 // SAFETY: Valid pointer and size, no alignment requirements
16451631 let own_segment_roots = unsafe {
16461632 slice:: from_raw_parts (
1647- own_segment_roots
1648- . as_ptr ( )
1649- . cast :: < [ u8 ; const { SegmentRoot :: SIZE } ] > ( ) ,
1633+ own_segment_roots. as_ptr ( ) . cast :: < [ u8 ; SegmentRoot :: SIZE ] > ( ) ,
16501634 num_own_segment_roots,
16511635 )
16521636 } ;
@@ -1709,9 +1693,7 @@ impl<'a> LeafShardBody<'a> {
17091693 // SAFETY: Valid pointer and size, no alignment requirements
17101694 let own_segment_roots = unsafe {
17111695 slice:: from_raw_parts (
1712- own_segment_roots
1713- . as_ptr ( )
1714- . cast :: < [ u8 ; const { SegmentRoot :: SIZE } ] > ( ) ,
1696+ own_segment_roots. as_ptr ( ) . cast :: < [ u8 ; SegmentRoot :: SIZE ] > ( ) ,
17151697 num_own_segment_roots,
17161698 )
17171699 } ;
0 commit comments