Skip to content

Commit

Permalink
fix: use circuit_sat instead of proving for now
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasRidhuan committed Mar 10, 2024
1 parent 4af4ff9 commit 50031e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 13 additions & 8 deletions barretenberg/cpp/src/barretenberg/bb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,15 +509,20 @@ void avm_prove(const std::filesystem::path& bytecode_path,
bool avm_verify(const std::filesystem::path& proof_path)
{
std::filesystem::path vk_path = proof_path.parent_path() / "vk";
std::vector<fr> const proof = many_from_buffer<fr>(read_file(proof_path));

std::vector<uint8_t> vk_bytes = read_file(vk_path);
auto circuit_size = from_buffer<size_t>(vk_bytes, 0);
auto num_public_inputs = from_buffer<size_t>(vk_bytes, sizeof(size_t));
auto vk = AvmFlavor::VerificationKey(circuit_size, num_public_inputs);

std::cout << avm_trace::Execution::verify(vk, proof);
return avm_trace::Execution::verify(vk, proof);
// Actual verification temporarily stopped (#4954)
// std::vector<fr> const proof = many_from_buffer<fr>(read_file(proof_path));
//
// std::vector<uint8_t> vk_bytes = read_file(vk_path);
// auto circuit_size = from_buffer<size_t>(vk_bytes, 0);
// auto _num_public_inputs = from_buffer<size_t>(vk_bytes, sizeof(size_t));
// auto vk = AvmFlavor::VerificationKey(circuit_size, num_public_inputs);
//
// std::cout << avm_trace::Execution::verify(vk, proof);
// return avm_trace::Execution::verify(vk, proof);

std::cout << 1;
return true;
}

bool flag_present(std::vector<std::string>& args, const std::string& flag)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "barretenberg/vm/avm_trace/avm_opcode.hpp"
#include "barretenberg/vm/avm_trace/avm_trace.hpp"
#include "barretenberg/vm/generated/avm_composer.hpp"
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <string>
Expand Down Expand Up @@ -50,6 +51,9 @@ std::tuple<AvmFlavor::VerificationKey, HonkProof> Execution::prove(std::vector<u
auto circuit_builder = bb::AvmCircuitBuilder();
circuit_builder.set_trace(std::move(trace));

// Temporarily use this until #4954 is resolved
assert(circuit_builder.check_circuit());

auto composer = AvmComposer();
auto prover = composer.create_prover(circuit_builder);
auto verifier = composer.create_verifier(circuit_builder);
Expand Down

0 comments on commit 50031e9

Please sign in to comment.