From 5545316c76a1e084ed00b5bac386dc79b50b7302 Mon Sep 17 00:00:00 2001 From: Martun Karapetyan Date: Thu, 19 Sep 2024 17:02:06 +0400 Subject: [PATCH] Fix proof of work. --- .../crypto3/zk/snark/systems/plonk/placeholder/prover.hpp | 8 +++++--- proof-producer/README.md | 2 +- .../include/nil/proof-generator/arg_parser.hpp | 2 +- .../proof-producer/include/nil/proof-generator/prover.hpp | 2 +- proof-producer/bin/proof-producer/src/arg_parser.cpp | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/parallel-crypto3/libs/parallel-zk/include/nil/crypto3/zk/snark/systems/plonk/placeholder/prover.hpp b/parallel-crypto3/libs/parallel-zk/include/nil/crypto3/zk/snark/systems/plonk/placeholder/prover.hpp index 2662ca76a0..8b24603e54 100644 --- a/parallel-crypto3/libs/parallel-zk/include/nil/crypto3/zk/snark/systems/plonk/placeholder/prover.hpp +++ b/parallel-crypto3/libs/parallel-zk/include/nil/crypto3/zk/snark/systems/plonk/placeholder/prover.hpp @@ -214,9 +214,11 @@ namespace nil { if (!_skip_commitment_scheme_eval_proofs) { _proof.eval_proof.eval_proof = _commitment_scheme.proof_eval(transcript); } else { - // This is required for aggregated prover. If we do not run the LPC proof right now, - // we still need to push the merkle tree roots into the transcript. - _commitment_scheme.eval_polys_and_add_roots_to_transcipt(transcript); + if constexpr (nil::crypto3::zk::is_lpc) { + // This is required for aggregated prover. If we do not run the LPC proof right now, + // we still need to push the merkle tree roots into the transcript. + _commitment_scheme.eval_polys_and_add_roots_to_transcipt(transcript); + } } return _proof; diff --git a/proof-producer/README.md b/proof-producer/README.md index 91b909b4c0..50140d0cdf 100644 --- a/proof-producer/README.md +++ b/proof-producer/README.md @@ -156,7 +156,7 @@ Compute aggregated FRI proof done once on the main prover. This is a part of the ```bash ./build/bin/proof-producer/proof-producer-single-threaded \ --stage="aggregated-FRI" \ - --assignment-description-file="assignment-description.dat" + --assignment-description-file="assignment-description.dat" \ --aggregated-challenge-file="aggregated_challenge.dat" \ --input-combined-Q-polynomial-files "$CIRCUIT1-combined-Q.dat" "$CIRCUIT2_combined-Q.dat" \ --proof="aggregated_FRI_proof.bin" \ diff --git a/proof-producer/bin/proof-producer/include/nil/proof-generator/arg_parser.hpp b/proof-producer/bin/proof-producer/include/nil/proof-generator/arg_parser.hpp index bb7f0e6ff7..001c67d14b 100644 --- a/proof-producer/bin/proof-producer/include/nil/proof-generator/arg_parser.hpp +++ b/proof-producer/bin/proof-producer/include/nil/proof-generator/arg_parser.hpp @@ -61,7 +61,7 @@ namespace nil { HashesVariant hash_type = type_identity>{}; std::size_t lambda = 9; - std::size_t grind = 69; + std::size_t grind = 0; std::size_t expand_factor = 2; std::size_t max_quotient_chunks = 0; }; diff --git a/proof-producer/bin/proof-producer/include/nil/proof-generator/prover.hpp b/proof-producer/bin/proof-producer/include/nil/proof-generator/prover.hpp index c7375673ab..e972845cc9 100644 --- a/proof-producer/bin/proof-producer/include/nil/proof-generator/prover.hpp +++ b/proof-producer/bin/proof-producer/include/nil/proof-generator/prover.hpp @@ -585,7 +585,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)); - lpc_scheme_.emplace(FriParams(1, table_rows_log, lambda_, expand_factor_)); + lpc_scheme_.emplace(FriParams(1, table_rows_log, lambda_, expand_factor_, grind_!=0, grind_)); } bool preprocess_public_data() { diff --git a/proof-producer/bin/proof-producer/src/arg_parser.cpp b/proof-producer/bin/proof-producer/src/arg_parser.cpp index 7ebe218f91..8203a15f8d 100644 --- a/proof-producer/bin/proof-producer/src/arg_parser.cpp +++ b/proof-producer/bin/proof-producer/src/arg_parser.cpp @@ -86,7 +86,7 @@ namespace nil { ("elliptic-curve-type,e", make_defaulted_option(prover_options.elliptic_curve_type), "Elliptic curve type (pallas)") ("hash-type", make_defaulted_option(prover_options.hash_type), "Hash type (keccak, poseidon, sha256)") ("lambda-param", make_defaulted_option(prover_options.lambda), "Lambda param (9)") - ("grind-param", make_defaulted_option(prover_options.grind), "Grind param (69)") + ("grind-param", make_defaulted_option(prover_options.grind), "Grind param (0)") ("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") ("input-challenge-files,u", po::value>(&prover_options.input_challenge_files)->multitoken(),