From 24be2f4fd4879b125fa8766ff529c22a3e480204 Mon Sep 17 00:00:00 2001 From: codygunton Date: Thu, 24 Oct 2024 16:16:25 +0000 Subject: [PATCH] Tweak logging --- .../cpp/src/barretenberg/client_ivc/client_ivc.cpp | 5 +++-- .../barretenberg/dsl/acir_format/acir_format.cpp | 2 -- barretenberg/cpp/src/barretenberg/goblin/goblin.hpp | 6 ++++-- .../protogalaxy/protogalaxy_prover_impl.hpp | 6 +++--- .../barretenberg/srs/factories/file_crs_factory.cpp | 4 ++-- .../srs/factories/mem_bn254_crs_factory.cpp | 2 +- .../srs/factories/mem_grumpkin_crs_factory.cpp | 2 +- .../cpp/src/barretenberg/srs/global_crs.cpp | 1 - .../cpp/src/barretenberg/sumcheck/sumcheck.hpp | 5 +++-- .../barretenberg/ultra_honk/decider_proving_key.hpp | 13 ------------- yarn-project/bb-prover/src/bb/execute.ts | 4 ++-- 11 files changed, 19 insertions(+), 31 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp index d94cb63507f..863bbb5a051 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp @@ -189,7 +189,7 @@ void ClientIVC::accumulate(ClientCircuit& circuit, const std::shared_ptrgate_challenges = std::vector(CONST_PG_LOG_N, 0); fold_output.accumulator = proving_key; // initialize the prover accum with the completed key - vinfo("initizlied accumulator"); + vinfo("initialized accumulator"); // Add oink proof and corresponding verification key to the verification queue verification_queue.push_back( @@ -267,9 +267,10 @@ bool ClientIVC::verify(const Proof& proof, const std::vector ProtogalaxyProver_gate_challenges, alphas, relation_parameters, perturbator_evaluation, combiner_quotient) = combiner_quotient_round(accumulator->gate_challenges, deltas, keys_to_fold); - vinfo("ran combiner quotient round"); + vinfo("combiner quotient round"); const FoldingResult result = update_target_sum_and_fold( keys_to_fold, combiner_quotient, alphas, relation_parameters, perturbator_evaluation); diff --git a/barretenberg/cpp/src/barretenberg/srs/factories/file_crs_factory.cpp b/barretenberg/cpp/src/barretenberg/srs/factories/file_crs_factory.cpp index c0d664ca9de..105528e39c4 100644 --- a/barretenberg/cpp/src/barretenberg/srs/factories/file_crs_factory.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/factories/file_crs_factory.cpp @@ -62,7 +62,7 @@ std::shared_ptr> FileCrsFactory::get if (prover_degree_ < degree || !prover_crs_) { prover_crs_ = std::make_shared>(degree, path_); prover_degree_ = degree; - vinfo("Initializing ", Curve::name, " prover CRS from file of size ", degree); + vinfo("Initialized ", Curve::name, " prover CRS from file of size ", degree); } return prover_crs_; } @@ -73,7 +73,7 @@ std::shared_ptr> FileCrsFactory::g if (verifier_degree_ < degree || !verifier_crs_) { verifier_crs_ = std::make_shared>(path_, degree); verifier_degree_ = degree; - vinfo("Initializing ", Curve::name, " verifier CRS from file of size ", degree); + vinfo("Initialized ", Curve::name, " verifier CRS from file of size ", degree); } return verifier_crs_; } diff --git a/barretenberg/cpp/src/barretenberg/srs/factories/mem_bn254_crs_factory.cpp b/barretenberg/cpp/src/barretenberg/srs/factories/mem_bn254_crs_factory.cpp index 75c7f950147..7c41eeaf665 100644 --- a/barretenberg/cpp/src/barretenberg/srs/factories/mem_bn254_crs_factory.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/factories/mem_bn254_crs_factory.cpp @@ -52,7 +52,7 @@ MemBn254CrsFactory::MemBn254CrsFactory(std::vector const& po verifier_crs_ = std::make_shared(g2_point, g1_identity); - vinfo("Initializing ", + vinfo("Initialized ", curve::BN254::name, " prover CRS from memory with num points = ", prover_crs_->get_monomial_size()); diff --git a/barretenberg/cpp/src/barretenberg/srs/factories/mem_grumpkin_crs_factory.cpp b/barretenberg/cpp/src/barretenberg/srs/factories/mem_grumpkin_crs_factory.cpp index 88ab4bc3b16..e870b7de6c8 100644 --- a/barretenberg/cpp/src/barretenberg/srs/factories/mem_grumpkin_crs_factory.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/factories/mem_grumpkin_crs_factory.cpp @@ -45,7 +45,7 @@ MemGrumpkinCrsFactory::MemGrumpkinCrsFactory(std::vector>(points)) , verifier_crs_(std::make_shared(points)) { - vinfo("Initializing ", + vinfo("Initialized ", curve::Grumpkin::name, " prover CRS from memory with num points = ", prover_crs_->get_monomial_size()); diff --git a/barretenberg/cpp/src/barretenberg/srs/global_crs.cpp b/barretenberg/cpp/src/barretenberg/srs/global_crs.cpp index e9dc1882d95..40c5fefd02c 100644 --- a/barretenberg/cpp/src/barretenberg/srs/global_crs.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/global_crs.cpp @@ -21,7 +21,6 @@ void init_crs_factory(std::vector const& points, g2::affine_ // Initializes crs from a file path this we use in the entire codebase void init_crs_factory(std::string crs_path) { - info("CRS FACTORY INITIALIZED"); if (crs_factory != nullptr) { return; } diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp index 083236863f0..a24bb91a402 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp @@ -208,6 +208,7 @@ template class SumcheckProver { // compute_univariate also takes into account the zk_sumcheck_data. auto round_univariate = round.compute_univariate( round_idx, full_polynomials, relation_parameters, gate_separators, alpha, zk_sumcheck_data); + vinfo("starting sumcheck rounds..."); { PROFILE_THIS_NAME("rest of sumcheck round 1"); @@ -227,7 +228,6 @@ template class SumcheckProver { // release memory? // All but final round // We operate on partially_evaluated_polynomials in place. } - vinfo("completed sumcheck round 0"); for (size_t round_idx = 1; round_idx < multivariate_d; round_idx++) { PROFILE_THIS_NAME("sumcheck loop"); @@ -252,8 +252,8 @@ template class SumcheckProver { gate_separators.partially_evaluate(round_challenge); round.round_size = round.round_size >> 1; - vinfo("completed sumcheck round ", round_idx); } + vinfo("completed ", multivariate_d, " rounds of sumcheck"); // Check that the challenges \f$ u_0,\ldots, u_{d-1} \f$ do not satisfy the equation \f$ u_0(1-u_0) + \ldots + // u_{d-1} (1 - u_{d-1}) = 0 \f$. This equation is satisfied with probability ~ 1/|FF|, in such cases the prover // has to abort and start ZK Sumcheck anew. @@ -286,6 +286,7 @@ template class SumcheckProver { multivariate_evaluations, zk_sumcheck_data.libra_evaluations }; } + vinfo("finished sumcheck"); }; /** diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp index 0d6eab716e2..a8cd2258552 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp @@ -52,7 +52,6 @@ template class DeciderProvingKey_ { { PROFILE_THIS_NAME("DeciderProvingKey(Circuit&)"); vinfo("DeciderProvingKey(Circuit&)"); - vinfo("creating decider proving key"); circuit.finalize_circuit(/* ensure_nonzero = */ true); @@ -88,7 +87,6 @@ template class DeciderProvingKey_ { // Allocate the wires and selectors polynomials { PROFILE_THIS_NAME("allocating wires"); - vinfo("allocating wires"); for (auto& wire : proving_key.polynomials.get_wires()) { wire = Polynomial::shiftable(proving_key.circuit_size); @@ -96,7 +94,6 @@ template class DeciderProvingKey_ { } { PROFILE_THIS_NAME("allocating gate selectors"); - vinfo("allocating gate selectors"); // Define gate selectors over the block they are isolated to for (auto [selector, block] : @@ -118,7 +115,6 @@ template class DeciderProvingKey_ { } { PROFILE_THIS_NAME("allocating non-gate selectors"); - vinfo("allocating non-gate selectors"); // Set the other non-gate selector polynomials to full size for (auto& selector : proving_key.polynomials.get_non_gate_selectors()) { @@ -127,7 +123,6 @@ template class DeciderProvingKey_ { } if constexpr (IsGoblinFlavor) { PROFILE_THIS_NAME("allocating ecc op wires and selector"); - vinfo("allocating ecc op wires and selector"); // Allocate the ecc op wires and selector const size_t ecc_op_block_size = circuit.blocks.ecc_op.get_fixed_size(is_structured); @@ -166,7 +161,6 @@ template class DeciderProvingKey_ { size_t table_offset = dyadic_circuit_size - max_tables_size; { PROFILE_THIS_NAME("allocating table polynomials"); - vinfo("allocating table polynomials"); ASSERT(dyadic_circuit_size > max_tables_size); @@ -179,7 +173,6 @@ template class DeciderProvingKey_ { } { PROFILE_THIS_NAME("allocating sigmas and ids"); - vinfo("allocating sigmas and ids"); for (auto& sigma : proving_key.polynomials.get_sigmas()) { sigma = typename Flavor::Polynomial(proving_key.circuit_size); @@ -191,7 +184,6 @@ template class DeciderProvingKey_ { { ZoneScopedN("allocating lookup read counts and tags"); // Allocate the read counts and tags polynomials - vinfo("allocating lookup read counts and tags"); proving_key.polynomials.lookup_read_counts = typename Flavor::Polynomial(max_tables_size, dyadic_circuit_size, table_offset); proving_key.polynomials.lookup_read_tags = @@ -200,7 +192,6 @@ template class DeciderProvingKey_ { { ZoneScopedN("allocating lookup and databus inverses"); // Allocate the lookup_inverses polynomial - vinfo("allocating lookup and databus inverses"); const size_t lookup_offset = static_cast(circuit.blocks.lookup.trace_offset); // TODO(https://github.com/AztecProtocol/barretenberg/issues/1033): construct tables and counts // at top of trace @@ -236,7 +227,6 @@ template class DeciderProvingKey_ { { PROFILE_THIS_NAME("allocating lagrange polynomials"); - vinfo("allocating lagrange polynomials"); // First and last lagrange polynomials (in the full circuit size) proving_key.polynomials.lagrange_first = Polynomial(1, dyadic_circuit_size, 0); @@ -258,7 +248,6 @@ template class DeciderProvingKey_ { // If Goblin, construct the databus polynomials if constexpr (IsGoblinFlavor) { PROFILE_THIS_NAME("constructing databus polynomials"); - vinfo("constructing databus polynomials"); construct_databus_polynomials(circuit); } @@ -269,7 +258,6 @@ template class DeciderProvingKey_ { { PROFILE_THIS_NAME("constructing lookup table polynomials"); - vinfo("constructing lookup table polynomials"); construct_lookup_table_polynomials( proving_key.polynomials.get_tables(), circuit, dyadic_circuit_size); @@ -277,7 +265,6 @@ template class DeciderProvingKey_ { { PROFILE_THIS_NAME("constructing lookup read counts"); - vinfo("constructing lookup read counts"); construct_lookup_read_counts(proving_key.polynomials.lookup_read_counts, proving_key.polynomials.lookup_read_tags, diff --git a/yarn-project/bb-prover/src/bb/execute.ts b/yarn-project/bb-prover/src/bb/execute.ts index e7063eab90c..865bcafb9e0 100644 --- a/yarn-project/bb-prover/src/bb/execute.ts +++ b/yarn-project/bb-prover/src/bb/execute.ts @@ -222,7 +222,7 @@ export async function executeBbClientIvcProof( const args = ['-o', outputPath, '-b', bytecodeStackPath, '-w', witnessStackPath, '-v']; const timer = new Timer(); const logFunction = (message: string) => { - log(`client ivc proof BB out - ${message}`); + log(`bb - ${message}`); }; const result = await executeBB(pathToBB, 'client_ivc_prove_output_all_msgpack', args, logFunction); @@ -275,7 +275,7 @@ export async function executeBbClientIvcProveAndVerify( const args = ['-b', bytecodeStackPath, '-w', witnessStackPath, '-v']; const timer = new Timer(); const logFunction = (message: string) => { - log(`client ivc proof BB out - ${message}`); + log(`bb - ${message}`); }; const result = await executeBB(pathToBB, 'client_ivc_prove_and_verify', args, logFunction);