From e08c8c5447eac56d87838bc46a42dff89a86e215 Mon Sep 17 00:00:00 2001 From: codygunton Date: Mon, 24 Jul 2023 20:32:31 +0000 Subject: [PATCH] Try revert to Ultra CB. --- circuits/cpp/barretenberg | 2 +- .../apps/test_apps/basic_contract_deployment/init.hpp | 3 +++ .../cpp/src/aztec3/circuits/apps/test_apps/escrow/.test.cpp | 6 +++--- .../cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp | 4 ++++ .../test_apps/private_to_private_function_call/.test.cpp | 3 ++- .../private_to_private_function_call/function_2_1.cpp | 2 +- circuits/cpp/src/aztec3/circuits/kernel/private/init.hpp | 2 ++ circuits/cpp/src/aztec3/circuits/recursion/aggregator.hpp | 2 +- circuits/cpp/src/aztec3/circuits/recursion/init.hpp | 6 ++++-- 9 files changed, 21 insertions(+), 9 deletions(-) diff --git a/circuits/cpp/barretenberg b/circuits/cpp/barretenberg index af91bc8c122..d60b16a1421 160000 --- a/circuits/cpp/barretenberg +++ b/circuits/cpp/barretenberg @@ -1 +1 @@ -Subproject commit af91bc8c12286d5a5abc16d4d79f4b5e2c3e7ecc +Subproject commit d60b16a14219fd4bd130ce4537c3e94bfa10128f diff --git a/circuits/cpp/src/aztec3/circuits/apps/test_apps/basic_contract_deployment/init.hpp b/circuits/cpp/src/aztec3/circuits/apps/test_apps/basic_contract_deployment/init.hpp index 4b193f601d7..1397bc253dc 100644 --- a/circuits/cpp/src/aztec3/circuits/apps/test_apps/basic_contract_deployment/init.hpp +++ b/circuits/cpp/src/aztec3/circuits/apps/test_apps/basic_contract_deployment/init.hpp @@ -11,9 +11,12 @@ #include "aztec3/utils/types/convert.hpp" #include "aztec3/utils/types/native_types.hpp" +#include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp" + namespace aztec3::circuits::apps::test_apps::basic_contract_deployment { // Builder + using C = UltraCircuitBuilder; // Native and circuit types diff --git a/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/.test.cpp b/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/.test.cpp index 5e68463937e..1253947f803 100644 --- a/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/.test.cpp +++ b/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/.test.cpp @@ -58,7 +58,7 @@ TEST_F(escrow_tests, circuit_deposit) // info("variables: ", builder.variables); info("failed?: ", builder.failed()); info("err: ", builder.err()); - info("n: ", builder.num_gates); + // info("n: ", builder.num_gates); } TEST_F(escrow_tests, circuit_transfer) @@ -83,7 +83,7 @@ TEST_F(escrow_tests, circuit_transfer) // info("variables: ", builder.variables); info("failed?: ", builder.failed()); info("err: ", builder.err()); - info("n: ", builder.num_gates); + // info("n: ", builder.num_gates); } TEST_F(escrow_tests, circuit_withdraw) @@ -107,7 +107,7 @@ TEST_F(escrow_tests, circuit_withdraw) // info("variables: ", builder.variables); info("failed?: ", builder.failed()); info("err: ", builder.err()); - info("n: ", builder.num_gates); + // info("n: ", builder.num_gates); } } // namespace aztec3::circuits::apps::test_apps::escrow \ No newline at end of file diff --git a/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp b/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp index 30d5da1dbbc..dbd17ae2444 100644 --- a/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp +++ b/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp @@ -11,9 +11,13 @@ #include "aztec3/utils/types/convert.hpp" #include "aztec3/utils/types/native_types.hpp" +#include "barretenberg/proof_system/circuit_builder/circuit_simulator.hpp" +#include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp" + namespace aztec3::circuits::apps::test_apps::escrow { // Builder +// WORKTODO: this is coupled to the circuit builder in the private kernel. using C = UltraCircuitBuilder; // Native and circuit types diff --git a/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/.test.cpp b/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/.test.cpp index ba7acefda62..f689eb31893 100644 --- a/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/.test.cpp +++ b/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/.test.cpp @@ -56,7 +56,8 @@ TEST(private_to_private_function_call_tests, circuit_private_to_private_function // info("variables: ", fn1_builder.variables); info("failed?: ", fn1_builder.failed()); info("err: ", fn1_builder.err()); - info("n: ", fn1_builder.num_gates); + // info("n: ", fn1_builder.num_gates); + // WORKTODO: this test leads to a failing composer, but there are no expectations in the test. } } // namespace aztec3::circuits::apps::test_apps::private_to_private_function_call \ No newline at end of file diff --git a/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/function_2_1.cpp b/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/function_2_1.cpp index ac424411667..7197abd6d9d 100644 --- a/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/function_2_1.cpp +++ b/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/function_2_1.cpp @@ -41,7 +41,7 @@ void function_2_1(FunctionExecutionContext& exec_ctx, std::vector const& auto product = a * b * c; - CT::address const unique_person_who_may_initialise = 999999; + CT::address const unique_person_who_may_initialise = { msg_sender.context_, 999999 }; unique_person_who_may_initialise.assert_equal(msg_sender); diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/init.hpp b/circuits/cpp/src/aztec3/circuits/kernel/private/init.hpp index 81866dedde7..59273d00294 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/init.hpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/init.hpp @@ -7,6 +7,8 @@ #include "aztec3/utils/types/convert.hpp" #include "aztec3/utils/types/native_types.hpp" +#include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp" + namespace aztec3::circuits::kernel::private_kernel { using Builder = UltraCircuitBuilder; diff --git a/circuits/cpp/src/aztec3/circuits/recursion/aggregator.hpp b/circuits/cpp/src/aztec3/circuits/recursion/aggregator.hpp index 343ba12e79e..9c621bf7723 100644 --- a/circuits/cpp/src/aztec3/circuits/recursion/aggregator.hpp +++ b/circuits/cpp/src/aztec3/circuits/recursion/aggregator.hpp @@ -14,7 +14,7 @@ class Aggregator { const CT::AggregationObject& previous_aggregation_output = CT::AggregationObject()) { CT::AggregationObject result = - verify_proof(builder, vk, proof, previous_aggregation_output); + plonk::stdlib::recursion::verify_proof(builder, vk, proof, previous_aggregation_output); return result; } diff --git a/circuits/cpp/src/aztec3/circuits/recursion/init.hpp b/circuits/cpp/src/aztec3/circuits/recursion/init.hpp index 427d25f502d..91a66a2f175 100644 --- a/circuits/cpp/src/aztec3/circuits/recursion/init.hpp +++ b/circuits/cpp/src/aztec3/circuits/recursion/init.hpp @@ -3,11 +3,14 @@ #include "aztec3/utils/types/convert.hpp" #include "aztec3/utils/types/native_types.hpp" +#include "barretenberg/plonk/flavor/flavor.hpp" #include namespace aztec3::circuits::recursion { // Builder -using Builder = UltraCircuitBuilder; +// using Flavor = proof_system::plonk::flavor::SimulatorBN254; +using Flavor = proof_system::plonk::flavor::Ultra; +using Builder = typename Flavor::CircuitBuilder; // Generic types: using CT = aztec3::utils::types::CircuitTypes; @@ -15,7 +18,6 @@ using NT = aztec3::utils::types::NativeTypes; using aztec3::utils::types::to_ct; // Recursion types and methods -using plonk::stdlib::recursion::verify_proof; using transcript::Manifest; } // namespace aztec3::circuits::recursion \ No newline at end of file