From bf4ddd968a5ab6b564111e5ee55a47548b31cab7 Mon Sep 17 00:00:00 2001 From: "e.tatuzova" Date: Mon, 29 Apr 2024 06:15:46 +0400 Subject: [PATCH] Submodules updated, max-quotient-chunks parameter added to command-line arguments#83 --- bin/proof-generator/CMakeLists.txt | 4 ++-- .../include/nil/proof-generator/arg_parser.hpp | 3 ++- .../include/nil/proof-generator/prover.hpp | 13 +++++++++---- bin/proof-generator/src/arg_parser.cpp | 1 + bin/proof-generator/src/main.cpp | 8 +------- libs/actor/container | 2 +- libs/actor/zk | 2 +- libs/crypto3 | 2 +- libs/transpiler | 2 +- 9 files changed, 19 insertions(+), 18 deletions(-) diff --git a/bin/proof-generator/CMakeLists.txt b/bin/proof-generator/CMakeLists.txt index c8309e65..912bd4bc 100644 --- a/bin/proof-generator/CMakeLists.txt +++ b/bin/proof-generator/CMakeLists.txt @@ -114,7 +114,7 @@ set(SINGLE_THREADED_TARGET "${CURRENT_PROJECT_NAME}-single-threaded") setup_proof_generator_target(TARGET_NAME ${SINGLE_THREADED_TARGET} ADDITIONAL_DEPENDENCIES crypto3::zk) # Declare multi-threaded target -# set(MUTLI_THREADED_TARGET "${CURRENT_PROJECT_NAME}-multi-threaded") -# setup_proof_generator_target(TARGET_NAME ${MUTLI_THREADED_TARGET} ADDITIONAL_DEPENDENCIES actor::zk) +set(MUTLI_THREADED_TARGET "${CURRENT_PROJECT_NAME}-multi-threaded") +setup_proof_generator_target(TARGET_NAME ${MUTLI_THREADED_TARGET} ADDITIONAL_DEPENDENCIES actor::zk) install(TARGETS ${SINGLE_THREADED_TARGET} ${MUTLI_THREADED_TARGET} RUNTIME DESTINATION bin) diff --git a/bin/proof-generator/include/nil/proof-generator/arg_parser.hpp b/bin/proof-generator/include/nil/proof-generator/arg_parser.hpp index 902f657c..fe00a924 100644 --- a/bin/proof-generator/include/nil/proof-generator/arg_parser.hpp +++ b/bin/proof-generator/include/nil/proof-generator/arg_parser.hpp @@ -44,10 +44,11 @@ namespace nil { bool verification_only = false; CurvesVariant elliptic_curve_type = type_identity{}; HashesVariant hash_type = type_identity>{}; - ; + std::size_t lambda = 9; std::size_t grind = 69; std::size_t expand_factor = 2; + std::size_t max_quotient_chunks = 0; }; std::optional parse_args(int argc, char* argv[]); diff --git a/bin/proof-generator/include/nil/proof-generator/prover.hpp b/bin/proof-generator/include/nil/proof-generator/prover.hpp index 1fa50bff..af9e730a 100644 --- a/bin/proof-generator/include/nil/proof-generator/prover.hpp +++ b/bin/proof-generator/include/nil/proof-generator/prover.hpp @@ -38,13 +38,15 @@ #include #include #include +/* clang-format off */ #include -#include #include #include #include #include #include +#include +/* clang-format on */ #include #include @@ -128,6 +130,7 @@ namespace nil { boost::filesystem::path json_file, std::size_t lambda, std::size_t expand_factor, + std::size_t max_q_chunks, std::size_t grind ) : circuit_file_(circuit_file_name) @@ -137,8 +140,8 @@ namespace nil { , json_file_(json_file) , lambda_(lambda) , expand_factor_(expand_factor) + , max_quotient_chunks_(max_q_chunks) , grind_(grind) { - std::cout << "Global constructor" << std::endl; } bool generate_to_file(bool skip_verification) { @@ -309,6 +312,7 @@ namespace nil { nil::crypto3::marshalling::types::make_assignment_table( *marshalled_table ); + public_inputs_ = assignment_table.public_inputs(); table_description_.emplace(table_description); @@ -316,7 +320,6 @@ namespace nil { std::size_t table_rows_log = std::ceil(std::log2(table_description_->rows_amount)); fri_params_.emplace(FriParams(1, table_rows_log, lambda_, expand_factor_)); - lpc_scheme_.emplace(*fri_params_); BOOST_LOG_TRIVIAL(info) << "Preprocessing public data"; @@ -326,7 +329,8 @@ namespace nil { *constraint_system_, assignment_table.move_public_table(), *table_description_, - *lpc_scheme_ + *lpc_scheme_, + max_quotient_chunks_ ) ); @@ -344,6 +348,7 @@ namespace nil { const boost::filesystem::path proof_file_; const boost::filesystem::path json_file_; const std::size_t expand_factor_; + const std::size_t max_quotient_chunks_; const std::size_t lambda_; const std::size_t grind_; diff --git a/bin/proof-generator/src/arg_parser.cpp b/bin/proof-generator/src/arg_parser.cpp index 822e6974..faa38c4c 100644 --- a/bin/proof-generator/src/arg_parser.cpp +++ b/bin/proof-generator/src/arg_parser.cpp @@ -83,6 +83,7 @@ namespace nil { ("lambda-param", make_defaulted_option(prover_options.lambda), "Lambda param (9)") ("grind-param", make_defaulted_option(prover_options.grind), "Grind param (69)") ("expand-factor,x", make_defaulted_option(prover_options.expand_factor), "Expand factor") + ("max-quotient-chunks,q", make_defaulted_option(prover_options.max_quotient_chunks), "Maximum quotient polynomial parts amount") ("skip-verification", po::bool_switch(&prover_options.skip_verification), "Skip generated proof verifying step") ("verification-only", po::bool_switch(&prover_options.verification_only), "Read proof for verification instead of writing to it"); // clang-format on diff --git a/bin/proof-generator/src/main.cpp b/bin/proof-generator/src/main.cpp index db342db6..15d37be3 100644 --- a/bin/proof-generator/src/main.cpp +++ b/bin/proof-generator/src/main.cpp @@ -40,6 +40,7 @@ int run_prover(const nil::proof_generator::ProverOptions& prover_options) { prover_options.json_file_path, prover_options.lambda, prover_options.expand_factor, + prover_options.max_quotient_chunks, prover_options.grind ); bool prover_result; @@ -64,7 +65,6 @@ int hash_wrapper(const ProverOptions& prover_options) { int ret; auto run_prover_wrapper_void = [&prover_options, &ret]() { using HashType = typename HashTypeIdentity::type; - std::cout << "run prover" << std::endl; ret = run_prover(prover_options); }; pass_variant_type_to_template_func(prover_options.hash_type, run_prover_wrapper_void); @@ -72,7 +72,6 @@ int hash_wrapper(const ProverOptions& prover_options) { } int curve_wrapper(const ProverOptions& prover_options) { - std::cout << "Curve wrapper" << std::endl; int ret; auto curves_wrapper_void = [&prover_options, &ret]() { using CurveType = typename CurveTypeIdentity::type; @@ -83,19 +82,14 @@ int curve_wrapper(const ProverOptions& prover_options) { } int initial_wrapper(const ProverOptions& prover_options) { - std::cout << "Initial wrapper" << std::endl; return curve_wrapper(prover_options); } int main(int argc, char* argv[]) { - std::cout << "Main" << std::endl; std::optional prover_options = nil::proof_generator::parse_args(argc, argv); - std::cout << "Parsed" << std::endl; if (!prover_options) { // Action has already taken a place (help, version, etc.) return 0; } - std::cout << "Prover done" << std::endl; - return initial_wrapper(*prover_options); } diff --git a/libs/actor/container b/libs/actor/container index e366de42..c0fb4660 160000 --- a/libs/actor/container +++ b/libs/actor/container @@ -1 +1 @@ -Subproject commit e366de4260bbdd39d237eacd6e63227f28461f3e +Subproject commit c0fb4660f9cd5f74f2db6f78a7b126f52720c28c diff --git a/libs/actor/zk b/libs/actor/zk index dbbf8faa..97a252c0 160000 --- a/libs/actor/zk +++ b/libs/actor/zk @@ -1 +1 @@ -Subproject commit dbbf8faafb6b4a53f2ee01f2d309f6ac7c8c7fbb +Subproject commit 97a252c02a4a512efccb057f6178ecee2f23e9aa diff --git a/libs/crypto3 b/libs/crypto3 index 40c981af..ac21223e 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 40c981afa78fa8442c2ac72893d39e8fadd066c2 +Subproject commit ac21223e770dbd91a8224fa1ee694f42ea752342 diff --git a/libs/transpiler b/libs/transpiler index 28c8d23b..6e91f1f1 160000 --- a/libs/transpiler +++ b/libs/transpiler @@ -1 +1 @@ -Subproject commit 28c8d23b10548c1d287c530a425bb8853d642877 +Subproject commit 6e91f1f1ba612892c508ad63f95028145ef504b6