Skip to content

Commit

Permalink
Changing logs back (#1865)
Browse files Browse the repository at this point in the history
* Change logs back and disable defi-bridge-project filter

* Switch filtering back to defi-bridge
  • Loading branch information
Rumata888 authored Dec 5, 2022
1 parent ac153f5 commit 98e05a1
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 49 deletions.
70 changes: 49 additions & 21 deletions src/aztec/rollup/proofs/compute_circuit_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ circuit_data get_circuit_data(std::string const& name,
bool vk,
bool padding,
bool mock,
F const& build_circuit)
F const& build_circuit,
std::string const name_suffix_for_benchmarks = "")
{
circuit_data data;
data.srs = srs;
Expand All @@ -71,18 +72,27 @@ circuit_data get_circuit_data(std::string const& name,
Timer timer;
build_circuit(composer);

benchmark_collator.benchmark_info_deferred(
GET_COMPOSER_NAME_STRING(ComposerType), "Core", name, "Build time", timer.toString());
benchmark_collator.benchmark_info_deferred(
GET_COMPOSER_NAME_STRING(ComposerType), "Core", name, "Gates", composer.get_num_gates());
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name + name_suffix_for_benchmarks,
"Build time",
timer.toString());
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name + name_suffix_for_benchmarks,
"Gates",
composer.get_num_gates());
info(name, ": Circuit built in: ", timer.toString(), "s");
info(name, ": Circuit size: ", composer.get_num_gates());
if (mock) {
auto public_inputs = composer.get_public_inputs();
mock::mock_circuit(mock_proof_composer, public_inputs);
info(name, ": Mock circuit size: ", mock_proof_composer.get_num_gates());
benchmark_collator.benchmark_info_deferred(
GET_COMPOSER_NAME_STRING(ComposerType), "Core", name, "Mock Gates", composer.get_num_gates());
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name + name_suffix_for_benchmarks,
"Mock Gates",
composer.get_num_gates());
}
}

Expand All @@ -103,8 +113,11 @@ circuit_data get_circuit_data(std::string const& name,
std::make_shared<waffle::proving_key>(std::move(pk_data), srs->get_prover_crs(pk_data.n + 1));
data.num_gates = pk_data.n;
info(name, ": Circuit size 2^n: ", data.num_gates);
benchmark_collator.benchmark_info_deferred(
GET_COMPOSER_NAME_STRING(ComposerType), "Core", name, "Gates 2^n", data.num_gates);
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name + name_suffix_for_benchmarks,
"Gates 2^n",
data.num_gates);
} else if (compute) {
Timer timer;
info(name, ": Computing proving key...");
Expand All @@ -114,20 +127,29 @@ circuit_data get_circuit_data(std::string const& name,
data.proving_key = composer.compute_proving_key();
info(name, ": Circuit size 2^n: ", data.proving_key->n);

benchmark_collator.benchmark_info_deferred(
GET_COMPOSER_NAME_STRING(ComposerType), "Core", name, "Gates 2^n", data.proving_key->n);
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name + name_suffix_for_benchmarks,
"Gates 2^n",
data.proving_key->n);
} else {
data.num_gates = mock_proof_composer.get_num_gates();
data.proving_key = mock_proof_composer.compute_proving_key();
info(name, ": Mock circuit size 2^n: ", data.proving_key->n);
benchmark_collator.benchmark_info_deferred(
GET_COMPOSER_NAME_STRING(ComposerType), "Core", name, "Mock Gates 2^n", data.proving_key->n);
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name + name_suffix_for_benchmarks,
"Mock Gates 2^n",
data.proving_key->n);
}

info(name, ": Proving key computed in ", timer.toString(), "s");

benchmark_collator.benchmark_info_deferred(
GET_COMPOSER_NAME_STRING(ComposerType), "Core", name, "Proving key computed in", timer.toString());
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name + name_suffix_for_benchmarks,
"Proving key computed in",
timer.toString());
if (save) {
info(name, ": Saving proving key...");
std::filesystem::create_directories(pk_dir.c_str());
Expand All @@ -153,7 +175,7 @@ circuit_data get_circuit_data(std::string const& name,
info(name, ": Verification key hash: ", data.verification_key->sha256_hash());
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name,
name + name_suffix_for_benchmarks,
"Verification key hash",
data.verification_key->sha256_hash());
} else if (compute) {
Expand All @@ -167,12 +189,15 @@ circuit_data get_circuit_data(std::string const& name,
}
info(name, ": Computed verification key in ", timer.toString(), "s");

benchmark_collator.benchmark_info_deferred(
GET_COMPOSER_NAME_STRING(ComposerType), "Core", name, "Verification key computed in", timer.toString());
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name + name_suffix_for_benchmarks,
"Verification key computed in",
timer.toString());
info(name, ": Verification key hash: ", data.verification_key->sha256_hash());
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name,
name + name_suffix_for_benchmarks,
"Verification key hash",
data.verification_key->sha256_hash());

Expand Down Expand Up @@ -219,8 +244,11 @@ circuit_data get_circuit_data(std::string const& name,
info(name, ": Padding verified: ", verifier.verify_proof(proof));
}
info(name, ": Padding proof computed in ", timer.toString(), "s");
benchmark_collator.benchmark_info_deferred(
GET_COMPOSER_NAME_STRING(ComposerType), "Core", name, "Padding proof computed in", timer.toString());
benchmark_collator.benchmark_info_deferred(GET_COMPOSER_NAME_STRING(ComposerType),
"Core",
name + name_suffix_for_benchmarks,
"Padding proof computed in",
timer.toString());

if (save) {
std::ofstream os(padding_path);
Expand Down
27 changes: 14 additions & 13 deletions src/aztec/rollup/proofs/rollup/compute_circuit_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,20 @@ inline circuit_data get_circuit_data(size_t rollup_size,
rollup_circuit(composer, rollup, verification_keys, rollup_size);
};

auto cd = proofs::get_circuit_data<Composer>("tx rollup " + std::to_string(rollup_size) + "x" +
std::to_string(rollup_size_pow2),
name,
srs,
key_path,
compute,
save,
load,
pk,
vk,
true,
mock,
build_circuit);
auto cd =
proofs::get_circuit_data<Composer>("tx rollup",
name,
srs,
key_path,
compute,
save,
load,
pk,
vk,
true,
mock,
build_circuit,
" " + std::to_string(rollup_size) + "x" + std::to_string(rollup_size_pow2));

circuit_data data;
data.num_gates = cd.num_gates;
Expand Down
26 changes: 13 additions & 13 deletions src/aztec/rollup/proofs/root_rollup/compute_circuit_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ circuit_data get_circuit_data(size_t num_inner_rollups,
rollup_circuit_data.verification_key);
};

auto cd =
proofs::get_circuit_data<Composer>(format("root rollup ", rollup_circuit_data.num_txs, "x", num_inner_rollups),
name,
srs,
key_path,
compute,
save,
load,
pk,
vk,
true,
mock,
build_circuit);
auto cd = proofs::get_circuit_data<Composer>("root rollup",
name,
srs,
key_path,
compute,
save,
load,
pk,
vk,
true,
mock,
build_circuit,
format(" ", rollup_circuit_data.num_txs, "x", num_inner_rollups));

circuit_data data;
data.num_gates = cd.num_gates;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ inline circuit_data get_circuit_data(root_rollup::circuit_data const& root_rollu

auto cd = proofs::get_circuit_data<OuterComposer>(

format("root verifier ", root_rollup_circuit_data.inner_rollup_circuit_data.rollup_size, "x", valid_vks.size()),
"root verifier",
name,
srs,
key_path,
Expand All @@ -45,7 +45,8 @@ inline circuit_data get_circuit_data(root_rollup::circuit_data const& root_rollu
vk,
false,
mock,
build_verifier_circuit);
build_verifier_circuit,
format(" ", root_rollup_circuit_data.inner_rollup_circuit_data.rollup_size, "x", valid_vks.size()));

circuit_data data;
data.num_gates = cd.num_gates;
Expand Down

0 comments on commit 98e05a1

Please sign in to comment.