From bbdf3751f1be7b7921f8d8fa8669ca90e5d0ac48 Mon Sep 17 00:00:00 2001 From: Martun Karapetyan Date: Tue, 3 Sep 2024 19:15:43 +0400 Subject: [PATCH] Adding another file for storing LPC commitment state. --- README.md | 17 +++++++++++++++++ .../include/nil/proof-generator/prover.hpp | 11 ++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0ad37485..16c8807e 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,20 @@ proof-generator --circuit --assignment --proof cmake .. make -j $(nrpoc) ``` + +# Sample calls to proof-producer + +In all the calls you can change the executable name from proof-producer-single-threaded to proof-producer-multi-threaded to run on all the CPUs of your machine. + +Making a call to preprocessor: + +```bash +./build/bin/proof-producer/proof-producer-single-threaded --stage="preprocess" --common-data="preprocessed_common_data.dat" --preprocessed-data="preprocessed.dat" --commitment-state-file="commitment_state.dat" --circuit="circuit.crct" --assignment-table="assignment.tbl" +``` + +Making a call to prover: + +```bash +./build/bin/proof-producer/proof-producer-single-threaded --stage="prove" --common-data="preprocessed_common_data.dat" --preprocessed-data="preprocessed.dat" --commitment-state-file="commitment_state.dat" --circuit="circuit.crct" --assignment-table="assignment.tbl" --proof="proof.bin" +``` + diff --git a/bin/proof-producer/include/nil/proof-generator/prover.hpp b/bin/proof-producer/include/nil/proof-generator/prover.hpp index d4a3d979..ceec1590 100644 --- a/bin/proof-producer/include/nil/proof-generator/prover.hpp +++ b/bin/proof-producer/include/nil/proof-generator/prover.hpp @@ -156,7 +156,6 @@ namespace nil { BOOST_ASSERT(table_description_); BOOST_ASSERT(constraint_system_); BOOST_ASSERT(lpc_scheme_); - BOOST_ASSERT(fri_params_); BOOST_LOG_TRIVIAL(info) << "Generating proof..."; Proof proof = nil::crypto3::zk::snark::placeholder_prover::process( @@ -178,7 +177,7 @@ namespace nil { BOOST_LOG_TRIVIAL(info) << "Writing proof to " << proof_file_; auto filled_placeholder_proof = - nil::crypto3::marshalling::types::fill_placeholder_proof(proof, *fri_params_); + nil::crypto3::marshalling::types::fill_placeholder_proof(proof, lpc_scheme_->get_fri_params()); bool res = nil::proof_generator::detail::encode_marshalling_to_file( proof_file_, filled_placeholder_proof, @@ -302,9 +301,9 @@ namespace nil { commitment_scheme_state_file << std::endl; using Endianness = nil::marshalling::option::big_endian; using TTypeBase = nil::marshalling::field_type; - std::optional lpc_scheme_; - auto marshalled_lpc_state = fill_commitment_scheme(*lpc_scheme_); + auto marshalled_lpc_state = fill_commitment_scheme( + *lpc_scheme_); bool res = nil::proof_generator::detail::encode_marshalling_to_file( commitment_scheme_state_file, marshalled_lpc_state @@ -415,8 +414,7 @@ namespace nil { // Lambdas and grinding bits should be passed through preprocessor directives 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_); + lpc_scheme_.emplace(FriParams(1, table_rows_log, lambda_, expand_factor_)); BOOST_LOG_TRIVIAL(info) << "Preprocessing public data"; public_preprocessed_data_.emplace( @@ -461,7 +459,6 @@ namespace nil { std::optional table_description_; std::optional constraint_system_; std::optional assignment_table_; - std::optional fri_params_; std::optional lpc_scheme_; };