Skip to content

Commit 41110d3

Browse files
authored
feat: merge-train/barretenberg (#17157)
BEGIN_COMMIT_OVERRIDE chore: Tube-related clean up (#17064) chore: cycle group cleanup #5 (#17026) chore: `field_conversion` clean-up/int audit (#16898) fix: bigfield veridise audit fixes (#16842) END_COMMIT_OVERRIDE
2 parents 925f544 + 2166a06 commit 41110d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1017
-869
lines changed

barretenberg/acir_tests/bootstrap.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,6 @@ function test_cmds {
176176
# the prove then verify flow for UltraHonk. This makes sure we have the same circuit for different witness inputs.
177177
echo "$tests_hash $scripts/bbjs_prove.sh a_6_array"
178178

179-
# Fold and verify an ACIR program stack using ClientIVC, recursively verify as part of the Tube circuit and produce and verify a Honk proof
180-
echo "$tests_hash $scripts/bb_tube_prove.sh a_6_array"
181-
182179
for t in $non_recursive_tests; do
183180
echo "$tests_hash $scripts/bb_prove.sh $(basename $t)"
184181
done

barretenberg/acir_tests/scripts/bb_tube_prove.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

barretenberg/cpp/scripts/test_civc_standalone_vks_havent_changed.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cd ..
1313
# - Generate a hash for versioning: sha256sum bb-civc-inputs.tar.gz
1414
# - Upload the compressed results: aws s3 cp bb-civc-inputs.tar.gz s3://aztec-ci-artifacts/protocol/bb-civc-inputs-[hash(0:8)].tar.gz
1515
# Note: In case of the "Test suite failed to run ... Unexpected token 'with' " error, need to run: docker pull aztecprotocol/build:3.0
16-
pinned_short_hash="5aa55c9f"
16+
pinned_short_hash="8ba25b76"
1717
pinned_civc_inputs_url="https://aztec-ci-artifacts.s3.us-east-2.amazonaws.com/protocol/bb-civc-inputs-${pinned_short_hash}.tar.gz"
1818

1919
function compress_and_upload {

barretenberg/cpp/src/barretenberg/api/prove_tube.cpp

Lines changed: 0 additions & 99 deletions
This file was deleted.

barretenberg/cpp/src/barretenberg/api/prove_tube.hpp

Lines changed: 0 additions & 14 deletions
This file was deleted.

barretenberg/cpp/src/barretenberg/bb/cli.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "barretenberg/api/api_msgpack.hpp"
2020
#include "barretenberg/api/api_ultra_honk.hpp"
2121
#include "barretenberg/api/file_io.hpp"
22-
#include "barretenberg/api/prove_tube.hpp"
2322
#include "barretenberg/bb/cli11_formatter.hpp"
2423
#include "barretenberg/bbapi/bbapi.hpp"
2524
#include "barretenberg/bbapi/bbapi_ultra_honk.hpp"
@@ -521,30 +520,6 @@ int parse_and_run_cli_command(int argc, char* argv[])
521520
msgpack_run_command->add_option(
522521
"-i,--input", msgpack_input_file, "Input file containing msgpack buffers (defaults to stdin)");
523522

524-
/***************************************************************************************************************
525-
* Subcommand: prove_tube
526-
***************************************************************************************************************/
527-
CLI ::App* prove_tube_command = app.add_subcommand("prove_tube", "");
528-
prove_tube_command->group(""); // hide from list of subcommands
529-
add_verbose_flag(prove_tube_command);
530-
add_debug_flag(prove_tube_command);
531-
add_crs_path_option(prove_tube_command);
532-
add_vk_path_option(prove_tube_command);
533-
std::string prove_tube_output_path{ "./target" };
534-
add_output_path_option(prove_tube_command, prove_tube_output_path);
535-
536-
/***************************************************************************************************************
537-
* Subcommand: verify_tube
538-
***************************************************************************************************************/
539-
CLI::App* verify_tube_command = app.add_subcommand("verify_tube", "");
540-
verify_tube_command->group(""); // hide from list of subcommands
541-
add_verbose_flag(verify_tube_command);
542-
add_debug_flag(verify_tube_command);
543-
add_crs_path_option(verify_tube_command);
544-
// doesn't make sense that this is set by -o but that's how it was
545-
std::string tube_proof_and_vk_path{ "./target" };
546-
add_output_path_option(verify_tube_command, tube_proof_and_vk_path);
547-
548523
/***************************************************************************************************************
549524
* Build the CLI11 App
550525
***************************************************************************************************************/
@@ -614,19 +589,6 @@ int parse_and_run_cli_command(int argc, char* argv[])
614589
if (msgpack_run_command->parsed()) {
615590
return execute_msgpack_run(msgpack_input_file);
616591
}
617-
// TUBE
618-
if (prove_tube_command->parsed()) {
619-
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1201): Potentially remove this extra logic.
620-
prove_tube(prove_tube_output_path, vk_path);
621-
} else if (verify_tube_command->parsed()) {
622-
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1322): Remove verify_tube logic.
623-
auto tube_public_inputs_path = tube_proof_and_vk_path + "/public_inputs";
624-
auto tube_proof_path = tube_proof_and_vk_path + "/proof";
625-
auto tube_vk_path = tube_proof_and_vk_path + "/vk";
626-
UltraHonkAPI api;
627-
return api.verify({ .ipa_accumulation = true }, tube_public_inputs_path, tube_proof_path, tube_vk_path) ? 0
628-
: 1;
629-
}
630592
// AVM
631593
#ifndef DISABLE_AZTEC_VM
632594
else if (avm_prove_command->parsed()) {

barretenberg/cpp/src/barretenberg/bbapi/bbapi_ultra_honk.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ bool _verify(const bool ipa_accumulation,
177177
const std::ptrdiff_t honk_proof_with_pub_inputs_length =
178178
static_cast<std::ptrdiff_t>(HONK_PROOF_LENGTH + num_public_inputs);
179179
auto ipa_proof = Proof(complete_proof.begin() + honk_proof_with_pub_inputs_length, complete_proof.end());
180-
auto tube_honk_proof =
181-
Proof(complete_proof.begin(), complete_proof.begin() + honk_proof_with_pub_inputs_length);
180+
auto honk_proof = Proof(complete_proof.begin(), complete_proof.begin() + honk_proof_with_pub_inputs_length);
182181
verified = verifier.template verify_proof<RollupIO>(complete_proof, ipa_proof).result;
183182
} else {
184183
verified = verifier.template verify_proof<DefaultIO>(complete_proof).result;

barretenberg/cpp/src/barretenberg/circuit_checker/ultra_circuit_checker.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ UltraCircuitBuilder_<UltraExecutionTraceBlocks> UltraCircuitChecker::prepare_cir
2222
{
2323
// Create a copy of the input circuit
2424
UltraCircuitBuilder_<UltraExecutionTraceBlocks> builder{ builder_in };
25-
26-
builder.finalize_circuit(/*ensure_nonzero=*/true); // Test the ensure_nonzero gates as well
25+
if (!builder.circuit_finalized) { // avoid warnings about finalizing an already finalized circuit
26+
builder.finalize_circuit(/*ensure_nonzero=*/true); // Test the ensure_nonzero gates as well
27+
}
2728

2829
return builder;
2930
}

barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,19 +303,29 @@ void build_constraints(Builder& builder, AcirProgram& program, const ProgramMeta
303303
bool has_pairing_points =
304304
has_honk_recursion_constraints || has_civc_recursion_constraints || has_avm_recursion_constraints;
305305

306-
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1523): Only handle either HONK or CIVC + AVM and
307-
// fail fast otherwise
306+
// We only handle:
307+
// - CIVC recursion constraints (Private Base Rollup)
308+
// - HONK + AVM recursion constraints (Public Base Rollup)
309+
// - HONK recursion constraints
310+
// - AVM recursion constraints
311+
// However, as mock protocol circuits use CIVC + AVM (mock Public Base Rollup), instead of throwing an assert we
312+
// return a vinfo for the case of CIVC + AVM
308313
BB_ASSERT_EQ(has_pg_recursion_constraints,
309314
false,
310315
"Invalid circuit: pg recursion constraints are present with UltraBuilder.");
311-
BB_ASSERT_EQ(!(has_honk_recursion_constraints && has_civc_recursion_constraints),
316+
BB_ASSERT_EQ(!(has_civc_recursion_constraints && has_honk_recursion_constraints),
312317
true,
313318
"Invalid circuit: both honk and civc recursion constraints are present.");
314319
BB_ASSERT_EQ(
315320
!(has_honk_recursion_constraints || has_civc_recursion_constraints || has_avm_recursion_constraints) ||
316321
is_recursive_circuit,
317322
true,
318323
"Invalid circuit: honk, civc, or avm recursion constraints present but the circuit is not recursive.");
324+
if (has_civc_recursion_constraints && has_avm_recursion_constraints) {
325+
vinfo("WARNING: both civc and avm recursion constraints are present. While we support this combination, we "
326+
"expect to see it only in a mock "
327+
"circuit.");
328+
}
319329

320330
// Container for data to be propagated
321331
HonkRecursionConstraintsOutput<Builder> honk_output;

barretenberg/cpp/src/barretenberg/dsl/acir_format/civc_recursion_constraints.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ create_civc_recursion_constraints(Builder& builder,
111111
}
112112

113113
// Recursively verify CIVC proof
114-
auto mega_vk = std::make_shared<VerificationKey>(builder, key_fields);
114+
auto mega_vk = std::make_shared<VerificationKey>(key_fields);
115115
auto mega_vk_and_hash = std::make_shared<RecursiveVKAndHash>(mega_vk, vk_hash);
116116
ClientIVCRecursiveVerifier::StdlibProof stdlib_proof(proof_fields, input.public_inputs.size());
117117

0 commit comments

Comments
 (0)