Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Dec 3, 2024
1 parent 2591215 commit 553cf54
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 66 deletions.
7 changes: 0 additions & 7 deletions barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ void ClientIVC::perform_recursive_verification_and_databus_consistency_checks(
}
}

// info("PRE-DB HASH = ", circuit.hash_circuit_for_debug());

// Set the return data commitment to be propagated on the public inputs of the present kernel and peform consistency
// checks between the calldata commitments and the return data commitments contained within the public inputs
bus_depot.set_return_data_to_be_propagated_and_perform_consistency_checks(
Expand All @@ -103,8 +101,6 @@ void ClientIVC::perform_recursive_verification_and_databus_consistency_checks(
decider_vk->witness_commitments.secondary_calldata,
decider_vk->public_inputs,
decider_vk->verification_key->databus_propagation_data);

// info("POST-DB HASH = ", circuit.hash_circuit_for_debug());
}

/**
Expand Down Expand Up @@ -137,16 +133,13 @@ void ClientIVC::complete_kernel_circuit_logic(ClientCircuit& circuit)
if (stdlib_verification_queue.empty()) {
instantiate_stdlib_verification_queue(circuit);
}
// info("HASH = ", circuit.hash_circuit_for_debug());

// Peform recursive verification and databus consistency checks for each entry in the verification queue
for (auto& [proof, vkey, type] : stdlib_verification_queue) {
perform_recursive_verification_and_databus_consistency_checks(circuit, proof, vkey, type);
}
stdlib_verification_queue.clear();

// info("POST HASH = ", circuit.hash_circuit_for_debug());

// Propagate return data commitments via the public inputs for use in databus consistency checks
bus_depot.propagate_return_data_commitments(circuit);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ClientIVC create_mock_ivc_from_constraints(const std::vector<RecursionConstraint
uint32_t oink_type = static_cast<uint32_t>(PROOF_TYPE::OINK);
uint32_t pg_type = static_cast<uint32_t>(PROOF_TYPE::PG);

// There are only three valid combinations of IVC recursion constraints:
// There are only three valid combinations of IVC recursion constraints for Aztec kernel circuits:

// Case: INIT kernel; single Oink recursive verification of an app
if (constraints.size() == 1 && constraints[0].proof_type == oink_type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ template <typename Flavor> void OinkRecursiveVerifier_<Flavor>::verify()
FF pub_inputs_offset = transcript->template receive_from_prover<FF>(domain_separator + "pub_inputs_offset");

if (static_cast<uint32_t>(circuit_size.get_value()) != verification_key->verification_key->circuit_size) {
info("Proof circuit size = ", circuit_size.get_value());
info("VK circuit size = ", verification_key->verification_key->circuit_size);
throw_or_abort("OinkRecursiveVerifier::verify: proof circuit size does not match verification key");
}
if (static_cast<uint32_t>(public_input_size.get_value()) != verification_key->verification_key->num_public_inputs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,8 @@ std::shared_ptr<typename DeciderVerificationKeys::DeciderVK> ProtogalaxyRecursiv
accumulator->target_sum =
perturbator_evaluation * lagranges[0] + vanishing_polynomial_at_challenge * combiner_quotient_at_challenge;

// if constexpr (!IsSimulator<Builder>) {
// info("HASH = ", builder->hash_circuit_for_debug());
// }

accumulator->gate_challenges = update_gate_challenges(perturbator_challenge, accumulator->gate_challenges, deltas);

// if constexpr (!IsSimulator<Builder>) {
// info("HASH = ", builder->hash_circuit_for_debug());
// }

// Set the accumulator circuit size data based on the max of the keys being accumulated
const size_t accumulator_log_circuit_size = keys_to_fold.get_max_log_circuit_size();
accumulator->verification_key->log_circuit_size = accumulator_log_circuit_size;
Expand All @@ -188,19 +180,11 @@ std::shared_ptr<typename DeciderVerificationKeys::DeciderVK> ProtogalaxyRecursiv
combination = linear_combination(to_combine, lagranges);
}

// if constexpr (!IsSimulator<Builder>) {
// info("HASH = ", builder->hash_circuit_for_debug());
// }

for (auto [combination, to_combine] :
zip_view(accumulator->relation_parameters.get_to_fold(), keys_to_fold.get_relation_parameters())) {
combination = linear_combination(to_combine, lagranges);
}

// if constexpr (!IsSimulator<Builder>) {
// info("HASH = ", builder->hash_circuit_for_debug());
// }

auto accumulator_vkey = accumulator->verification_key->get_all();
for (size_t i = 0; i < Flavor::NUM_PRECOMPUTED_ENTITIES; ++i) {
accumulator_vkey[i] = output_commitments[i];
Expand All @@ -211,10 +195,6 @@ std::shared_ptr<typename DeciderVerificationKeys::DeciderVK> ProtogalaxyRecursiv
accumulator_witnesses[i] = output_commitments[i + accumulator_vkey.size()];
}

// if constexpr (!IsSimulator<Builder>) {
// info("HASH = ", builder->hash_circuit_for_debug());
// }

return accumulator;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct DatabusPropagationData {
return os;
};

// Construct a class instance with the default settings for a kernel circuit
// Construct an instance of this class with the default settings for a kernel circuit
static DatabusPropagationData kernel_default()
{
DatabusPropagationData data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -865,41 +865,6 @@ class UltraCircuitBuilder_ : public CircuitBuilderBase<typename ExecutionTrace_:

uint256_t hash_circuit();

template <typename ExecutionTrace> uint256_t hash_circuit_for_debug()
{

std::vector<uint8_t> to_hash;

const auto convert_and_insert = [&to_hash](auto& vector) {
std::vector<uint8_t> buffer = to_buffer(vector);
to_hash.insert(to_hash.end(), buffer.begin(), buffer.end());
};

// DEBUG: selectors!
// for (auto& block : blocks.get()) {
// convert_and_insert(block.q_m());
// }
// for (auto& block : blocks.get()) {
// std::for_each(block.get_gate_selectors().begin(), block.get_gate_selectors().end(), convert_and_insert);
// }
for (auto& block : blocks.get()) {
std::for_each(block.selectors.begin(), block.selectors.end(), convert_and_insert);
}

// // DEBUG: wires!
// for (auto& block : blocks.get()) {
// std::for_each(block.wires.begin(), block.wires.end(), convert_and_insert);
// }

// for (auto& block : blocks.get()) {
// std::for_each(block.selectors.begin(), block.selectors.end(), convert_and_insert);
// std::for_each(block.wires.begin(), block.wires.end(), convert_and_insert);
// }
// convert_and_insert(this->real_variable_index);

return from_buffer<uint256_t>(crypto::sha256(to_hash));
}

msgpack::sbuffer export_circuit() override;
};
using UltraCircuitBuilder = UltraCircuitBuilder_<UltraExecutionTraceBlocks>;
Expand Down

0 comments on commit 553cf54

Please sign in to comment.