11use avail_core:: { AppExtrinsic , AppId , BlockLengthColumns , BlockLengthRows , DataLookup } ;
22use criterion:: { criterion_group, criterion_main, BenchmarkId , Criterion , Throughput } ;
3- use dusk_plonk:: prelude:: BlsScalar ;
4- use kate:: {
5- com:: { Cell , * } ,
6- metrics:: IgnoreMetrics ,
7- Seed , Serializable as _,
8- } ;
3+ use kate:: gridgen:: core:: AsBytes ;
4+ use kate:: { com:: build_proof, com:: par_build_commitments, com:: Cell , metrics:: IgnoreMetrics , Seed } ;
95use kate_recovery:: {
106 com:: reconstruct_extrinsics,
117 commitments,
8+ commons:: ArkScalar ,
129 data:: { self , DataCell } ,
1310 matrix:: Position ,
1411 proof, testnet,
@@ -39,7 +36,7 @@ fn load_xts() -> Vec<Vec<AppIdData>> {
3936 serde_json:: from_str ( XTS_JSON_SETS ) . expect ( "Autogenerated Json file .qed" )
4037}
4138
42- fn sample_cells_from_matrix ( matrix : & DMatrix < BlsScalar > , columns : Option < & [ u16 ] > ) -> Vec < DataCell > {
39+ fn sample_cells_from_matrix ( matrix : & DMatrix < ArkScalar > , columns : Option < & [ u16 ] > ) -> Vec < DataCell > {
4340 fn random_indexes ( length : usize , seed : Seed ) -> Vec < usize > {
4441 // choose random len/2 (unique) indexes
4542 let mut idx = ( 0 ..length) . collect :: < Vec < _ > > ( ) ;
@@ -74,7 +71,7 @@ fn sample_cells_from_matrix(matrix: &DMatrix<BlsScalar>, columns: Option<&[u16]>
7471 let position = Position :: new ( row_pos, col_idx) ;
7572 debug_assert ! ( * row_idx < col_view. len( ) ) ;
7673 let data = col_view[ * row_idx] . to_bytes ( ) ;
77- DataCell :: new ( position, data)
74+ DataCell :: new ( position, data. unwrap ( ) )
7875 } )
7976 . collect :: < Vec < _ > > ( )
8077 } )
@@ -146,7 +143,11 @@ fn reconstruct(xts: &[AppExtrinsic]) {
146143 }
147144
148145 let dims_cols: u32 = dims. cols ( ) . into ( ) ;
149- let public_params = testnet:: public_params ( usize:: try_from ( dims_cols) . unwrap ( ) ) ;
146+ // let public_params = testnet::public_params(usize::try_from(dims_cols).unwrap());
147+ let public_params = testnet:: multiproof_params (
148+ usize:: try_from ( dims_cols) . unwrap ( ) ,
149+ usize:: try_from ( dims_cols) . unwrap ( ) ,
150+ ) ;
150151 for cell in random_cells ( dims. cols ( ) , dims. rows ( ) , Percent :: one ( ) ) {
151152 let row: u32 = cell. row . into ( ) ;
152153
@@ -166,7 +167,7 @@ fn reconstruct(xts: &[AppExtrinsic]) {
166167
167168 let extended_dims = dims. try_into ( ) . unwrap ( ) ;
168169 let commitment = commitments:: from_slice ( & commitments) . unwrap ( ) [ row as usize ] ;
169- let verification = proof:: verify ( & public_params, extended_dims, & commitment, & cell) ;
170+ let verification = proof:: verify_v2 ( & public_params, extended_dims, & commitment, & cell) ;
170171 assert ! ( verification. is_ok( ) ) ;
171172 assert ! ( verification. unwrap( ) ) ;
172173 }
0 commit comments