diff --git a/barretenberg/Earthfile b/barretenberg/Earthfile index 64515490646..9eff98f64c5 100644 --- a/barretenberg/Earthfile +++ b/barretenberg/Earthfile @@ -40,8 +40,6 @@ barretenberg-acir-tests-bb: RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh # Fold and verify an ACIR program stack using ClientIvc RUN FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic - # This is a "full" Goblin flow. It constructs and verifies four proofs: MegaHonk, ECCVM, Translator, and merge - RUN FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array # Run 1_mul through native bb build, all_cmds flow, to test all cli args. RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul @@ -88,8 +86,6 @@ barretenberg-acir-tests-bb.js: RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh 6_array # Run a single arbitrary test not involving recursion through bb.js for MegaHonk RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_mega_honk ./run_acir_tests.sh 6_array - # Run a single arbitrary test not involving recursion through bb.js for full Goblin - RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array # Run 1_mul through bb.js build, all_cmds flow, to test all cli args. RUN BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_acir_tests.sh 1_mul # TODO(https://github.com/AztecProtocol/aztec-packages/issues/6672) diff --git a/barretenberg/acir_tests/Dockerfile.bb.js b/barretenberg/acir_tests/Dockerfile.bb.js index dd5269e6902..c33992fc62d 100644 --- a/barretenberg/acir_tests/Dockerfile.bb.js +++ b/barretenberg/acir_tests/Dockerfile.bb.js @@ -27,8 +27,6 @@ RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_ultra_honk ./run_acir_test RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_mega_honk ./run_acir_tests.sh 6_array # Fold and verify an ACIR program stack RUN BIN=../ts/dest/node/main.js FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic -# Run a single arbitrary test not involving recursion through bb.js for full Goblin -RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array # Run 1_mul through bb.js build, all_cmds flow, to test all cli args. RUN BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_acir_tests.sh 1_mul # TODO(https://github.com/AztecProtocol/aztec-packages/issues/6672) diff --git a/barretenberg/acir_tests/flows/prove_and_verify_goblin.sh b/barretenberg/acir_tests/flows/prove_and_verify_goblin.sh deleted file mode 100755 index 23340df80a1..00000000000 --- a/barretenberg/acir_tests/flows/prove_and_verify_goblin.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -eu - -VFLAG=${VERBOSE:+-v} - -$BIN prove_and_verify_goblin $VFLAG -c $CRS_PATH -b ./target/program.json - -# This command can be used to run all of the tests in sequence with the debugger -# lldb-16 -o run -b -- $BIN prove_and_verify_goblin $VFLAG -c $CRS_PATH -b ./target/program.json diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index 091c87ad0cb..2ee1a5e6211 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -248,45 +247,6 @@ bool foldAndVerifyProgram(const std::string& bytecodePath, const std::string& wi return ivc.prove_and_verify(); } -/** - * @brief Proves and Verifies an ACIR circuit - * - * Communication: - * - proc_exit: A boolean value is returned indicating whether the proof is valid. - * an exit code of 0 will be returned for success and 1 for failure. - * - * @param bytecodePath Path to the file containing the serialized circuit - * @param witnessPath Path to the file containing the serialized witness - * @param recursive Whether to use recursive proof generation of non-recursive - * @return true if the proof is valid - * @return false if the proof is invalid - */ -bool proveAndVerifyGoblin(const std::string& bytecodePath, const std::string& witnessPath) -{ - // TODO(https://github.com/AztecProtocol/barretenberg/issues/811): Don't hardcode dyadic circuit size. Currently set - // to max circuit size present in acir tests suite. - size_t hardcoded_bn254_dyadic_size_hack = 1 << 19; - init_bn254_crs(hardcoded_bn254_dyadic_size_hack); - size_t hardcoded_grumpkin_dyadic_size_hack = 1 << 10; // For eccvm only - init_grumpkin_crs(hardcoded_grumpkin_dyadic_size_hack); - - // Populate the acir constraint system and witness from gzipped data - auto constraint_system = get_constraint_system(bytecodePath); - auto witness = get_witness(witnessPath); - - // Instantiate a Goblin acir composer and construct a bberg circuit from the acir representation - acir_proofs::GoblinAcirComposer acir_composer; - acir_composer.create_circuit(constraint_system, witness); - - // Generate a MegaHonk proof and a full Goblin proof - auto proof = acir_composer.accumulate_and_prove(); - - // Verify the MegaHonk proof and the full Goblin proof - auto verified = acir_composer.verify(proof); - - return verified; -} - /** * @brief Creates a proof for an ACIR circuit * @@ -867,9 +827,6 @@ int main(int argc, char* argv[]) if (command == "fold_and_verify_program") { return foldAndVerifyProgram(bytecode_path, witness_path) ? 0 : 1; } - if (command == "prove_and_verify_goblin") { - return proveAndVerifyGoblin(bytecode_path, witness_path) ? 0 : 1; - } if (command == "prove") { std::string output_path = get_option(args, "-o", "./proofs/proof"); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp index b0fe2da200e..d7ba6ba9b86 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp @@ -7,7 +7,6 @@ #include "barretenberg/common/serialize.hpp" #include "barretenberg/common/slab_allocator.hpp" #include "barretenberg/dsl/acir_format/acir_format.hpp" -#include "barretenberg/dsl/acir_proofs/goblin_acir_composer.hpp" #include "barretenberg/plonk/proof_system/proving_key/serialize.hpp" #include "barretenberg/plonk/proof_system/verification_key/verification_key.hpp" #include "barretenberg/srs/global_crs.hpp" @@ -28,11 +27,6 @@ WASM_EXPORT void acir_new_acir_composer(uint32_t const* size_hint, out_ptr out) *out = new acir_proofs::AcirComposer(ntohl(*size_hint)); } -WASM_EXPORT void acir_new_goblin_acir_composer(out_ptr out) -{ - *out = new acir_proofs::GoblinAcirComposer(); -} - WASM_EXPORT void acir_delete_acir_composer(in_ptr acir_composer_ptr) { delete reinterpret_cast(*acir_composer_ptr); @@ -122,23 +116,6 @@ WASM_EXPORT void acir_prove_and_verify_mega_honk(uint8_t const* acir_vec, uint8_ *result = verifier.verify_proof(proof); } -WASM_EXPORT void acir_goblin_prove(in_ptr acir_composer_ptr, - uint8_t const* acir_vec, - uint8_t const* witness_vec, - uint8_t** out) -{ - auto acir_composer = reinterpret_cast(*acir_composer_ptr); - auto constraint_system = acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec)); - auto witness = acir_format::witness_buf_to_witness_data(from_buffer>(witness_vec)); - - acir_composer->create_circuit(constraint_system, witness); - auto proof = acir_composer->accumulate_and_prove(); - auto proof_data_buf = to_buffer( - proof); // template parameter needs to be set so that vector deserialization from - // buffer, which reads the size at the beginning can be done properly - *out = to_heap_buffer(proof_data_buf); -} - WASM_EXPORT void acir_load_verification_key(in_ptr acir_composer_ptr, uint8_t const* vk_buf) { auto acir_composer = reinterpret_cast(*acir_composer_ptr); @@ -170,14 +147,6 @@ WASM_EXPORT void acir_get_proving_key(in_ptr acir_composer_ptr, uint8_t const* a *out = to_heap_buffer(to_buffer(*pk)); } -WASM_EXPORT void acir_goblin_verify(in_ptr acir_composer_ptr, uint8_t const* proof_buf, bool* result) -{ - auto acir_composer = reinterpret_cast(*acir_composer_ptr); - auto proof_data_buf = from_buffer>(proof_buf); - auto proof = from_buffer>(proof_data_buf); - *result = acir_composer->verify(proof); -} - WASM_EXPORT void acir_verify_proof(in_ptr acir_composer_ptr, uint8_t const* proof_buf, bool* result) { auto acir_composer = reinterpret_cast(*acir_composer_ptr); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp index 78f6eae51e7..72d856cc94d 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp @@ -13,8 +13,6 @@ WASM_EXPORT void acir_get_circuit_sizes(uint8_t const* constraint_system_buf, WASM_EXPORT void acir_new_acir_composer(uint32_t const* size_hint, out_ptr out); -WASM_EXPORT void acir_new_goblin_acir_composer(out_ptr out); - WASM_EXPORT void acir_delete_acir_composer(in_ptr acir_composer_ptr); WASM_EXPORT void acir_create_circuit(in_ptr acir_composer_ptr, @@ -57,16 +55,6 @@ WASM_EXPORT void acir_fold_and_verify_program_stack(uint8_t const* constraint_sy uint8_t const* witness_buf, bool* result); -/** - * @brief Construct a full goblin proof - * @details Makes a call to accumulate to a final circuit before constructing a Goblin proof - * - */ -WASM_EXPORT void acir_goblin_prove(in_ptr acir_composer_ptr, - uint8_t const* constraint_system_buf, - uint8_t const* witness_buf, - uint8_t** out); - WASM_EXPORT void acir_load_verification_key(in_ptr acir_composer_ptr, uint8_t const* vk_buf); WASM_EXPORT void acir_init_verification_key(in_ptr acir_composer_ptr); @@ -77,12 +65,6 @@ WASM_EXPORT void acir_get_proving_key(in_ptr acir_composer_ptr, uint8_t const* a WASM_EXPORT void acir_verify_proof(in_ptr acir_composer_ptr, uint8_t const* proof_buf, bool* result); -/** - * @brief Verifies a full goblin proof (and the MegaHonk proof produced by accumulation) - * - */ -WASM_EXPORT void acir_goblin_verify(in_ptr acir_composer_ptr, uint8_t const* proof_buf, bool* result); - WASM_EXPORT void acir_get_solidity_verifier(in_ptr acir_composer_ptr, out_str_buf out); WASM_EXPORT void acir_serialize_proof_into_fields(in_ptr acir_composer_ptr, diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/goblin_acir_composer.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/goblin_acir_composer.cpp deleted file mode 100644 index 3b4561697be..00000000000 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/goblin_acir_composer.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "goblin_acir_composer.hpp" -#include "barretenberg/common/throw_or_abort.hpp" -#include "barretenberg/dsl/acir_format/acir_format.hpp" -#include "barretenberg/dsl/types.hpp" -#include "barretenberg/goblin/mock_circuits.hpp" - -namespace acir_proofs { - -void GoblinAcirComposer::create_circuit(acir_format::AcirFormat& constraint_system, acir_format::WitnessVector& witness) -{ - // Construct a builder using the witness and public input data from acir and with the goblin-owned op_queue - builder_ = acir_format::GoblinBuilder{ - goblin.op_queue, witness, constraint_system.public_inputs, constraint_system.varnum - }; - - // Populate constraints in the builder via the data in constraint_system - acir_format::build_constraints(builder_, constraint_system, true); - - // TODO(https://github.com/AztecProtocol/barretenberg/issues/817): Add some arbitrary op gates to ensure the - // to give ECCVM and Translator some ECC ops to process. - MockCircuits::construct_goblin_ecc_op_circuit(builder_); -} - -std::vector GoblinAcirComposer::accumulate_and_prove() -{ - // Construct one final MegaHonk proof via the accumulate mechanism - std::vector ultra_proof = goblin.accumulate_for_acir(builder_); - - // Construct a Goblin proof (ECCVM, Translator, Merge); result stored internally - goblin.prove_for_acir(); - - return ultra_proof; -} - -bool GoblinAcirComposer::verify(std::vector const& proof) -{ - // Verify the final MegaHonk proof - bool ultra_verified = goblin.verify_accumulator_for_acir(proof); - - // Verify the Goblin proof (ECCVM, Translator, Merge) - bool goblin_verified = goblin.verify_for_acir(); - - return ultra_verified && goblin_verified; -} - -} // namespace acir_proofs diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/goblin_acir_composer.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/goblin_acir_composer.hpp deleted file mode 100644 index 4451c875653..00000000000 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/goblin_acir_composer.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once -#include -#include - -namespace acir_proofs { - -/** - * @brief A class responsible for marshalling construction of keys and prover and verifier instances used to prove - * satisfiability of circuits written in ACIR. - * - */ -class GoblinAcirComposer { - - using WitnessVector = std::vector>; - - public: - GoblinAcirComposer() = default; - - /** - * @brief Create a MegaHonk circuit from an acir constraint system and a witness - * - * @param constraint_system ACIR representation of the constraints defining the circuit - * @param witness The witness values known to ACIR during construction of the constraint system - */ - void create_circuit(acir_format::AcirFormat& constraint_system, acir_format::WitnessVector& witness); - - /** - * @brief Accumulate a final circuit and construct a full Goblin proof - * @details Accumulation means constructing a MegaHonk proof of a single (final) circuit. A full Goblin proof - * consists of a merge proof, an ECCVM proof and a Translator proof. The Goblin proof is only constructed at the end - * of the accumulation phase and establishes the correctness of the ECC operations written to the op queue - * throughout the accumulation phase. - * - */ - std::vector accumulate_and_prove(); - - /** - * @brief Verify the final MegaHonk proof and the full Goblin proof - * - * @return bool verified - */ - bool verify(std::vector const& proof); - - private: - acir_format::GoblinBuilder builder_; - Goblin goblin; - bool verbose_ = true; - - template inline void vinfo(Args... args) - { - if (verbose_) { - info(args...); - } - } -}; - -} // namespace acir_proofs diff --git a/barretenberg/exports.json b/barretenberg/exports.json index 080b6c0ca4c..59d5091bd2f 100644 --- a/barretenberg/exports.json +++ b/barretenberg/exports.json @@ -534,17 +534,6 @@ ], "isAsync": false }, - { - "functionName": "acir_new_goblin_acir_composer", - "inArgs": [], - "outArgs": [ - { - "name": "out", - "type": "out_ptr" - } - ], - "isAsync": false - }, { "functionName": "acir_delete_acir_composer", "inArgs": [ @@ -674,30 +663,6 @@ ], "isAsync": false }, - { - "functionName": "acir_goblin_prove", - "inArgs": [ - { - "name": "acir_composer_ptr", - "type": "in_ptr" - }, - { - "name": "constraint_system_buf", - "type": "const uint8_t *" - }, - { - "name": "witness_buf", - "type": "const uint8_t *" - } - ], - "outArgs": [ - { - "name": "out", - "type": "uint8_t **" - } - ], - "isAsync": false - }, { "functionName": "acir_load_verification_key", "inArgs": [ @@ -780,26 +745,6 @@ ], "isAsync": false }, - { - "functionName": "acir_goblin_verify", - "inArgs": [ - { - "name": "acir_composer_ptr", - "type": "in_ptr" - }, - { - "name": "proof_buf", - "type": "const uint8_t *" - } - ], - "outArgs": [ - { - "name": "result", - "type": "bool *" - } - ], - "isAsync": false - }, { "functionName": "acir_get_solidity_verifier", "inArgs": [ diff --git a/barretenberg/ts/src/barretenberg_api/index.ts b/barretenberg/ts/src/barretenberg_api/index.ts index 619c89b8f21..a5caf50e16c 100644 --- a/barretenberg/ts/src/barretenberg_api/index.ts +++ b/barretenberg/ts/src/barretenberg_api/index.ts @@ -352,18 +352,6 @@ export class BarretenbergApi { return out[0]; } - async acirNewGoblinAcirComposer(): Promise { - const inArgs = [].map(serializeBufferable); - const outTypes: OutputType[] = [Ptr]; - const result = await this.wasm.callWasmExport( - 'acir_new_goblin_acir_composer', - inArgs, - outTypes.map(t => t.SIZE_IN_BYTES), - ); - const out = result.map((r, i) => outTypes[i].fromBuffer(r)); - return out[0]; - } - async acirDeleteAcirComposer(acirComposerPtr: Ptr): Promise { const inArgs = [acirComposerPtr].map(serializeBufferable); const outTypes: OutputType[] = []; @@ -452,22 +440,6 @@ export class BarretenbergApi { return out[0]; } - async acirGoblinProve( - acirComposerPtr: Ptr, - constraintSystemBuf: Uint8Array, - witnessBuf: Uint8Array, - ): Promise { - const inArgs = [acirComposerPtr, constraintSystemBuf, witnessBuf].map(serializeBufferable); - const outTypes: OutputType[] = [BufferDeserializer()]; - const result = await this.wasm.callWasmExport( - 'acir_goblin_prove', - inArgs, - outTypes.map(t => t.SIZE_IN_BYTES), - ); - const out = result.map((r, i) => outTypes[i].fromBuffer(r)); - return out[0]; - } - async acirLoadVerificationKey(acirComposerPtr: Ptr, vkBuf: Uint8Array): Promise { const inArgs = [acirComposerPtr, vkBuf].map(serializeBufferable); const outTypes: OutputType[] = []; @@ -528,18 +500,6 @@ export class BarretenbergApi { return out[0]; } - async acirGoblinVerify(acirComposerPtr: Ptr, proofBuf: Uint8Array): Promise { - const inArgs = [acirComposerPtr, proofBuf].map(serializeBufferable); - const outTypes: OutputType[] = [BoolDeserializer()]; - const result = await this.wasm.callWasmExport( - 'acir_goblin_verify', - inArgs, - outTypes.map(t => t.SIZE_IN_BYTES), - ); - const out = result.map((r, i) => outTypes[i].fromBuffer(r)); - return out[0]; - } - async acirGetSolidityVerifier(acirComposerPtr: Ptr): Promise { const inArgs = [acirComposerPtr].map(serializeBufferable); const outTypes: OutputType[] = [StringDeserializer()]; @@ -980,18 +940,6 @@ export class BarretenbergApiSync { return out[0]; } - acirNewGoblinAcirComposer(): Ptr { - const inArgs = [].map(serializeBufferable); - const outTypes: OutputType[] = [Ptr]; - const result = this.wasm.callWasmExport( - 'acir_new_goblin_acir_composer', - inArgs, - outTypes.map(t => t.SIZE_IN_BYTES), - ); - const out = result.map((r, i) => outTypes[i].fromBuffer(r)); - return out[0]; - } - acirDeleteAcirComposer(acirComposerPtr: Ptr): void { const inArgs = [acirComposerPtr].map(serializeBufferable); const outTypes: OutputType[] = []; @@ -1076,18 +1024,6 @@ export class BarretenbergApiSync { return out[0]; } - acirGoblinProve(acirComposerPtr: Ptr, constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): Uint8Array { - const inArgs = [acirComposerPtr, constraintSystemBuf, witnessBuf].map(serializeBufferable); - const outTypes: OutputType[] = [BufferDeserializer()]; - const result = this.wasm.callWasmExport( - 'acir_goblin_prove', - inArgs, - outTypes.map(t => t.SIZE_IN_BYTES), - ); - const out = result.map((r, i) => outTypes[i].fromBuffer(r)); - return out[0]; - } - acirLoadVerificationKey(acirComposerPtr: Ptr, vkBuf: Uint8Array): void { const inArgs = [acirComposerPtr, vkBuf].map(serializeBufferable); const outTypes: OutputType[] = []; @@ -1148,18 +1084,6 @@ export class BarretenbergApiSync { return out[0]; } - acirGoblinVerify(acirComposerPtr: Ptr, proofBuf: Uint8Array): boolean { - const inArgs = [acirComposerPtr, proofBuf].map(serializeBufferable); - const outTypes: OutputType[] = [BoolDeserializer()]; - const result = this.wasm.callWasmExport( - 'acir_goblin_verify', - inArgs, - outTypes.map(t => t.SIZE_IN_BYTES), - ); - const out = result.map((r, i) => outTypes[i].fromBuffer(r)); - return out[0]; - } - acirGetSolidityVerifier(acirComposerPtr: Ptr): string { const inArgs = [acirComposerPtr].map(serializeBufferable); const outTypes: OutputType[] = [StringDeserializer()]; diff --git a/barretenberg/ts/src/main.ts b/barretenberg/ts/src/main.ts index ada83203b08..448360b96d7 100755 --- a/barretenberg/ts/src/main.ts +++ b/barretenberg/ts/src/main.ts @@ -6,7 +6,6 @@ import { gunzipSync } from 'zlib'; import { Command } from 'commander'; import { Timer, writeBenchmark } from './benchmark/index.js'; import path from 'path'; -import { GrumpkinCrs } from './crs/node/index.js'; createDebug.log = console.error.bind(console); const debug = createDebug('bb.js'); @@ -78,21 +77,6 @@ async function init(bytecodePath: string, crsPath: string, subgroupSizeOverride return { api, acirComposer, circuitSize, subgroupSize }; } -async function initGoblin(bytecodePath: string, crsPath: string) { - // TODO(https://github.com/AztecProtocol/barretenberg/issues/811): remove this subgroup size hack - const hardcodedGrumpkinSubgroupSizeHack = 262144; - const initData = await init(bytecodePath, crsPath, hardcodedGrumpkinSubgroupSizeHack); - const { api } = initData; - initData.acirComposer = await api.acirNewGoblinAcirComposer(); - - // Plus 1 needed! (Move +1 into Crs?) - // Need both grumpkin and bn254 SRS's currently - const grumpkinCrs = await GrumpkinCrs.new(hardcodedGrumpkinSubgroupSizeHack + 1, crsPath); - await api.srsInitGrumpkinSrs(new RawBuffer(grumpkinCrs.getG1Data()), grumpkinCrs.numPoints); - - return initData; -} - async function initLite() { const api = await Barretenberg.new({ threads: 1 }); @@ -181,34 +165,6 @@ export async function foldAndVerifyProgram(bytecodePath: string, witnessPath: st /* eslint-enable camelcase */ } -export async function proveAndVerifyGoblin(bytecodePath: string, witnessPath: string, crsPath: string) { - /* eslint-disable camelcase */ - const acir_test = path.basename(process.cwd()); - - const { api, acirComposer, circuitSize, subgroupSize } = await initGoblin(bytecodePath, crsPath); - try { - debug(`creating proof...`); - const bytecode = getBytecode(bytecodePath); - const witness = getWitness(witnessPath); - - writeBenchmark('gate_count', circuitSize, { acir_test, threads }); - writeBenchmark('subgroup_size', subgroupSize, { acir_test, threads }); - - const proofTimer = new Timer(); - const proof = await api.acirGoblinProve(acirComposer, bytecode, witness); - writeBenchmark('proof_construction_time', proofTimer.ms(), { acir_test, threads }); - - debug(`verifying...`); - const verified = await api.acirGoblinVerify(acirComposer, proof); - debug(`verified: ${verified}`); - console.log({ verified }); - return verified; - } finally { - await api.destroy(); - } - /* eslint-enable camelcase */ -} - export async function prove(bytecodePath: string, witnessPath: string, crsPath: string, outputPath: string) { const { api, acirComposer } = await init(bytecodePath, crsPath); try { @@ -518,17 +474,6 @@ program process.exit(result ? 0 : 1); }); -program - .command('prove_and_verify_goblin') - .description('Generate a Goblin proof and verify it. Process exits with success or failure code.') - .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') - .option('-w, --witness-path ', 'Specify the witness path', './target/witness.gz') - .action(async ({ bytecodePath, witnessPath, crsPath }) => { - handleGlobalOptions(); - const result = await proveAndVerifyGoblin(bytecodePath, witnessPath, crsPath); - process.exit(result ? 0 : 1); - }); - program .command('prove') .description('Generate a proof and write it to a file.')