From 92015eb0a061b6af54496a4b00d3959b479cb9a5 Mon Sep 17 00:00:00 2001 From: codygunton Date: Thu, 11 Jul 2024 04:13:35 +0000 Subject: [PATCH] Tidy --- .../flows/prove_then_verify_client_ivc.sh | 4 +-- .../cpp/src/barretenberg/bb/file_io.hpp | 2 -- barretenberg/cpp/src/barretenberg/bb/main.cpp | 33 +++++++------------ .../barretenberg/client_ivc/client_ivc.cpp | 2 +- barretenberg/cpp/src/barretenberg/srs/io.hpp | 3 -- proving-systems.code-workspace | 11 ------- 6 files changed, 14 insertions(+), 41 deletions(-) diff --git a/barretenberg/acir_tests/flows/prove_then_verify_client_ivc.sh b/barretenberg/acir_tests/flows/prove_then_verify_client_ivc.sh index 5dcce9cd34f..eda013f0494 100755 --- a/barretenberg/acir_tests/flows/prove_then_verify_client_ivc.sh +++ b/barretenberg/acir_tests/flows/prove_then_verify_client_ivc.sh @@ -1,11 +1,9 @@ #!/bin/sh -set -eux +set -eu VFLAG=${VERBOSE:+-v} BFLAG="-b ./target/program.json" FLAGS="-c $CRS_PATH $VFLAG" -# Test we can perform the proof/verify flow. -# This ensures we test independent pk construction through real/garbage witness data paths. $BIN client_ivc_prove_output_all $FLAGS $BFLAG $BIN verify_client_ivc $FLAGS diff --git a/barretenberg/cpp/src/barretenberg/bb/file_io.hpp b/barretenberg/cpp/src/barretenberg/bb/file_io.hpp index 6bdc3574e0a..26838333446 100644 --- a/barretenberg/cpp/src/barretenberg/bb/file_io.hpp +++ b/barretenberg/cpp/src/barretenberg/bb/file_io.hpp @@ -1,7 +1,6 @@ #pragma once #include #include -#include #include #include #include @@ -46,7 +45,6 @@ inline void write_file(const std::string& filename, std::vector const& { std::ofstream file(filename, std::ios::binary); if (!file) { - info("current path: ", std::filesystem::current_path()); throw std::runtime_error("Failed to open data file for writing: " + filename); } file.write((char*)data.data(), (std::streamsize)data.size()); diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index 5bd700d9327..43fe0d0988d 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -371,12 +371,6 @@ void client_ivc_prove_output_all_msgpack(const std::string& bytecodePath, std::string translatorVkPath = outputDir + "/translator_vk"; std::string eccVkPath = outputDir + "/ecc_vk"; - vinfo("output vkPath: ", vkPath); - vinfo("output accPath: ", accPath); - vinfo("output proofPath: ", proofPath); - vinfo("output translatorVkPath: ", translatorVkPath); - vinfo("output eccVkPath: ", eccVkPath); - auto proof = ivc.prove(); auto eccvm_vk = std::make_shared(ivc.goblin.get_eccvm_proving_key()); auto translator_vk = std::make_shared(ivc.goblin.get_translator_proving_key()); @@ -384,14 +378,13 @@ void client_ivc_prove_output_all_msgpack(const std::string& bytecodePath, auto last_instance = std::make_shared(ivc.instance_vk); bool verified = ivc.verify(proof, { ivc.verifier_accumulator, last_instance }); vinfo("ensure valid proof: ", verified); - if (verified) { - vinfo("write proof and vk data to files.."); - write_file(proofPath, to_buffer(proof)); - write_file(vkPath, to_buffer(ivc.instance_vk)); - write_file(accPath, to_buffer(ivc.verifier_accumulator)); - write_file(translatorVkPath, to_buffer(translator_vk)); - write_file(eccVkPath, to_buffer(eccvm_vk)); - } + + vinfo("write proof and vk data to files.."); + write_file(proofPath, to_buffer(proof)); + write_file(vkPath, to_buffer(ivc.instance_vk)); + write_file(accPath, to_buffer(ivc.verifier_accumulator)); + write_file(translatorVkPath, to_buffer(translator_vk)); + write_file(eccVkPath, to_buffer(eccvm_vk)); } template std::shared_ptr read_to_shared_ptr(const std::filesystem::path& path) @@ -420,17 +413,15 @@ bool verify_client_ivc(const std::filesystem::path& proof_path, init_bn254_crs(1 << 24); init_grumpkin_crs(1 << 14); - using GrumpkinVk = bb::VerifierCommitmentKey; - using BN254Vk = bb::VerifierCommitmentKey; - /* WORKTODO const */ auto proof = from_buffer(read_file(proof_path)); - // Read the proof and verification data from given files + const auto proof = from_buffer(read_file(proof_path)); const auto accumulator = read_to_shared_ptr(accumulator_path); - accumulator->verification_key->pcs_verification_key = std::make_shared(); + accumulator->verification_key->pcs_verification_key = std::make_shared>(); const auto final_vk = read_to_shared_ptr(final_vk_path); const auto eccvm_vk = read_to_shared_ptr(eccvm_vk_path); - eccvm_vk->pcs_verification_key = std::make_shared(eccvm_vk->circuit_size + 1); + eccvm_vk->pcs_verification_key = + std::make_shared>(eccvm_vk->circuit_size + 1); const auto translator_vk = read_to_shared_ptr(translator_vk_path); - translator_vk->pcs_verification_key = std::make_shared(); + translator_vk->pcs_verification_key = std::make_shared>(); const bool verified = ClientIVC::verify( proof, accumulator, std::make_shared(final_vk), eccvm_vk, translator_vk); diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp index 8a616e80c05..507a1dbe878 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp @@ -77,7 +77,7 @@ bool ClientIVC::verify(const Proof& proof, ClientIVC::DeciderVerifier decider_verifier(verifier_accumulator); bool decision = decider_verifier.verify_proof(proof.decider_proof); return goblin_verified && decision; -}; +} /** * @brief Verify a full proof of the IVC diff --git a/barretenberg/cpp/src/barretenberg/srs/io.hpp b/barretenberg/cpp/src/barretenberg/srs/io.hpp index 6c73d592e3c..24397f47608 100644 --- a/barretenberg/cpp/src/barretenberg/srs/io.hpp +++ b/barretenberg/cpp/src/barretenberg/srs/io.hpp @@ -3,7 +3,6 @@ #include "../ecc/curves/grumpkin/grumpkin.hpp" #include #include -#include #include #include #include @@ -308,8 +307,6 @@ template class IO { const bool monomial_srs_condition = num_read < degree; if (monomial_srs_condition) { - info("path when failing to get crs: ", path); - info("filesystem::current_path when failing to get crs: ", std::filesystem::current_path()); throw_or_abort( format("Only read ", num_read, diff --git a/proving-systems.code-workspace b/proving-systems.code-workspace index 492eb7580a3..be204f2c9b4 100644 --- a/proving-systems.code-workspace +++ b/proving-systems.code-workspace @@ -147,15 +147,4 @@ "console": "internalConsole", } }, - "launch": { - "version": "0.2.0", - "configurations": [ - { - "type": "lldb", - "request": "attach", - "name": "Attach to running lldb process", - "pid": "${command:pickMyProcess}" // use ${command:pickProcess} to pick other users' processes - } - ] - }, } \ No newline at end of file