From 994527cee879ac92ed20c4533b97b3debe8c23a1 Mon Sep 17 00:00:00 2001 From: "e.tatuzova" Date: Thu, 25 Apr 2024 12:19:29 +0400 Subject: [PATCH] Placeholder_info object updated#78 --- .../plonk/placeholder/detail/profiling.hpp | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/include/nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp b/include/nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp index 5e18e4cb..b8671996 100644 --- a/include/nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp +++ b/include/nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp @@ -56,6 +56,8 @@ namespace nil { std::size_t permutation_batch_size; bool use_lookups; bool use_permutations; + std::size_t points_num; + std::size_t table_values_num; // Commitments order in placeholder proof int variable_value_batch_order; @@ -66,6 +68,7 @@ namespace nil { // Polynomial_amount std::size_t permutation_poly_amount; std::size_t lookup_poly_amount; + std::size_t sorted_poly_amount; std::size_t permutation_size; std::size_t round_proof_layers_num; @@ -135,8 +138,6 @@ namespace nil { } if(res.use_lookups) res.batches_sizes[cur++] = constraint_system.sorted_lookup_columns_number(); - res.poly_num = std::accumulate(res.batches_sizes.begin(), res.batches_sizes.end(), 0); - res.round_proof_layers_num = 0; for(std::size_t i = 0; i < fri_params.r; i++ ){ res.round_proof_layers_num += log2(fri_params.D[i]->m) -1; @@ -149,12 +150,15 @@ namespace nil { std::map zero_indices; + res.points_num = 2 * res.permutation_size + 4; + res.table_values_num = 0; for(std::size_t i = 0; i < common_data.desc.constant_columns; i++){ for(auto& rot: col_rotations[i + common_data.desc.witness_columns + common_data.desc.public_input_columns]){ variable_type v(i, rot, true, variable_type::column_type::constant); res.var_indices[v] = j; if( rot == 0 ) zero_indices[i + common_data.desc.witness_columns + common_data.desc.public_input_columns] = j; j++; + res.table_values_num++; } } for(std::size_t i = 0; i < common_data.desc.selector_columns; i++){ @@ -163,6 +167,7 @@ namespace nil { res.var_indices[v] = j; if( rot == 0) zero_indices[i + common_data.desc.witness_columns + common_data.desc.public_input_columns + common_data.desc.constant_columns] = j; j++; + res.table_values_num++; } } for(std::size_t i = 0; i < common_data.desc.witness_columns; i++){ @@ -171,6 +176,7 @@ namespace nil { res.var_indices[v] = j; if(rot == 0) zero_indices[i] = j; j++; + res.table_values_num++; } } for(std::size_t i = 0; i < common_data.desc.public_input_columns; i++){ @@ -179,14 +185,27 @@ namespace nil { res.var_indices[v] = j; if(rot == 0) zero_indices[i + common_data.desc.witness_columns] = j; j++; + res.table_values_num++; } } + res.points_num += res.table_values_num; for( std::size_t i = 0; i < common_data.permuted_columns.size(); i++ ){ std::size_t ind = common_data.permuted_columns[i]; res.permuted_zero_indices.push_back(zero_indices[ind]); } + if( res.use_permutations ){ + res.points_num += res.permutation_poly_amount + 1; + } + if( res.use_lookups ){ + res.points_num += res.lookup_poly_amount + 1; + } + res.points_num += res.quotient_size; + res.points_num += constraint_system.sorted_lookup_columns_number() * 3; + + res.sorted_poly_amount = constraint_system.sorted_lookup_columns_number(); + return res; }