Skip to content

Commit

Permalink
Tweak logging
Browse files Browse the repository at this point in the history
  • Loading branch information
codygunton committed Oct 24, 2024
1 parent 3723307 commit 24be2f4
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 31 deletions.
5 changes: 3 additions & 2 deletions barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void ClientIVC::accumulate(ClientCircuit& circuit, const std::shared_ptr<Verific
proving_key->gate_challenges = std::vector<FF>(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(
Expand Down Expand Up @@ -267,9 +267,10 @@ bool ClientIVC::verify(const Proof& proof, const std::vector<std::shared_ptr<Dec
*/
HonkProof ClientIVC::decider_prove() const
{
info("prove decider");
info("prove decider...");
MegaDeciderProver decider_prover(fold_output.accumulator);
return decider_prover.construct_proof();
info("finished decider proving.");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ void build_constraints(Builder& builder,
bool honk_recursion,
bool collect_gates_per_opcode)
{
info("building constraints...");
if (collect_gates_per_opcode) {
constraint_system.gates_per_opcode.resize(constraint_system.num_acir_opcodes, 0);
}
Expand Down Expand Up @@ -276,7 +275,6 @@ void build_constraints(Builder& builder,
builder.add_recursive_proof(current_aggregation_object);
}
}
info("constraints built!");
}

void process_plonk_recursion_constraints(Builder& builder,
Expand Down
6 changes: 4 additions & 2 deletions barretenberg/cpp/src/barretenberg/goblin/goblin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,15 @@ class GoblinProver {
goblin_proof.merge_proof = merge_proof_in.empty() ? std::move(merge_proof) : std::move(merge_proof_in);
{
PROFILE_THIS_NAME("prove_eccvm");
info("prove eccvm:");
info("prove eccvm...");
prove_eccvm();
info("finished eccvm proving.");
}
{
PROFILE_THIS_NAME("prove_translator");
info("prove translator:");
info("prove translator...");
prove_translator();
info("finished translator proving.");
}
return goblin_proof;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ FoldingResult<typename DeciderProvingKeys::Flavor> ProtogalaxyProver_<DeciderPro
}
}
run_oink_prover_on_each_incomplete_key();
vinfo("ran oink prover on each incomplete key");
vinfo("oink prover on each incomplete key");

std::tie(deltas, perturbator) = perturbator_round(accumulator);
vinfo("ran perturbator round");
vinfo("perturbator round");

std::tie(accumulator->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<Flavor> result = update_target_sum_and_fold(
keys_to_fold, combiner_quotient, alphas, relation_parameters, perturbator_evaluation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ std::shared_ptr<bb::srs::factories::ProverCrs<Curve>> FileCrsFactory<Curve>::get
if (prover_degree_ < degree || !prover_crs_) {
prover_crs_ = std::make_shared<FileProverCrs<Curve>>(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_;
}
Expand All @@ -73,7 +73,7 @@ std::shared_ptr<bb::srs::factories::VerifierCrs<Curve>> FileCrsFactory<Curve>::g
if (verifier_degree_ < degree || !verifier_crs_) {
verifier_crs_ = std::make_shared<FileVerifierCrs<Curve>>(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_;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ MemBn254CrsFactory::MemBn254CrsFactory(std::vector<g1::affine_element> const& po

verifier_crs_ = std::make_shared<MemVerifierCrs>(g2_point, g1_identity);

vinfo("Initializing ",
vinfo("Initialized ",
curve::BN254::name,
" prover CRS from memory with num points = ",
prover_crs_->get_monomial_size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ MemGrumpkinCrsFactory::MemGrumpkinCrsFactory(std::vector<Grumpkin::AffineElement
: prover_crs_(std::make_shared<MemProverCrs<Grumpkin>>(points))
, verifier_crs_(std::make_shared<MemVerifierCrs>(points))
{
vinfo("Initializing ",
vinfo("Initialized ",
curve::Grumpkin::name,
" prover CRS from memory with num points = ",
prover_crs_->get_monomial_size());
Expand Down
1 change: 0 additions & 1 deletion barretenberg/cpp/src/barretenberg/srs/global_crs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ void init_crs_factory(std::vector<g1::affine_element> 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;
}
Expand Down
5 changes: 3 additions & 2 deletions barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ template <typename Flavor> 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");
Expand All @@ -227,7 +228,6 @@ template <typename Flavor> 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");
Expand All @@ -252,8 +252,8 @@ template <typename Flavor> 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.
Expand Down Expand Up @@ -286,6 +286,7 @@ template <typename Flavor> class SumcheckProver {
multivariate_evaluations,
zk_sumcheck_data.libra_evaluations };
}
vinfo("finished sumcheck");
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ template <IsHonkFlavor Flavor> class DeciderProvingKey_ {
{
PROFILE_THIS_NAME("DeciderProvingKey(Circuit&)");
vinfo("DeciderProvingKey(Circuit&)");
vinfo("creating decider proving key");

circuit.finalize_circuit(/* ensure_nonzero = */ true);

Expand Down Expand Up @@ -88,15 +87,13 @@ template <IsHonkFlavor Flavor> 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);
}
}
{
PROFILE_THIS_NAME("allocating gate selectors");
vinfo("allocating gate selectors");

// Define gate selectors over the block they are isolated to
for (auto [selector, block] :
Expand All @@ -118,7 +115,6 @@ template <IsHonkFlavor Flavor> 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()) {
Expand All @@ -127,7 +123,6 @@ template <IsHonkFlavor Flavor> class DeciderProvingKey_ {
}
if constexpr (IsGoblinFlavor<Flavor>) {
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);
Expand Down Expand Up @@ -166,7 +161,6 @@ template <IsHonkFlavor Flavor> 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);

Expand All @@ -179,7 +173,6 @@ template <IsHonkFlavor Flavor> 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);
Expand All @@ -191,7 +184,6 @@ template <IsHonkFlavor Flavor> 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 =
Expand All @@ -200,7 +192,6 @@ template <IsHonkFlavor Flavor> 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<size_t>(circuit.blocks.lookup.trace_offset);
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1033): construct tables and counts
// at top of trace
Expand Down Expand Up @@ -236,7 +227,6 @@ template <IsHonkFlavor Flavor> 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);
Expand All @@ -258,7 +248,6 @@ template <IsHonkFlavor Flavor> class DeciderProvingKey_ {
// If Goblin, construct the databus polynomials
if constexpr (IsGoblinFlavor<Flavor>) {
PROFILE_THIS_NAME("constructing databus polynomials");
vinfo("constructing databus polynomials");

construct_databus_polynomials(circuit);
}
Expand All @@ -269,15 +258,13 @@ template <IsHonkFlavor Flavor> class DeciderProvingKey_ {

{
PROFILE_THIS_NAME("constructing lookup table polynomials");
vinfo("constructing lookup table polynomials");

construct_lookup_table_polynomials<Flavor>(
proving_key.polynomials.get_tables(), circuit, dyadic_circuit_size);
}

{
PROFILE_THIS_NAME("constructing lookup read counts");
vinfo("constructing lookup read counts");

construct_lookup_read_counts<Flavor>(proving_key.polynomials.lookup_read_counts,
proving_key.polynomials.lookup_read_tags,
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/bb-prover/src/bb/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 24be2f4

Please sign in to comment.