Skip to content

Commit 0554c68

Browse files
committed
remove more macros
1 parent e74aab7 commit 0554c68

1 file changed

Lines changed: 9 additions & 27 deletions

File tree

barretenberg/cpp/src/barretenberg/bbapi/bbapi_chonk.cpp

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ ChonkAccumulate::Response ChonkAccumulate::execute(BBApiRequest& request) &&
6969
throw_or_abort("No circuit loaded. Call ChonkLoad first.");
7070
}
7171

72-
acir_format::WitnessVector witness_data;
73-
{
74-
BB_BENCH_NAME("ChonkAccumulate::parse_witness");
75-
witness_data = acir_format::witness_buf_to_witness_vector(std::move(witness));
76-
}
72+
acir_format::WitnessVector witness_data = acir_format::witness_buf_to_witness_vector(std::move(witness));
7773
acir_format::AcirProgram program{ std::move(request.loaded_circuit_constraints.value()), std::move(witness_data) };
7874

7975
// Clear loaded state immediately after moving out of it. This ensures that if any subsequent
@@ -90,35 +86,24 @@ ChonkAccumulate::Response ChonkAccumulate::execute(BBApiRequest& request) &&
9086
const bool is_hiding_kernel = (request.ivc_stack_depth + 1 == chonk->get_num_circuits());
9187

9288
const acir_format::ProgramMetadata metadata{ .ivc = request.ivc_in_progress };
93-
IVCBase::ClientCircuit circuit;
94-
{
95-
BB_BENCH_NAME("ChonkAccumulate::create_circuit");
96-
circuit = acir_format::create_circuit<IVCBase::ClientCircuit>(program, metadata);
97-
}
89+
IVCBase::ClientCircuit circuit = acir_format::create_circuit<IVCBase::ClientCircuit>(program, metadata);
9890

9991
std::shared_ptr<Chonk::MegaVerificationKey> precomputed_vk;
10092

10193
if (request.vk_policy == VkPolicy::RECOMPUTE) {
10294
precomputed_vk = nullptr;
10395
} else if (request.vk_policy == VkPolicy::DEFAULT || request.vk_policy == VkPolicy::CHECK) {
10496
if (!loaded_vk.empty()) {
105-
{
106-
BB_BENCH_NAME("ChonkAccumulate::deserialize_vk");
107-
validate_vk_size<Chonk::MegaVerificationKey>(loaded_vk);
108-
precomputed_vk = from_buffer<std::shared_ptr<Chonk::MegaVerificationKey>>(loaded_vk);
109-
}
97+
validate_vk_size<Chonk::MegaVerificationKey>(loaded_vk);
98+
precomputed_vk = from_buffer<std::shared_ptr<Chonk::MegaVerificationKey>>(loaded_vk);
11099

111100
if (request.vk_policy == VkPolicy::CHECK) {
112101
// Note that MegaZKVerificationKey = MegaVerificationKey as C++ classes but their content differs
113102
// between ZK and non-ZK flavors.
114-
std::shared_ptr<Chonk::MegaVerificationKey> computed_vk;
115-
{
116-
BB_BENCH_NAME("ChonkAccumulate::compute_vk_for_check");
117-
computed_vk = is_hiding_kernel ? std::make_shared<Chonk::MegaVerificationKey>(
118-
Chonk::HidingKernelProverInstance(circuit).get_precomputed())
119-
: std::make_shared<Chonk::MegaVerificationKey>(
120-
Chonk::ProverInstance(circuit).get_precomputed());
121-
}
103+
auto computed_vk = is_hiding_kernel ? std::make_shared<Chonk::MegaVerificationKey>(
104+
Chonk::HidingKernelProverInstance(circuit).get_precomputed())
105+
: std::make_shared<Chonk::MegaVerificationKey>(
106+
Chonk::ProverInstance(circuit).get_precomputed());
122107

123108
// Dereference to compare VK contents
124109
if (*precomputed_vk != *computed_vk) {
@@ -135,10 +120,7 @@ ChonkAccumulate::Response ChonkAccumulate::execute(BBApiRequest& request) &&
135120
if (detail::use_memory_profile) {
136121
detail::GLOBAL_MEMORY_PROFILE.set_circuit_name(circuit_name);
137122
}
138-
{
139-
BB_BENCH_NAME("ChonkAccumulate::accumulate");
140-
request.ivc_in_progress->accumulate(circuit, precomputed_vk);
141-
}
123+
request.ivc_in_progress->accumulate(circuit, precomputed_vk);
142124
request.ivc_stack_depth++;
143125

144126
return Response{};

0 commit comments

Comments
 (0)