Skip to content

Commit

Permalink
Add expand factor option
Browse files Browse the repository at this point in the history
  • Loading branch information
x-mass committed Feb 20, 2024
1 parent fc4e13f commit 6ddb405
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace nil {
columns_params columns = all_columns_params[0];
lambda_param lambda = all_lambda_params[0];
grind_param grind = all_grind_params[0];
std::size_t expand_factor = 2;
};

std::optional<prover_options> parse_args(int argc, char* argv[]);
Expand Down
11 changes: 8 additions & 3 deletions bin/proof-generator/include/nil/proof-generator/prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ namespace nil {
boost::filesystem::path circuit_file_name,
boost::filesystem::path preprocessed_common_data_file_name,
boost::filesystem::path assignment_table_file_name,
boost::filesystem::path proof_file
boost::filesystem::path proof_file,
std::size_t expand_factor
)
: circuit_file_(circuit_file_name)
, preprocessed_common_data_file_(preprocessed_common_data_file_name)
, assignment_table_file_(assignment_table_file_name)
, proof_file_(proof_file) {
, proof_file_(proof_file)
, expand_factor_(expand_factor) {
}

bool generate_to_file(bool skip_verification) {
Expand Down Expand Up @@ -334,7 +336,9 @@ namespace nil {
// Lambdas and grinding bits should be passed threw preprocessor directives
std::size_t table_rows_log = std::ceil(std::log2(table_description_->rows_amount));

fri_params_.emplace(detail::create_fri_params<typename Lpc::fri_type, BlueprintField>(table_rows_log));
fri_params_.emplace(
detail::create_fri_params<typename Lpc::fri_type, BlueprintField>(table_rows_log, 1, expand_factor_)
);

std::size_t permutation_size = table_description_->witness_columns
+ table_description_->public_input_columns + ComponentConstantColumns;
Expand Down Expand Up @@ -364,6 +368,7 @@ namespace nil {
const boost::filesystem::path preprocessed_common_data_file_;
const boost::filesystem::path assignment_table_file_;
const boost::filesystem::path proof_file_;
const std::size_t expand_factor_;

// All set on prepare_for_operation()
std::optional<PublicPreprocessedData> public_preprocessed_data_;
Expand Down
1 change: 1 addition & 0 deletions bin/proof-generator/src/arg_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ namespace nil {
("columns-params", po::value(&prover_options.columns)->default_value(prover_options.columns), "Columns params, use --list-columns-params to list")
("lambda-param", po::value(&prover_options.lambda)->default_value(prover_options.lambda), "Lambda param (9)")
("grind-param", po::value(&prover_options.lambda)->default_value(prover_options.lambda), "Grind param (69)")
("expand-factor", po::value(&prover_options.expand_factor)->default_value(prover_options.expand_factor), "Expand factor")
("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
Expand Down
3 changes: 2 additions & 1 deletion bin/proof-generator/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ int run_prover(const nil::proof_generator::prover_options& prover_options) {
prover_options.circuit_file_path,
prover_options.preprocessed_common_data_path,
prover_options.assignment_table_file_path,
prover_options.proof_file_path
prover_options.proof_file_path,
prover_options.expand_factor
);
bool prover_result;
try {
Expand Down

0 comments on commit 6ddb405

Please sign in to comment.