From d86577c2e36c5a077a859058602f455421ed93e1 Mon Sep 17 00:00:00 2001 From: maramihali Date: Wed, 21 Aug 2024 11:54:35 +0100 Subject: [PATCH] feat: Poseidon2 gates for Ultra arithmetisation (#7494) Add Poseidon2 gates to the `UltraCircuitBuilder` which now ensures that recursive verifier instantiated with the Ultra arithmetisation produce the correct number of constraints. Updates required: * change verification key length and constant proof length constants across the codebase (two selectors from the new gate whose commitments need to be in the vk and the poseidon relation becomes the one with the highest degree); changes to Prover.toml accordingly * ensure the ultra recursive verifier still stays constant size now that hashing produces gates * small modification to solidity verifer to reflect the ones in cpp with the caveat that the UltraKeccak flavor still doesnt support Poseidon gate (changes coming in a followup PR) Tube circuit changes in # of gates (post finalisation): - number of gates prior this change, in master: 13947018 - number of gates post this change: 14038982 Closes https://github.com/AztecProtocol/barretenberg/issues/1041 --- barretenberg/acir_tests/flows/honk_sol.sh | 12 +- barretenberg/cpp/src/barretenberg/bb/main.cpp | 7 +- .../benchmark/ultra_bench/mock_circuits.hpp | 3 +- .../circuit_checker/ultra_circuit_checker.cpp | 21 +-- .../CMakeLists.txt | 2 +- .../dsl/acir_proofs/honk_contract.hpp | 8 +- .../ecc/groups/affine_element_impl.hpp | 1 - .../examples/join_split/join_split.test.cpp | 2 +- .../execution_trace/execution_trace.cpp | 19 ++- .../execution_trace/execution_trace.hpp | 11 +- .../cpp/src/barretenberg/flavor/flavor.hpp | 3 + .../arithmetization/arithmetization.hpp | 6 - .../arithmetization/mega_arithmetization.hpp | 14 +- .../arithmetization/ultra_arithmetization.hpp | 40 ++++- .../barretenberg/polynomials/pow.bench.cpp | 2 +- .../cpp/src/barretenberg/polynomials/pow.hpp | 15 +- .../src/barretenberg/polynomials/pow.test.cpp | 2 +- .../protogalaxy/combiner.test.cpp | 32 ++-- .../protogalaxy/combiner_example_gen.py | 68 ++++---- .../protogalaxy/protogalaxy.test.cpp | 4 +- .../protogalaxy/protogalaxy_prover.hpp | 4 +- .../client_ivc_recursive_verifier.test.cpp | 5 +- .../eccvm_recursive_verifier.test.cpp | 5 + .../stdlib/hash/poseidon2/poseidon2.cpp | 2 + .../stdlib/hash/poseidon2/poseidon2.hpp | 2 - .../stdlib/hash/poseidon2/poseidon2.test.cpp | 2 +- .../hash/poseidon2/poseidon2_permutation.cpp | 13 +- .../hash/poseidon2/poseidon2_permutation.hpp | 12 +- .../ultra_recursive_verifier.cpp | 8 +- .../ultra_recursive_verifier.test.cpp | 47 +++++- .../stdlib/transcript/transcript.hpp | 31 ++-- .../stdlib/transcript/transcript.test.cpp | 3 + .../circuit_simulator.hpp | 3 + .../mega_circuit_builder.cpp | 98 ----------- .../mega_circuit_builder.hpp | 3 - .../stdlib_circuit_builders/mega_flavor.hpp | 2 +- .../mega_recursive_flavor.hpp | 2 +- .../ultra_circuit_builder.cpp | 154 ++++++++++++++++++ .../ultra_circuit_builder.hpp | 5 + .../stdlib_circuit_builders/ultra_flavor.hpp | 94 +++++++---- .../stdlib_circuit_builders/ultra_keccak.hpp | 1 + .../ultra_recursive_flavor.hpp | 52 +----- .../src/barretenberg/sumcheck/sumcheck.hpp | 5 +- .../barretenberg/sumcheck/sumcheck_round.hpp | 38 ++--- .../translator_circuit_builder.hpp | 4 +- .../ultra_honk/mega_composer.test.cpp | 14 +- .../ultra_honk/mega_transcript.test.cpp | 8 +- .../ultra_honk/ultra_honk.test.cpp | 5 +- .../barretenberg/ultra_honk/ultra_prover.cpp | 2 +- .../ultra_honk/ultra_transcript.test.cpp | 8 +- .../ultra_honk/ultra_verifier.cpp | 6 +- barretenberg/sol/bootstrap.sh | 3 +- .../sol/src/honk/instance/Add2Honk.sol | 12 +- .../sol/src/honk/instance/BlakeHonk.sol | 12 +- .../sol/src/honk/instance/EcdsaHonk.sol | 12 +- .../ultra/keys/Add2UltraVerificationKey.sol | 4 +- .../ultra/keys/BlakeUltraVerificationKey.sol | 4 +- .../ultra/keys/EcdsaUltraVerificationKey.sol | 4 +- .../src/core/libraries/ConstantsGen.sol | 8 +- .../crates/types/src/constants.nr | 6 +- .../verify_honk_proof/Prover.toml | 8 +- .../verify_honk_proof/src/main.nr | 4 +- noir/verify_honk_proof/src/main.nr | 4 +- scripts/earthly-ci | 3 +- yarn-project/circuits.js/src/constants.gen.ts | 8 +- 65 files changed, 571 insertions(+), 431 deletions(-) diff --git a/barretenberg/acir_tests/flows/honk_sol.sh b/barretenberg/acir_tests/flows/honk_sol.sh index ed223b7d37c..1801d034e19 100755 --- a/barretenberg/acir_tests/flows/honk_sol.sh +++ b/barretenberg/acir_tests/flows/honk_sol.sh @@ -1,14 +1,18 @@ #!/bin/sh -set -eu +set -eux + +VFLAG=${VERBOSE:+-v} +BFLAG="-b ./target/program.json" +FLAGS="-c $CRS_PATH $VFLAG" export PROOF="$(pwd)/proof" export PROOF_AS_FIELDS="$(pwd)/proof_fields.json" # Create a proof, write the solidity contract, write the proof as fields in order to extract the public inputs -$BIN prove_keccak_ultra_honk -o proof -$BIN write_vk_ultra_honk -o vk +$BIN prove_keccak_ultra_honk -o proof $FLAGS $BFLAG +$BIN write_vk_ultra_keccak_honk -o vk $FLAGS $BFLAG $BIN proof_as_fields_honk -k vk -c $CRS_PATH -p $PROOF -$BIN contract_ultra_honk -k vk -c $CRS_PATH -b ./target/program.json -o Verifier.sol +$BIN contract_ultra_honk -k vk -c $CRS_PATH -o Verifier.sol # Export the paths to the environment variables for the js test runner export VERIFIER_PATH="$(pwd)/Verifier.sol" diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index 63d97e31199..a148d2117bb 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -197,6 +197,7 @@ bool proveAndVerifyHonkAcirFormat(acir_format::AcirFormat constraint_system, aci // Verify Honk proof auto verification_key = std::make_shared(prover.instance->proving_key); + Verifier verifier{ verification_key }; return verifier.verify_proof(proof); @@ -589,7 +590,6 @@ void prove_tube(const std::string& output_path) builder->add_recursive_proof(current_aggregation_object); - info("num gates in tube circuit: ", builder->get_num_gates()); using Prover = UltraProver_; using Verifier = UltraVerifier_; Prover tube_prover{ *builder }; @@ -819,7 +819,7 @@ void contract(const std::string& output_path, const std::string& vk_path) */ void contract_honk(const std::string& output_path, const std::string& vk_path) { - using VerificationKey = UltraFlavor::VerificationKey; + using VerificationKey = UltraKeccakFlavor::VerificationKey; using VerifierCommitmentKey = bb::VerifierCommitmentKey; auto g2_data = get_bn254_g2_data(CRS_PATH); @@ -1457,6 +1457,9 @@ int main(int argc, char* argv[]) } else if (command == "write_vk_ultra_honk") { std::string output_path = get_option(args, "-o", "./target/vk"); write_vk_honk(bytecode_path, output_path); + } else if (command == "write_vk_ultra_keccak_honk") { + std::string output_path = get_option(args, "-o", "./target/vk"); + write_vk_honk(bytecode_path, output_path); } else if (command == "prove_mega_honk") { std::string output_path = get_option(args, "-o", "./proofs/proof"); prove_honk(bytecode_path, witness_path, output_path); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp index 86abd9a5aea..27e53e13886 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp @@ -23,7 +23,8 @@ template void generate_basic_arithmetic_circuit(Builder& buil stdlib::field_t a(stdlib::witness_t(&builder, fr::random_element())); stdlib::field_t b(stdlib::witness_t(&builder, fr::random_element())); stdlib::field_t c(&builder); - size_t passes = (1UL << log2_num_gates) / 4 - 4; + // Ensure the circuit is filled but finalisation doesn't make the circuit size go to the next power of two + size_t passes = (1UL << log2_num_gates) / 4 - 8; if (static_cast(passes) <= 0) { throw_or_abort("too few gates"); } diff --git a/barretenberg/cpp/src/barretenberg/circuit_checker/ultra_circuit_checker.cpp b/barretenberg/cpp/src/barretenberg/circuit_checker/ultra_circuit_checker.cpp index 23d9e745c52..ad032fd2840 100644 --- a/barretenberg/cpp/src/barretenberg/circuit_checker/ultra_circuit_checker.cpp +++ b/barretenberg/cpp/src/barretenberg/circuit_checker/ultra_circuit_checker.cpp @@ -105,15 +105,16 @@ bool UltraCircuitChecker::check_block(Builder& builder, if (!result) { return report_fail("Failed Lookup check relation at row idx = ", idx); } + result = result && check_relation(values, params); + if (!result) { + return report_fail("Failed PoseidonInternal relation at row idx = ", idx); + } + result = result && check_relation(values, params); + if (!result) { + return report_fail("Failed PoseidonExternal relation at row idx = ", idx); + } + if constexpr (IsMegaBuilder) { - result = result && check_relation(values, params); - if (!result) { - return report_fail("Failed PoseidonInternal relation at row idx = ", idx); - } - result = result && check_relation(values, params); - if (!result) { - return report_fail("Failed PoseidonExternal relation at row idx = ", idx); - } result = result && check_databus_read(values, builder); if (!result) { return report_fail("Failed databus read at row idx = ", idx); @@ -289,10 +290,10 @@ void UltraCircuitChecker::populate_values( values.q_elliptic = block.q_elliptic()[idx]; values.q_aux = block.q_aux()[idx]; values.q_lookup = block.q_lookup_type()[idx]; + values.q_poseidon2_internal = block.q_poseidon2_internal()[idx]; + values.q_poseidon2_external = block.q_poseidon2_external()[idx]; if constexpr (IsMegaBuilder) { values.q_busread = block.q_busread()[idx]; - values.q_poseidon2_internal = block.q_poseidon2_internal()[idx]; - values.q_poseidon2_external = block.q_poseidon2_external()[idx]; } } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/CMakeLists.txt index 71ce791bd34..c5ad5e22c36 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(commitment_schemes_recursion commitment_schemes stdlib_primitives) \ No newline at end of file +barretenberg_module(commitment_schemes_recursion commitment_schemes stdlib_poseidon2) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp index f44a7c05485..711ed414a81 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp @@ -270,7 +270,7 @@ struct Transcript { Fr beta; Fr gamma; Fr[NUMBER_OF_ALPHAS] alphas; - Fr[LOG_N] gateChallenges; + Fr[CONST_PROOF_SIZE_LOG_N] gateChallenges; Fr[CONST_PROOF_SIZE_LOG_N] sumCheckUChallenges; Fr rho; // Zero morph @@ -297,7 +297,7 @@ library TranscriptLib t.gateChallenges = generateGateChallenges(t.alphas[NUMBER_OF_ALPHAS - 1]); - t.sumCheckUChallenges = generateSumcheckChallenges(proof, t.gateChallenges[LOG_N - 1]); + t.sumCheckUChallenges = generateSumcheckChallenges(proof, t.gateChallenges[CONST_PROOF_SIZE_LOG_N - 1]); t.rho = generateRhoChallenge(proof, t.sumCheckUChallenges[CONST_PROOF_SIZE_LOG_N - 1]); t.zmY = generateZMYChallenge(t.rho, proof); @@ -385,9 +385,9 @@ library TranscriptLib } } - function generateGateChallenges(Fr previousChallenge) internal view returns(Fr[LOG_N] memory gateChallenges) + function generateGateChallenges(Fr previousChallenge) internal view returns(Fr[CONST_PROOF_SIZE_LOG_N] memory gateChallenges) { - for (uint256 i = 0; i < LOG_N; i++) { + for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) { previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge)))); gateChallenges[i] = previousChallenge; } diff --git a/barretenberg/cpp/src/barretenberg/ecc/groups/affine_element_impl.hpp b/barretenberg/cpp/src/barretenberg/ecc/groups/affine_element_impl.hpp index 1c1df91b819..b3133f61b7e 100644 --- a/barretenberg/cpp/src/barretenberg/ecc/groups/affine_element_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/ecc/groups/affine_element_impl.hpp @@ -109,7 +109,6 @@ template constexpr void affine_element: x.data[1] = Fq::modulus.data[1]; x.data[2] = Fq::modulus.data[2]; x.data[3] = Fq::modulus.data[3]; - } else { (*this).x = Fq::zero(); (*this).y = Fq::zero(); diff --git a/barretenberg/cpp/src/barretenberg/examples/join_split/join_split.test.cpp b/barretenberg/cpp/src/barretenberg/examples/join_split/join_split.test.cpp index 773c69d8941..7d7626a58ce 100644 --- a/barretenberg/cpp/src/barretenberg/examples/join_split/join_split.test.cpp +++ b/barretenberg/cpp/src/barretenberg/examples/join_split/join_split.test.cpp @@ -701,7 +701,7 @@ TEST_F(join_split_tests, test_0_input_notes_and_detect_circuit_change) // The below part detects any changes in the join-split circuit constexpr size_t DYADIC_CIRCUIT_SIZE = 1 << 16; - constexpr uint256_t CIRCUIT_HASH("0x470358e4d91c4c5296ef788b1165b2c439cd498f49c3f99386b002753ca3d0ee"); + constexpr uint256_t CIRCUIT_HASH("0x9170317e02f4131b84f6b4efdd3ac23e5f392d815df37750c8f05a94c64797b2"); const uint256_t circuit_hash = circuit.hash_circuit(); // circuit is finalized now diff --git a/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp b/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp index d0f1b37e1c1..d7a37ac15d9 100644 --- a/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp @@ -57,7 +57,18 @@ typename ExecutionTrace_::TraceData ExecutionTrace_::construct_t uint32_t offset = Flavor::has_zero_row ? 1 : 0; // Offset at which to place each block in the trace polynomials // For each block in the trace, populate wire polys, copy cycles and selector polys - for (auto& block : builder.blocks.get()) { + + // TODO(https://github.com/AztecProtocol/barretenberg/issues/1078): remove when Keccak flavor works with Poseidon + // gate + auto get_blocks = [&]() { + if constexpr (!HasKeccak) { + return builder.blocks.get(); + } else { + return builder.blocks.get_for_ultra_keccak(); + } + }; + + for (auto& block : get_blocks()) { auto block_size = static_cast(block.size()); // Update wire polynomials and copy cycles @@ -76,10 +87,12 @@ typename ExecutionTrace_::TraceData ExecutionTrace_::construct_t // Insert the selector values for this block into the selector polynomials at the correct offset // TODO(https://github.com/AztecProtocol/barretenberg/issues/398): implicit arithmetization/flavor consistency - for (auto [selector_poly, selector] : zip_view(trace_data.selectors, block.selectors)) { + for (size_t selector_idx = 0; selector_idx < NUM_USED_SELECTORS; selector_idx++) { + auto selector_poly = trace_data.selectors[selector_idx]; + auto selector = block.selectors[selector_idx]; for (size_t row_idx = 0; row_idx < block_size; ++row_idx) { size_t trace_row_idx = row_idx + offset; - selector_poly[trace_row_idx] = selector[row_idx]; + trace_data.selectors[selector_idx][trace_row_idx] = selector[row_idx]; } } diff --git a/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.hpp b/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.hpp index 7c375848f2a..6e240a96a50 100644 --- a/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.hpp @@ -9,16 +9,21 @@ template class ExecutionTrace_ { using Builder = typename Flavor::CircuitBuilder; using Polynomial = typename Flavor::Polynomial; using FF = typename Flavor::FF; - using TrackBlocks = typename Builder::Arithmetization::TraceBlocks; + using TraceBlocks = typename Builder::Arithmetization::TraceBlocks; using Wires = std::array, Builder::NUM_WIRES>; using ProvingKey = typename Flavor::ProvingKey; public: static constexpr size_t NUM_WIRES = Builder::NUM_WIRES; + // TODO(https://github.com/AztecProtocol/barretenberg/issues/1078): Since Keccak doesn't have knowledge of Poseidon2 + // gate yet, we ignore the two related selectors + static constexpr size_t NUM_USED_SELECTORS = + !HasKeccak ? Builder::Arithmetization::NUM_SELECTORS : Builder::Arithmetization::NUM_SELECTORS - 2; + struct TraceData { std::array wires; - std::array selectors; + std::array selectors; // A vector of sets (vectors) of addresses into the wire polynomials whose values are copy constrained std::vector copy_cycles; uint32_t ram_rom_offset = 0; // offset of the RAM/ROM block in the execution trace @@ -55,7 +60,7 @@ template class ExecutionTrace_ { } { ZoneScopedN("selector initialization"); - for (size_t idx = 0; idx < Builder::Arithmetization::NUM_SELECTORS; ++idx) { + for (size_t idx = 0; idx < NUM_USED_SELECTORS; ++idx) { selectors[idx] = Polynomial(proving_key.circuit_size); std::string selector_tag = builder.selector_names[idx] + "_lagrange"; proving_key.polynomial_store.put(selector_tag, selectors[idx].share()); diff --git a/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp b/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp index 0c2845a3021..5b4a6e90390 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp @@ -411,6 +411,9 @@ concept IsHonkFlavor = IsAnyOf concept IsUltraFlavor = IsAnyOf; +template +concept HasKeccak = IsAnyOf; + template concept IsGoblinFlavor = IsAnyOf, diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/arithmetization.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/arithmetization.hpp index 90351184809..5c6b56f6605 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/arithmetization.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/arithmetization.hpp @@ -78,10 +78,4 @@ template class ExecutionTr void set_fixed_size(uint32_t size_in) { fixed_size = size_in; } }; -class TranslatorArith { - public: - static constexpr size_t NUM_WIRES = 81; - static constexpr size_t NUM_SELECTORS = 0; -}; - } // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/mega_arithmetization.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/mega_arithmetization.hpp index c3f898f7d70..0311301b6c6 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/mega_arithmetization.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/mega_arithmetization.hpp @@ -156,12 +156,7 @@ template class MegaArith { * conventional Ultra arithmetization * */ - void pad_additional() - { - q_busread().emplace_back(0); - q_poseidon2_external().emplace_back(0); - q_poseidon2_internal().emplace_back(0); - }; + void pad_additional() { q_busread().emplace_back(0); }; /** * @brief Resizes all selectors which are not part of the conventional Ultra arithmetization @@ -169,12 +164,7 @@ template class MegaArith { * conventional Ultra arithmetization * @param new_size */ - void resize_additional(size_t new_size) - { - q_busread().resize(new_size); - q_poseidon2_external().resize(new_size); - q_poseidon2_internal().resize(new_size); - }; + void resize_additional(size_t new_size) { q_busread().resize(new_size); }; }; struct TraceBlocks : public MegaTraceBlocks { diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/ultra_arithmetization.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/ultra_arithmetization.hpp index 38d3028300d..277ef866da9 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/ultra_arithmetization.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/ultra_arithmetization.hpp @@ -21,8 +21,16 @@ template class UltraArith { T elliptic; T aux; T lookup; + T poseidon_external; + T poseidon_internal; - auto get() { return RefArray{ pub_inputs, arithmetic, delta_range, elliptic, aux, lookup }; } + auto get() + { + return RefArray{ pub_inputs, arithmetic, delta_range, elliptic, + aux, lookup, poseidon_external, poseidon_internal }; + } + + auto get_for_ultra_keccak() { return RefArray{ pub_inputs, arithmetic, delta_range, elliptic, aux, lookup }; } bool operator==(const UltraTraceBlocks& other) const = default; }; @@ -38,12 +46,14 @@ template class UltraArith { this->elliptic = FIXED_SIZE; this->aux = FIXED_SIZE; this->lookup = FIXED_SIZE; + this->poseidon_external = FIXED_SIZE; + this->poseidon_internal = FIXED_SIZE; } }; public: static constexpr size_t NUM_WIRES = 4; - static constexpr size_t NUM_SELECTORS = 11; + static constexpr size_t NUM_SELECTORS = 13; using FF = FF_; class UltraTraceBlock : public ExecutionTraceBlock { @@ -75,6 +85,8 @@ template class UltraArith { auto& q_elliptic() { return this->selectors[8]; }; auto& q_aux() { return this->selectors[9]; }; auto& q_lookup_type() { return this->selectors[10]; }; + auto& q_poseidon2_external() { return this->selectors[11]; }; + auto& q_poseidon2_internal() { return this->selectors[12]; }; }; struct TraceBlocks : public UltraTraceBlocks { @@ -107,6 +119,12 @@ template class UltraArith { } auto get() + { + return RefArray{ this->pub_inputs, this->arithmetic, this->delta_range, this->elliptic, + this->aux, this->lookup, this->poseidon_external, this->poseidon_internal }; + } + + auto get_for_ultra_keccak() { return RefArray{ this->pub_inputs, this->arithmetic, this->delta_range, this->elliptic, this->aux, this->lookup }; @@ -121,6 +139,8 @@ template class UltraArith { info("elliptic :\t", this->elliptic.size()); info("auxiliary :\t", this->aux.size()); info("lookups :\t", this->lookup.size()); + info("poseidon ext :\t", this->poseidon_external.size()); + info("poseidon int :\t", this->poseidon_internal.size()); } size_t get_total_structured_size() @@ -152,9 +172,19 @@ template class UltraArith { }; // Note: These are needed for Plonk only (for poly storage in a std::map). Must be in same order as above struct. - inline static const std::vector selector_names = { "q_m", "q_c", "q_1", "q_2", - "q_3", "q_4", "q_arith", "q_sort", - "q_elliptic", "q_aux", "table_type" }; + inline static const std::vector selector_names = { "q_m", + "q_c", + "q_1", + "q_2", + "q_3", + "q_4", + "q_arith", + "q_sort", + "q_elliptic", + "q_aux", + "table_type", + "q_poseidon2_external", + "q_poseidon2_internal" }; }; } // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/polynomials/pow.bench.cpp b/barretenberg/cpp/src/barretenberg/polynomials/pow.bench.cpp index 083ff70db5e..a9bf269e1ce 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/pow.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/pow.bench.cpp @@ -17,7 +17,7 @@ void compute_pow_poly(benchmark::State& state) int64_t num_betas = state.range(0); std::vector cur_betas(betas.begin(), betas.begin() + num_betas); PowPolynomial pow{ cur_betas }; - pow.compute_values(); + pow.compute_values(static_cast(num_betas)); } } diff --git a/barretenberg/cpp/src/barretenberg/polynomials/pow.hpp b/barretenberg/cpp/src/barretenberg/polynomials/pow.hpp index 7dda9aaa485..231b936a39b 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/pow.hpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/pow.hpp @@ -9,7 +9,6 @@ namespace bb { template struct PowPolynomial { - /** * @brief The challenges \f$(\beta_0,\ldots, \beta_{d-1}) \f$ * @@ -70,7 +69,11 @@ template struct PowPolynomial { template FF univariate_eval(const FF& challenge, const Bool& dummy_round) const { FF beta_or_dummy; - if (!dummy_round.get_value()) { + // For the Ultra Recursive flavor to ensure constant size proofs, we perform constant amount of hashing + // producing 28 gate betas and we need to use the betas in the dummy rounds to ensure the permutation related + // selectors stay the same regardless of real circuit size. The other recursive verifiers aren't constant for + // the dummy sumcheck rounds we just use 1 as we only generated real log_n betas + if (current_element_idx < betas.size()) { beta_or_dummy = betas[current_element_idx]; } else { beta_or_dummy = FF::from_witness(challenge.get_context(), 1); @@ -113,10 +116,14 @@ template struct PowPolynomial { * @brief Given \f$ \vec\beta = (\beta_0,...,\beta_{d-1})\f$ compute \f$ pow_{\ell}(\vec \beta) = pow_{\beta}(\vec * \ell)\f$ for \f$ \ell =0,\ldots,2^{d}-1\f$. * + * @param log_circuit_size Determines the number of beta challenges used to compute pow_betas (required because when + * we generate CONST_SIZE_PROOF_LOG_N, currently 28, challenges but the real circuit size is less than 1 << + * CONST_SIZE_PROOF_LOG_N, we should compute unnecessarily a vector of pow_betas of length 1 << 28 ) */ - BB_PROFILE void compute_values() + BB_PROFILE void compute_values(size_t log_circuit_size) { - size_t pow_size = 1 << betas.size(); + + size_t pow_size = 1 << log_circuit_size; pow_betas = std::vector(pow_size); // Determine number of threads for multithreading. diff --git a/barretenberg/cpp/src/barretenberg/polynomials/pow.test.cpp b/barretenberg/cpp/src/barretenberg/polynomials/pow.test.cpp index a9da061ba73..0be4194960b 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/pow.test.cpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/pow.test.cpp @@ -33,7 +33,7 @@ TEST(PowPolynomial, PowPolynomialsOnPowers) { auto betas = std::vector{ 2, 4, 16 }; auto pow = PowPolynomial(betas); - pow.compute_values(); + pow.compute_values(betas.size()); auto expected_values = std::vector{ 1, 2, 4, 8, 16, 32, 64, 128 }; EXPECT_EQ(expected_values, pow.pow_betas); } diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/combiner.test.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/combiner.test.cpp index 6664a4d5ab0..179e81b519e 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/combiner.test.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/combiner.test.cpp @@ -29,6 +29,8 @@ TEST(Protogalaxy, CombinerOn2Instances) std::fill(polys.q_aux.begin(), polys.q_aux.end(), 0); std::fill(polys.q_lookup.begin(), polys.q_lookup.end(), 0); std::fill(polys.q_4.begin(), polys.q_4.end(), 0); + std::fill(polys.q_poseidon2_external.begin(), polys.q_poseidon2_external.end(), 0); + std::fill(polys.q_poseidon2_internal.begin(), polys.q_poseidon2_internal.end(), 0); std::fill(polys.w_4.begin(), polys.w_4.end(), 0); std::fill(polys.w_4_shift.begin(), polys.w_4_shift.end(), 0); }; @@ -47,6 +49,7 @@ TEST(Protogalaxy, CombinerOn2Instances) restrict_to_standard_arithmetic_relation(prover_polynomials); instance->proving_key.polynomials = std::move(prover_polynomials); instance->proving_key.circuit_size = 2; + instance->proving_key.log_circuit_size = 1; instance_data[idx] = instance; } @@ -55,18 +58,18 @@ TEST(Protogalaxy, CombinerOn2Instances) auto pow_polynomial = PowPolynomial(std::vector{ 2 }); auto result = prover.compute_combiner(instances, pow_polynomial); // The expected_result values are computed by running the python script combiner_example_gen.py - auto expected_result = Univariate(std::array{ 8600UL, - 12679448UL, - 73617560UL, - 220571672UL, - 491290520UL, - 923522840UL, - 1555017368UL, - 2423522840UL, - 3566787992UL, - 5022561560UL, - 6828592280UL, - 9022628888UL }); + auto expected_result = Univariate(std::array{ 9704UL, + 13245288UL, + 75534568UL, + 224626280UL, + 498269160UL, + 934211944UL, + 1570203368UL, + 2443992168UL, + 3593327080UL, + 5055956840UL, + 6869630184UL, + 9072095848UL }); EXPECT_EQ(result, expected_result); } else { std::vector> instance_data(NUM_INSTANCES); @@ -79,6 +82,7 @@ TEST(Protogalaxy, CombinerOn2Instances) restrict_to_standard_arithmetic_relation(prover_polynomials); instance->proving_key.polynomials = std::move(prover_polynomials); instance->proving_key.circuit_size = 2; + instance->proving_key.log_circuit_size = 1; instance_data[idx] = instance; } @@ -179,6 +183,7 @@ TEST(Protogalaxy, CombinerOptimizationConsistency) restrict_to_standard_arithmetic_relation(prover_polynomials); instance->proving_key.polynomials = std::move(prover_polynomials); instance->proving_key.circuit_size = 2; + instance->proving_key.log_circuit_size = 1; instance_data[idx] = instance; } @@ -186,7 +191,7 @@ TEST(Protogalaxy, CombinerOptimizationConsistency) instances.alphas.fill( bb::Univariate(FF(0))); // focus on the arithmetic relation only auto pow_polynomial = PowPolynomial(std::vector{ 2 }); - pow_polynomial.compute_values(); + pow_polynomial.compute_values(1); // Relation parameters are all zeroes RelationParameters relation_parameters; @@ -263,6 +268,7 @@ TEST(Protogalaxy, CombinerOptimizationConsistency) restrict_to_standard_arithmetic_relation(prover_polynomials); instance->proving_key.polynomials = std::move(prover_polynomials); instance->proving_key.circuit_size = 2; + instance->proving_key.log_circuit_size = 1; instance_data[idx] = instance; } diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/combiner_example_gen.py b/barretenberg/cpp/src/barretenberg/protogalaxy/combiner_example_gen.py index bc0fb19128b..dee82425aa6 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/combiner_example_gen.py +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/combiner_example_gen.py @@ -3,7 +3,7 @@ # np.set_printoptions(formatter={'int': hex}) -EXTENDED_RELATION_LENGTH = 13 +EXTENDED_RELATION_LENGTH = 12 class Row: # Construct a set of 'all' polynomials with a very simple structure @@ -20,38 +20,40 @@ def __init__(self, base_poly): self.q_elliptic = base_poly + 2 * 8 self.q_aux = base_poly + 2 * 9 self.q_lookup = base_poly + 2 * 10 - self.sigma_1 = base_poly + 2 * 11 - self.sigma_2 = base_poly + 2 * 12 - self.sigma_3 = base_poly + 2 * 13 - self.sigma_4 = base_poly + 2 * 14 - self.id_1 = base_poly + 2 * 15 - self.id_2 = base_poly + 2 * 16 - self.id_3 = base_poly + 2 * 17 - self.id_4 = base_poly + 2 * 18 - self.table_1 = base_poly + 2 * 19 - self.table_2 = base_poly + 2 * 20 - self.table_3 = base_poly + 2 * 21 - self.table_4 = base_poly + 2 * 22 - self.lagrange_first = base_poly + 2 * 23 - self.lagrange_last = base_poly + 2 * 24 - self.w_l = base_poly + 2 * 25 - self.w_r = base_poly + 2 * 26 - self.w_o = base_poly + 2 * 27 - self.w_4 = base_poly + 2 * 28 - self.sorted_accum = base_poly + 2 * 29 - self.z_perm = base_poly + 2 * 30 - self.z_lookup = base_poly + 2 * 31 - self.table_1_shift = base_poly + 2 * 32 - self.table_2_shift = base_poly + 2 * 33 - self.table_3_shift = base_poly + 2 * 34 - self.table_4_shift = base_poly + 2 * 35 - self.w_l_shift = base_poly + 2 * 36 - self.w_r_shift = base_poly + 2 * 37 - self.w_o_shift = base_poly + 2 * 38 - self.w_4_shift = base_poly + 2 * 39 - self.sorted_accum_shift = base_poly + 2 * 40 - self.z_perm_shift = base_poly + 2 * 41 - self.z_lookup_shift = base_poly + 2 * 42 + self.q_poseidon2_external_1 = base_poly + 2 * 11 + self.q_poseidon2_external_2 = base_poly + 2 * 12 + self.sigma_1 = base_poly + 2 * 13 + self.sigma_2 = base_poly + 2 * 14 + self.sigma_3 = base_poly + 2 * 15 + self.sigma_4 = base_poly + 2 * 16 + self.id_1 = base_poly + 2 * 17 + self.id_2 = base_poly + 2 * 18 + self.id_3 = base_poly + 2 * 19 + self.id_4 = base_poly + 2 * 20 + self.table_1 = base_poly + 2 * 21 + self.table_2 = base_poly + 2 * 22 + self.table_3 = base_poly + 2 * 23 + self.table_4 = base_poly + 2 * 24 + self.lagrange_first = base_poly + 2 * 25 + self.lagrange_last = base_poly + 2 * 26 + self.w_l = base_poly + 2 * 27 + self.w_r = base_poly + 2 * 28 + self.w_o = base_poly + 2 * 29 + self.w_4 = base_poly + 2 * 30 + self.sorted_accum = base_poly + 2 * 31 + self.z_perm = base_poly + 2 * 32 + self.z_lookup = base_poly + 2 * 33 + self.table_1_shift = base_poly + 2 * 34 + self.table_2_shift = base_poly + 2 * 35 + self.table_3_shift = base_poly + 2 * 36 + self.table_4_shift = base_poly + 2 * 37 + self.w_l_shift = base_poly + 2 * 38 + self.w_r_shift = base_poly + 2 * 39 + self.w_o_shift = base_poly + 2 * 40 + self.w_4_shift = base_poly + 2 * 41 + self.sorted_accum_shift = base_poly + 2 * 42 + self.z_perm_shift = base_poly + 2 * 43 + self.z_lookup_shift = base_poly + 2 * 44 def arith_relation(self): return self.q_m * self.w_l * self.w_r + self.q_l * self.w_l + self.q_r * self.w_r + self.q_o * self.w_o + self.q_c diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp index 1dfda9e7e9a..14aac0b0ea3 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp @@ -96,7 +96,7 @@ template class ProtoGalaxyTests : public testing::Test { accumulator->proving_key.polynomials, accumulator->alphas, accumulator->relation_parameters); // Construct pow(\vec{betas*}) as in the paper auto expected_pows = PowPolynomial(accumulator->gate_challenges); - expected_pows.compute_values(); + expected_pows.compute_values(accumulator->gate_challenges.size()); // Compute the corresponding target sum and create a dummy accumulator auto expected_target_sum = FF(0); @@ -203,7 +203,7 @@ template class ProtoGalaxyTests : public testing::Test { // Construct pow(\vec{betas}) as in the paper auto pow_beta = bb::PowPolynomial(betas); - pow_beta.compute_values(); + pow_beta.compute_values(log_instance_size); // Compute the corresponding target sum and create a dummy accumulator auto target_sum = FF(0); diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp index b88d5c2abe0..e2f6fc2dca8 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp @@ -293,7 +293,7 @@ template class ProtoGalaxyProver_ { ExtendedUnivariateWithRandomization compute_combiner(const ProverInstances& instances, PowPolynomial& pow_betas) { size_t common_instance_size = instances[0]->proving_key.circuit_size; - pow_betas.compute_values(); + pow_betas.compute_values(instances[0]->proving_key.log_circuit_size); // Determine number of threads for multithreading. // Note: Multithreading is "on" for every round but we reduce the number of threads from the max available based // on a specified minimum number of iterations per thread. This eventually leads to the use of a @@ -363,7 +363,7 @@ template class ProtoGalaxyProver_ { { BB_OP_COUNT_TIME(); size_t common_instance_size = instances[0]->proving_key.circuit_size; - pow_betas.compute_values(); + pow_betas.compute_values(instances[0]->proving_key.log_circuit_size); // Determine number of threads for multithreading. // Note: Multithreading is "on" for every round but we reduce the number of threads from the max available based // on a specified minimum number of iterations per thread. This eventually leads to the use of a diff --git a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp index 3c2b28d7db9..261b54d0243 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp @@ -89,11 +89,12 @@ TEST_F(ClientIVCRecursionTests, Basic) // Generate the recursive verification circuit verifier.verify(proof); - info("Recursive Verifier: num gates = ", builder->num_gates); - EXPECT_EQ(builder->failed(), false) << builder->err(); EXPECT_TRUE(CircuitChecker::check(*builder)); + + // Print the number of gates post finalisation + info("Recursive Verifier: finalised num gates = ", builder->num_gates); } TEST_F(ClientIVCRecursionTests, ClientTubeBase) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp index 99ffb765805..71467ce7005 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp @@ -1,4 +1,5 @@ #include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.hpp" +#include "barretenberg/circuit_checker/circuit_checker.hpp" #include "barretenberg/eccvm/eccvm_prover.hpp" #include "barretenberg/eccvm/eccvm_verifier.hpp" #include "barretenberg/ultra_honk/ultra_prover.hpp" @@ -79,6 +80,7 @@ template class ECCVMRecursiveTests : public ::testing auto proof = prover.construct_proof(); auto verification_key = std::make_shared(prover.key); + info("ECCVM Recursive Verifier"); OuterBuilder outer_circuit; RecursiveVerifier verifier{ &outer_circuit, verification_key }; verifier.verify_proof(proof); @@ -87,6 +89,9 @@ template class ECCVMRecursiveTests : public ::testing // Check for a failure flag in the recursive verifier circuit EXPECT_EQ(outer_circuit.failed(), false) << outer_circuit.err(); + bool result = CircuitChecker::check(outer_circuit); + EXPECT_TRUE(result); + InnerVerifier native_verifier(prover.key); bool native_result = native_verifier.verify_proof(proof); EXPECT_TRUE(native_result); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.cpp index aa44a3def25..82aa0ffc054 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.cpp @@ -40,5 +40,7 @@ template field_t poseidon2::hash_buffer(C& builder, const std return hash(builder, elements); } template class poseidon2; +template class poseidon2; +template class poseidon2; } // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.hpp index 403d5f39f58..bb4145bed9f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.hpp @@ -29,6 +29,4 @@ template class poseidon2 { static field_ct hash_buffer(Builder& builder, const stdlib::byte_array& input); }; -extern template class poseidon2; - } // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.test.cpp index a388d58c5f6..a22998a2668 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.test.cpp @@ -147,7 +147,7 @@ template class StdlibPoseidon2 : public testing::Test { } }; -using CircuitTypes = testing::Types; +using CircuitTypes = testing::Types; TYPED_TEST_SUITE(StdlibPoseidon2, CircuitTypes); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.cpp index f3abe50a9d9..ef7e26d5d69 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.cpp @@ -17,7 +17,7 @@ namespace bb::stdlib { template typename Poseidon2Permutation::State Poseidon2Permutation::permutation( Builder* builder, const typename Poseidon2Permutation::State& input) - requires IsMegaBuilder + requires(!IsSimulator) { // deep copy State current_state(input); @@ -120,7 +120,7 @@ typename Poseidon2Permutation::State Poseidon2Permutation typename Poseidon2Permutation::State Poseidon2Permutation::permutation( Builder* builder, const typename Poseidon2Permutation::State& input) - requires IsNotMegaBuilder + requires IsSimulator { // deep copy State current_state(input); @@ -156,7 +156,7 @@ typename Poseidon2Permutation::State Poseidon2Permutation void Poseidon2Permutation::add_round_constants( State& input, const typename Poseidon2Permutation::RoundConstants& rc) - requires IsNotMegaBuilder + requires IsSimulator { for (size_t i = 0; i < t; ++i) { @@ -166,7 +166,7 @@ void Poseidon2Permutation::add_round_constants( template void Poseidon2Permutation::apply_sbox(State& input) - requires IsNotMegaBuilder + requires IsSimulator { for (auto& in : input) { apply_single_sbox(in); @@ -175,7 +175,7 @@ void Poseidon2Permutation::apply_sbox(State& input) template void Poseidon2Permutation::apply_single_sbox(field_t& input) - requires IsNotMegaBuilder + requires IsSimulator { // hardcoded assumption that d = 5. should fix this or not make d configurable auto xx = input.sqr(); @@ -185,7 +185,7 @@ void Poseidon2Permutation::apply_single_sbox(field_t& template void Poseidon2Permutation::matrix_multiplication_internal(State& input) - requires IsNotMegaBuilder + requires IsSimulator { // for t = 4 auto sum = input[0]; @@ -312,5 +312,6 @@ void Poseidon2Permutation::matrix_multiplication_external( template class Poseidon2Permutation; template class Poseidon2Permutation; +template class Poseidon2Permutation; } // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.hpp index 1b03a236893..da060206935 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.hpp @@ -45,18 +45,18 @@ template class Poseidon2Permutation { * @return State */ static State permutation(Builder* builder, const State& input) - requires IsMegaBuilder; + requires(!IsSimulator); static State permutation(Builder* builder, const State& input) - requires IsNotMegaBuilder; + requires IsSimulator; static void add_round_constants(State& input, const RoundConstants& rc) - requires IsNotMegaBuilder; + requires IsSimulator; static void apply_sbox(State& input) - requires IsNotMegaBuilder; + requires IsSimulator; static void apply_single_sbox(field_t& input) - requires IsNotMegaBuilder; + requires IsSimulator; static void matrix_multiplication_internal(State& input) - requires IsNotMegaBuilder; + requires IsSimulator; /** * @brief Separate function to do just the first linear layer (equivalent to external matrix mul). diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.cpp index 1c391b7c5ab..6517b108df0 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.cpp @@ -154,16 +154,14 @@ UltraRecursiveVerifier_::AggregationObject UltraRecursiveVerifier_(key->circuit_size)); auto sumcheck = Sumcheck(log_circuit_size, transcript); + RelationSeparator alpha; for (size_t idx = 0; idx < alpha.size(); idx++) { alpha[idx] = transcript->template get_challenge("alpha_" + std::to_string(idx)); } - // TODO(https://github.com/AztecProtocol/barretenberg/issues/1041): Once hashing produces constraints for Ultra - // in the transcript, a fixed number of gate_challenges must be generated by the prover/verifier in order to - // achieve a verification circuit that is independent of proof size. - auto gate_challenges = std::vector(log_circuit_size); - for (size_t idx = 0; idx < log_circuit_size; idx++) { + auto gate_challenges = std::vector(CONST_PROOF_SIZE_LOG_N); + for (size_t idx = 0; idx < CONST_PROOF_SIZE_LOG_N; idx++) { gate_challenges[idx] = transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } auto [multivariate_challenge, claimed_evaluations, sumcheck_verified] = diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp index df7716a8f9b..efcb123dcdf 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp @@ -92,7 +92,7 @@ template class RecursiveVerifierTest : public testing /** * @brief Instantiate a recursive verification key from the native verification key produced by the inner cicuit - * builder. Check consistency beteen the native and stdlib types. + * builder. Check consistency between the native and stdlib types. * */ static void test_recursive_verification_key_creation() @@ -117,9 +117,18 @@ template class RecursiveVerifierTest : public testing } } + /** + * @brief Ensures that the recursive verifier circuit for two inner circuits of different size is the same as the + * proofs are currently constant. This is done by taking each trace block in part and checking all it's selector + * values. + * + */ static void test_independent_vk_hash() { - auto get_blocks = [](size_t inner_size) { // Create an arbitrary inner circuit + // Retrieves the trace blocks (each consisting of a specific gate) from the recursive verifier circuit + auto get_blocks = [](size_t inner_size) + -> std::tuple> { + // Create an arbitrary inner circuit auto inner_circuit = create_inner_circuit(inner_size); // Generate a proof over the inner circuit @@ -135,33 +144,55 @@ template class RecursiveVerifierTest : public testing [[maybe_unused]] auto pairing_points = verifier.verify_proof( inner_proof, init_default_aggregation_state(outer_circuit)); - return outer_circuit.blocks; + + auto outer_instance = std::make_shared(outer_circuit); + auto outer_verification_key = + std::make_shared(outer_instance->proving_key); + + return { outer_circuit.blocks, outer_verification_key }; }; bool broke(false); auto check_eq = [&broke](auto& p1, auto& p2) { + EXPECT_TRUE(p1.size() == p2.size()); for (size_t idx = 0; idx < p1.size(); idx++) { if (p1[idx] != p2[idx]) { broke = true; - info("discrepancy at value index: ", idx); break; } } }; - auto blocks_10 = get_blocks(10); - auto blocks_11 = get_blocks(11); + auto [blocks_10, verification_key_10] = get_blocks(10); + auto [blocks_11, verification_key_11] = get_blocks(11); + size_t block_idx = 0; for (auto [b_10, b_11] : zip_view(blocks_10.get(), blocks_11.get())) { info("block index: ", block_idx); size_t sel_idx = 0; + EXPECT_TRUE(b_10.selectors.size() == 13); + EXPECT_TRUE(b_11.selectors.size() == 13); for (auto [p_10, p_11] : zip_view(b_10.selectors, b_11.selectors)) { + info("sel index: ", sel_idx); check_eq(p_10, p_11); sel_idx++; } block_idx++; } + + typename OuterFlavor::CommitmentLabels labels; + for (auto [vk_10, vk_11, label] : + zip_view(verification_key_10->get_all(), verification_key_11->get_all(), labels.get_precomputed())) { + if (vk_10 != vk_11) { + broke = true; + info("Mismatch verification key label: ", label, " left: ", vk_10, " right: ", vk_11); + } + } + + EXPECT_TRUE(verification_key_10->circuit_size == verification_key_11->circuit_size); + EXPECT_TRUE(verification_key_10->num_public_inputs == verification_key_11->num_public_inputs); + EXPECT_FALSE(broke); } @@ -183,6 +214,10 @@ template class RecursiveVerifierTest : public testing // Create a recursive verification circuit for the proof of the inner circuit OuterBuilder outer_circuit; RecursiveVerifier verifier{ &outer_circuit, verification_key }; + typename RecursiveFlavor::CommitmentLabels commitment_labels; + for (auto [label, key] : zip_view(commitment_labels.get_precomputed(), verifier.key->get_all())) { + info("label: ", label, " value: ", key.get_value()); + } aggregation_state agg_obj = init_default_aggregation_state(outer_circuit); auto pairing_points = verifier.verify_proof(inner_proof, agg_obj); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.hpp b/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.hpp index 5aeeaf8a6c6..3bc2e70d156 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.hpp @@ -10,45 +10,34 @@ namespace bb::stdlib::recursion::honk { template struct StdlibTranscriptParams { using Fr = stdlib::field_t; using Proof = std::vector; + static inline Fr hash(const std::vector& data) { - if constexpr (std::is_same_v) { - ASSERT(!data.empty() && data[0].get_context() != nullptr); - Builder* builder = data[0].get_context(); - return stdlib::poseidon2::hash(*builder, data); - } else { - // TODO(https://github.com/AztecProtocol/barretenberg/issues/1035): Add constraints for hashing in Ultra - using NativeFr = bb::fr; - ASSERT(!data.empty() && data[0].get_context() != nullptr); - Builder* builder = data[0].get_context(); - - // call the native hash on the data - std::vector native_data; - native_data.reserve(data.size()); - for (const auto& fr : data) { - native_data.push_back(fr.get_value()); - } - NativeFr hash_value = crypto::Poseidon2::hash(native_data); - - Fr hash_field_ct = Fr::from_witness(builder, hash_value); - return hash_field_ct; - } + + ASSERT(!data.empty() && data[0].get_context() != nullptr); + + Builder* builder = data[0].get_context(); + return stdlib::poseidon2::hash(*builder, data); } + template static inline T convert_challenge(const Fr& challenge) { Builder* builder = challenge.get_context(); return bb::stdlib::field_conversion::convert_challenge(*builder, challenge); } + template static constexpr size_t calc_num_bn254_frs() { return bb::stdlib::field_conversion::calc_num_bn254_frs(); } + template static inline T convert_from_bn254_frs(std::span frs) { ASSERT(!frs.empty() && frs[0].get_context() != nullptr); Builder* builder = frs[0].get_context(); return bb::stdlib::field_conversion::convert_from_bn254_frs(*builder, frs); } + template static inline std::vector convert_to_bn254_frs(const T& element) { Builder* builder = element.get_context(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.test.cpp index 9b532748a7e..6369a7149a2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.test.cpp @@ -6,7 +6,10 @@ #include "barretenberg/polynomials/univariate.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" +#include "barretenberg/sumcheck/instance/prover_instance.hpp" #include "barretenberg/transcript/transcript.hpp" +#include "barretenberg/ultra_honk/ultra_prover.hpp" +#include "barretenberg/ultra_honk/ultra_verifier.hpp" namespace bb::stdlib::recursion::honk { diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/circuit_simulator.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/circuit_simulator.hpp index f6fac7fc4e6..1453291b318 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/circuit_simulator.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/circuit_simulator.hpp @@ -89,6 +89,9 @@ class CircuitSimulatorBN254 { void create_fixed_group_add_gate_final([[maybe_unused]] const add_quad_& in){}; void create_ecc_add_gate([[maybe_unused]] const ecc_add_gate_& in){}; + void create_poseidon2_internal_gate(const poseidon2_internal_gate_& in); + void create_poseidon2_external_gate(const poseidon2_external_gate_& in); + plookup::ReadData create_gates_from_plookup_accumulators( [[maybe_unused]] const plookup::MultiTableId& id, [[maybe_unused]] const plookup::ReadData& read_values, diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.cpp index ba08e46840d..3b547ae0fed 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.cpp @@ -57,52 +57,6 @@ template void MegaCircuitBuilder_::add_gates_to_ensure_all_pol read_idx = this->add_variable(raw_read_idx); read_return_data(read_idx); - // mock a poseidon external gate, with all zeros as input - this->blocks.poseidon_external.populate_wires(this->zero_idx, this->zero_idx, this->zero_idx, this->zero_idx); - this->blocks.poseidon_external.q_m().emplace_back(0); - this->blocks.poseidon_external.q_1().emplace_back(0); - this->blocks.poseidon_external.q_2().emplace_back(0); - this->blocks.poseidon_external.q_3().emplace_back(0); - this->blocks.poseidon_external.q_c().emplace_back(0); - this->blocks.poseidon_external.q_arith().emplace_back(0); - this->blocks.poseidon_external.q_4().emplace_back(0); - this->blocks.poseidon_external.q_delta_range().emplace_back(0); - this->blocks.poseidon_external.q_lookup_type().emplace_back(0); - this->blocks.poseidon_external.q_elliptic().emplace_back(0); - this->blocks.poseidon_external.q_aux().emplace_back(0); - this->blocks.poseidon_external.q_busread().emplace_back(0); - this->blocks.poseidon_external.q_poseidon2_external().emplace_back(1); - this->blocks.poseidon_external.q_poseidon2_internal().emplace_back(0); - this->check_selector_length_consistency(); - ++this->num_gates; - - // dummy gate to be read into by previous poseidon external gate via shifts - this->create_dummy_gate( - this->blocks.poseidon_external, this->zero_idx, this->zero_idx, this->zero_idx, this->zero_idx); - - // mock a poseidon internal gate, with all zeros as input - this->blocks.poseidon_internal.populate_wires(this->zero_idx, this->zero_idx, this->zero_idx, this->zero_idx); - this->blocks.poseidon_internal.q_m().emplace_back(0); - this->blocks.poseidon_internal.q_1().emplace_back(0); - this->blocks.poseidon_internal.q_2().emplace_back(0); - this->blocks.poseidon_internal.q_3().emplace_back(0); - this->blocks.poseidon_internal.q_c().emplace_back(0); - this->blocks.poseidon_internal.q_arith().emplace_back(0); - this->blocks.poseidon_internal.q_4().emplace_back(0); - this->blocks.poseidon_internal.q_delta_range().emplace_back(0); - this->blocks.poseidon_internal.q_lookup_type().emplace_back(0); - this->blocks.poseidon_internal.q_elliptic().emplace_back(0); - this->blocks.poseidon_internal.q_aux().emplace_back(0); - this->blocks.poseidon_internal.q_busread().emplace_back(0); - this->blocks.poseidon_internal.q_poseidon2_external().emplace_back(0); - this->blocks.poseidon_internal.q_poseidon2_internal().emplace_back(1); - this->check_selector_length_consistency(); - ++this->num_gates; - - // dummy gate to be read into by previous poseidon internal gate via shifts - this->create_dummy_gate( - this->blocks.poseidon_internal, this->zero_idx, this->zero_idx, this->zero_idx, this->zero_idx); - // add dummy mul accum op and an equality op this->queue_ecc_mul_accum(bb::g1::affine_element::one(), 2); this->queue_ecc_eq(); @@ -278,57 +232,5 @@ template void MegaCircuitBuilder_::apply_databus_selectors(con block.q_poseidon2_internal().emplace_back(0); } -/** - * @brief Poseidon2 external round gate, activates the q_poseidon2_external selector and relation - */ -template -void MegaCircuitBuilder_::create_poseidon2_external_gate(const poseidon2_external_gate_& in) -{ - auto& block = this->blocks.poseidon_external; - block.populate_wires(in.a, in.b, in.c, in.d); - block.q_m().emplace_back(0); - block.q_1().emplace_back(Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][0]); - block.q_2().emplace_back(Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][1]); - block.q_3().emplace_back(Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][2]); - block.q_c().emplace_back(0); - block.q_arith().emplace_back(0); - block.q_4().emplace_back(Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][3]); - block.q_delta_range().emplace_back(0); - block.q_lookup_type().emplace_back(0); - block.q_elliptic().emplace_back(0); - block.q_aux().emplace_back(0); - block.q_busread().emplace_back(0); - block.q_poseidon2_external().emplace_back(1); - block.q_poseidon2_internal().emplace_back(0); - this->check_selector_length_consistency(); - ++this->num_gates; -} - -/** - * @brief Poseidon2 internal round gate, activates the q_poseidon2_internal selector and relation - */ -template -void MegaCircuitBuilder_::create_poseidon2_internal_gate(const poseidon2_internal_gate_& in) -{ - auto& block = this->blocks.poseidon_internal; - block.populate_wires(in.a, in.b, in.c, in.d); - block.q_m().emplace_back(0); - block.q_1().emplace_back(Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][0]); - block.q_2().emplace_back(0); - block.q_3().emplace_back(0); - block.q_c().emplace_back(0); - block.q_arith().emplace_back(0); - block.q_4().emplace_back(0); - block.q_delta_range().emplace_back(0); - block.q_lookup_type().emplace_back(0); - block.q_elliptic().emplace_back(0); - block.q_aux().emplace_back(0); - block.q_busread().emplace_back(0); - block.q_poseidon2_external().emplace_back(0); - block.q_poseidon2_internal().emplace_back(1); - this->check_selector_length_consistency(); - ++this->num_gates; -} - template class MegaCircuitBuilder_; } // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp index 5287e295a32..37fe7724153 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp @@ -233,9 +233,6 @@ template class MegaCircuitBuilder_ : public UltraCircuitBuilder_(BusId::CALLDATA)]; } const BusVector& get_secondary_calldata() { return databus[static_cast(BusId::SECONDARY_CALLDATA)]; } const BusVector& get_return_data() { return databus[static_cast(BusId::RETURNDATA)]; } - - void create_poseidon2_external_gate(const poseidon2_external_gate_& in); - void create_poseidon2_internal_gate(const poseidon2_internal_gate_& in); }; using MegaCircuitBuilder = MegaCircuitBuilder_; } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp index e3e3b71cbd2..71ee188af4e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp @@ -69,7 +69,7 @@ class MegaFlavor { static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length(); static constexpr size_t MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length(); - + static_assert(MAX_TOTAL_RELATION_LENGTH == 11); // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta` // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation // length = 3 diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp index 20d43632405..8d105adb10b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp @@ -188,7 +188,7 @@ template class MegaRecursiveFlavor_ { using CommitmentLabels = MegaFlavor::CommitmentLabels; // Reuse the VerifierCommitments from Mega using VerifierCommitments = MegaFlavor::VerifierCommitments_; - // Reuse the transcript from Mega + using Transcript = bb::BaseTranscript>; }; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_circuit_builder.cpp index 42e24195960..cfcfa41a70c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_circuit_builder.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_circuit_builder.cpp @@ -6,6 +6,7 @@ * */ #include "ultra_circuit_builder.hpp" +#include "barretenberg/crypto/poseidon2/poseidon2_params.hpp" #include #include #include @@ -75,6 +76,8 @@ void UltraCircuitBuilder_::add_gates_to_ensure_all_polys_are_no blocks.arithmetic.q_lookup_type().emplace_back(0); blocks.arithmetic.q_elliptic().emplace_back(0); blocks.arithmetic.q_aux().emplace_back(0); + blocks.arithmetic.q_poseidon2_external().emplace_back(0); + blocks.arithmetic.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.arithmetic.pad_additional(); } @@ -94,6 +97,9 @@ void UltraCircuitBuilder_::add_gates_to_ensure_all_polys_are_no blocks.delta_range.q_lookup_type().emplace_back(0); blocks.delta_range.q_elliptic().emplace_back(0); blocks.delta_range.q_aux().emplace_back(0); + blocks.delta_range.q_poseidon2_external().emplace_back(0); + blocks.delta_range.q_poseidon2_internal().emplace_back(0); + if constexpr (HasAdditionalSelectors) { blocks.delta_range.pad_additional(); } @@ -114,6 +120,8 @@ void UltraCircuitBuilder_::add_gates_to_ensure_all_polys_are_no blocks.elliptic.q_lookup_type().emplace_back(0); blocks.elliptic.q_elliptic().emplace_back(1); blocks.elliptic.q_aux().emplace_back(0); + blocks.elliptic.q_poseidon2_external().emplace_back(0); + blocks.elliptic.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.elliptic.pad_additional(); } @@ -134,6 +142,8 @@ void UltraCircuitBuilder_::add_gates_to_ensure_all_polys_are_no blocks.aux.q_lookup_type().emplace_back(0); blocks.aux.q_elliptic().emplace_back(0); blocks.aux.q_aux().emplace_back(1); + blocks.aux.q_poseidon2_external().emplace_back(0); + blocks.aux.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.aux.pad_additional(); } @@ -164,6 +174,54 @@ void UltraCircuitBuilder_::add_gates_to_ensure_all_polys_are_no plookup::MultiTableId::HONK_DUMMY_MULTI, left_witness_value, right_witness_value, true); create_gates_from_plookup_accumulators( plookup::MultiTableId::HONK_DUMMY_MULTI, dummy_accumulators, left_witness_index, right_witness_index); + + // mock a poseidon external gate, with all zeros as input + blocks.poseidon_external.populate_wires(this->zero_idx, this->zero_idx, this->zero_idx, this->zero_idx); + blocks.poseidon_external.q_m().emplace_back(0); + blocks.poseidon_external.q_1().emplace_back(0); + blocks.poseidon_external.q_2().emplace_back(0); + blocks.poseidon_external.q_3().emplace_back(0); + blocks.poseidon_external.q_c().emplace_back(0); + blocks.poseidon_external.q_arith().emplace_back(0); + blocks.poseidon_external.q_4().emplace_back(0); + blocks.poseidon_external.q_delta_range().emplace_back(0); + blocks.poseidon_external.q_lookup_type().emplace_back(0); + blocks.poseidon_external.q_elliptic().emplace_back(0); + blocks.poseidon_external.q_aux().emplace_back(0); + blocks.poseidon_external.q_poseidon2_external().emplace_back(1); + blocks.poseidon_external.q_poseidon2_internal().emplace_back(0); + if constexpr (HasAdditionalSelectors) { + blocks.poseidon_external.pad_additional(); + } + check_selector_length_consistency(); + ++this->num_gates; + + // dummy gate to be read into by previous poseidon external gate via shifts + this->create_dummy_gate(blocks.poseidon_external, this->zero_idx, this->zero_idx, this->zero_idx, this->zero_idx); + + // mock a poseidon internal gate, with all zeros as input + blocks.poseidon_internal.populate_wires(this->zero_idx, this->zero_idx, this->zero_idx, this->zero_idx); + blocks.poseidon_internal.q_m().emplace_back(0); + blocks.poseidon_internal.q_1().emplace_back(0); + blocks.poseidon_internal.q_2().emplace_back(0); + blocks.poseidon_internal.q_3().emplace_back(0); + blocks.poseidon_internal.q_c().emplace_back(0); + blocks.poseidon_internal.q_arith().emplace_back(0); + blocks.poseidon_internal.q_4().emplace_back(0); + blocks.poseidon_internal.q_delta_range().emplace_back(0); + blocks.poseidon_internal.q_lookup_type().emplace_back(0); + blocks.poseidon_internal.q_elliptic().emplace_back(0); + blocks.poseidon_internal.q_aux().emplace_back(0); + blocks.poseidon_internal.q_poseidon2_external().emplace_back(0); + blocks.poseidon_internal.q_poseidon2_internal().emplace_back(1); + if constexpr (HasAdditionalSelectors) { + blocks.poseidon_internal.pad_additional(); + } + check_selector_length_consistency(); + ++this->num_gates; + + // dummy gate to be read into by previous poseidon internal gate via shifts + create_dummy_gate(blocks.poseidon_internal, this->zero_idx, this->zero_idx, this->zero_idx, this->zero_idx); } /** @@ -191,6 +249,8 @@ void UltraCircuitBuilder_::create_add_gate(const add_triple_) { blocks.arithmetic.pad_additional(); } @@ -223,6 +283,8 @@ void UltraCircuitBuilder_::create_big_add_gate(const add_quad_< blocks.arithmetic.q_lookup_type().emplace_back(0); blocks.arithmetic.q_elliptic().emplace_back(0); blocks.arithmetic.q_aux().emplace_back(0); + blocks.arithmetic.q_poseidon2_external().emplace_back(0); + blocks.arithmetic.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.arithmetic.pad_additional(); } @@ -317,6 +379,8 @@ void UltraCircuitBuilder_::create_big_mul_gate(const mul_quad_< blocks.arithmetic.q_lookup_type().emplace_back(0); blocks.arithmetic.q_elliptic().emplace_back(0); blocks.arithmetic.q_aux().emplace_back(0); + blocks.arithmetic.q_poseidon2_external().emplace_back(0); + blocks.arithmetic.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.arithmetic.pad_additional(); } @@ -343,6 +407,8 @@ void UltraCircuitBuilder_::create_balanced_add_gate(const add_q blocks.arithmetic.q_lookup_type().emplace_back(0); blocks.arithmetic.q_elliptic().emplace_back(0); blocks.arithmetic.q_aux().emplace_back(0); + blocks.arithmetic.q_poseidon2_external().emplace_back(0); + blocks.arithmetic.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.arithmetic.pad_additional(); } @@ -385,6 +451,8 @@ void UltraCircuitBuilder_::create_mul_gate(const mul_triple_) { blocks.arithmetic.pad_additional(); } @@ -414,6 +482,8 @@ void UltraCircuitBuilder_::create_bool_gate(const uint32_t vari blocks.arithmetic.q_lookup_type().emplace_back(0); blocks.arithmetic.q_elliptic().emplace_back(0); blocks.arithmetic.q_aux().emplace_back(0); + blocks.arithmetic.q_poseidon2_external().emplace_back(0); + blocks.arithmetic.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.arithmetic.pad_additional(); } @@ -445,6 +515,8 @@ void UltraCircuitBuilder_::create_poly_gate(const poly_triple_< blocks.arithmetic.q_lookup_type().emplace_back(0); blocks.arithmetic.q_elliptic().emplace_back(0); blocks.arithmetic.q_aux().emplace_back(0); + blocks.arithmetic.q_poseidon2_external().emplace_back(0); + blocks.arithmetic.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.arithmetic.pad_additional(); } @@ -504,6 +576,8 @@ void UltraCircuitBuilder_::create_ecc_add_gate(const ecc_add_ga block.q_lookup_type().emplace_back(0); block.q_elliptic().emplace_back(1); block.q_aux().emplace_back(0); + block.q_poseidon2_external().emplace_back(0); + block.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { block.pad_additional(); } @@ -557,6 +631,8 @@ void UltraCircuitBuilder_::create_ecc_dbl_gate(const ecc_dbl_ga block.q_delta_range().emplace_back(0); block.q_lookup_type().emplace_back(0); block.q_aux().emplace_back(0); + block.q_poseidon2_external().emplace_back(0); + block.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { block.pad_additional(); } @@ -589,6 +665,8 @@ void UltraCircuitBuilder_::fix_witness(const uint32_t witness_i blocks.arithmetic.q_lookup_type().emplace_back(0); blocks.arithmetic.q_elliptic().emplace_back(0); blocks.arithmetic.q_aux().emplace_back(0); + blocks.arithmetic.q_poseidon2_external().emplace_back(0); + blocks.arithmetic.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.arithmetic.pad_additional(); } @@ -673,6 +751,8 @@ plookup::ReadData UltraCircuitBuilder_::create_gates_ blocks.lookup.q_delta_range().emplace_back(0); blocks.lookup.q_elliptic().emplace_back(0); blocks.lookup.q_aux().emplace_back(0); + blocks.lookup.q_poseidon2_external().emplace_back(0); + blocks.lookup.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.lookup.pad_additional(); } @@ -983,6 +1063,8 @@ void UltraCircuitBuilder_::create_sort_constraint(const std::ve blocks.delta_range.q_elliptic().emplace_back(0); blocks.delta_range.q_lookup_type().emplace_back(0); blocks.delta_range.q_aux().emplace_back(0); + blocks.delta_range.q_poseidon2_external().emplace_back(0); + blocks.delta_range.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.delta_range.pad_additional(); } @@ -1017,6 +1099,9 @@ void UltraCircuitBuilder_::create_dummy_gate( block.q_elliptic().emplace_back(0); block.q_lookup_type().emplace_back(0); block.q_aux().emplace_back(0); + block.q_poseidon2_external().emplace_back(0); + block.q_poseidon2_internal().emplace_back(0); + if constexpr (HasAdditionalSelectors) { block.pad_additional(); } @@ -1075,6 +1160,8 @@ void UltraCircuitBuilder_::create_sort_constraint_with_edges( block.q_elliptic().emplace_back(0); block.q_lookup_type().emplace_back(0); block.q_aux().emplace_back(0); + block.q_poseidon2_external().emplace_back(0); + block.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { block.pad_additional(); } @@ -1098,6 +1185,8 @@ void UltraCircuitBuilder_::create_sort_constraint_with_edges( block.q_elliptic().emplace_back(0); block.q_lookup_type().emplace_back(0); block.q_aux().emplace_back(0); + block.q_poseidon2_external().emplace_back(0); + block.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { block.pad_additional(); } @@ -1215,9 +1304,12 @@ void UltraCircuitBuilder_::apply_aux_selectors(const AUX_SELECT { auto& block = blocks.aux; block.q_aux().emplace_back(type == AUX_SELECTORS::NONE ? 0 : 1); + // Set to zero the selectors that are not enabled for this gate block.q_delta_range().emplace_back(0); block.q_lookup_type().emplace_back(0); block.q_elliptic().emplace_back(0); + block.q_poseidon2_external().emplace_back(0); + block.q_poseidon2_internal().emplace_back(0); switch (type) { case AUX_SELECTORS::LIMB_ACCUMULATE_1: { block.q_1().emplace_back(0); @@ -1636,6 +1728,8 @@ std::array UltraCircuitBuilder_::evaluate_non_nati blocks.aux.q_lookup_type().emplace_back(0); blocks.aux.q_elliptic().emplace_back(0); blocks.aux.q_aux().emplace_back(0); + blocks.aux.q_poseidon2_external().emplace_back(0); + blocks.aux.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { blocks.aux.pad_additional(); } @@ -1920,6 +2014,8 @@ std::array UltraCircuitBuilder_::evaluate_non_nati block.q_lookup_type().emplace_back(0); block.q_elliptic().emplace_back(0); block.q_aux().emplace_back(0); + block.q_poseidon2_external().emplace_back(0); + block.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { block.pad_additional(); } @@ -2040,6 +2136,8 @@ std::array UltraCircuitBuilder_::evaluate_non_nati block.q_lookup_type().emplace_back(0); block.q_elliptic().emplace_back(0); block.q_aux().emplace_back(0); + block.q_poseidon2_external().emplace_back(0); + block.q_poseidon2_internal().emplace_back(0); if constexpr (HasAdditionalSelectors) { block.pad_additional(); } @@ -2695,6 +2793,62 @@ template void UltraCircuitBuilder_:: } } +/** + * @brief Poseidon2 external round gate, activates the q_poseidon2_external selector and relation + */ +template +void UltraCircuitBuilder_::create_poseidon2_external_gate(const poseidon2_external_gate_& in) +{ + auto& block = this->blocks.poseidon_external; + block.populate_wires(in.a, in.b, in.c, in.d); + block.q_m().emplace_back(0); + block.q_1().emplace_back(crypto::Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][0]); + block.q_2().emplace_back(crypto::Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][1]); + block.q_3().emplace_back(crypto::Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][2]); + block.q_c().emplace_back(0); + block.q_arith().emplace_back(0); + block.q_4().emplace_back(crypto::Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][3]); + block.q_delta_range().emplace_back(0); + block.q_lookup_type().emplace_back(0); + block.q_elliptic().emplace_back(0); + block.q_aux().emplace_back(0); + block.q_poseidon2_external().emplace_back(1); + block.q_poseidon2_internal().emplace_back(0); + if constexpr (HasAdditionalSelectors) { + block.pad_additional(); + } + this->check_selector_length_consistency(); + ++this->num_gates; +} + +/** + * @brief Poseidon2 internal round gate, activates the q_poseidon2_internal selector and relation + */ +template +void UltraCircuitBuilder_::create_poseidon2_internal_gate(const poseidon2_internal_gate_& in) +{ + auto& block = this->blocks.poseidon_internal; + block.populate_wires(in.a, in.b, in.c, in.d); + block.q_m().emplace_back(0); + block.q_1().emplace_back(crypto::Poseidon2Bn254ScalarFieldParams::round_constants[in.round_idx][0]); + block.q_2().emplace_back(0); + block.q_3().emplace_back(0); + block.q_c().emplace_back(0); + block.q_arith().emplace_back(0); + block.q_4().emplace_back(0); + block.q_delta_range().emplace_back(0); + block.q_lookup_type().emplace_back(0); + block.q_elliptic().emplace_back(0); + block.q_aux().emplace_back(0); + block.q_poseidon2_external().emplace_back(0); + block.q_poseidon2_internal().emplace_back(1); + if constexpr (HasAdditionalSelectors) { + block.pad_additional(); + } + this->check_selector_length_consistency(); + ++this->num_gates; +} + template uint256_t UltraCircuitBuilder_::hash_circuit() { finalize_circuit(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp index 931245f7876..567268caf16 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp @@ -588,6 +588,8 @@ class UltraCircuitBuilder_ : public CircuitBuilderBase& in); + void create_poseidon2_internal_gate(const poseidon2_internal_gate_& in); + uint256_t hash_circuit(); msgpack::sbuffer export_circuit() override; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp index 710f2d7624c..926ad32f1c7 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp @@ -14,6 +14,8 @@ #include "barretenberg/relations/elliptic_relation.hpp" #include "barretenberg/relations/logderiv_lookup_relation.hpp" #include "barretenberg/relations/permutation_relation.hpp" +#include "barretenberg/relations/poseidon2_external_relation.hpp" +#include "barretenberg/relations/poseidon2_internal_relation.hpp" #include "barretenberg/relations/relation_parameters.hpp" #include "barretenberg/relations/ultra_arithmetic_relation.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp" @@ -38,10 +40,10 @@ class UltraFlavor { static constexpr size_t NUM_WIRES = CircuitBuilder::NUM_WIRES; // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We often // need containers of this size to hold related data, so we choose a name more agnostic than `NUM_POLYNOMIALS`. - static constexpr size_t NUM_ALL_ENTITIES = 42; + static constexpr size_t NUM_ALL_ENTITIES = 44; // The number of polynomials precomputed to describe a circuit and to aid a prover in constructing a satisfying // assignment of witnesses. We again choose a neutral name. - static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 25; + static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 27; // The total number of witness entities not including shifts. static constexpr size_t NUM_WITNESS_ENTITIES = 8; // The total number of witnesses including shifts and derived entities. @@ -53,16 +55,20 @@ class UltraFlavor { // define the tuple of Relations that comprise the Sumcheck relation // Note: made generic for use in MegaRecursive. template + using Relations_ = std::tuple, bb::UltraPermutationRelation, - bb::LogDerivLookupRelation, bb::DeltaRangeConstraintRelation, bb::EllipticRelation, - bb::AuxiliaryRelation>; + bb::AuxiliaryRelation, + bb::LogDerivLookupRelation, + bb::Poseidon2ExternalRelation, + bb::Poseidon2InternalRelation>; + using Relations = Relations_; static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length(); - static_assert(MAX_PARTIAL_RELATION_LENGTH == 6); + static_assert(MAX_PARTIAL_RELATION_LENGTH == 7); static constexpr size_t MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length(); static_assert(MAX_TOTAL_RELATION_LENGTH == 11); static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations(); @@ -102,37 +108,51 @@ class UltraFlavor { public: using DataType = DataType_; DEFINE_FLAVOR_MEMBERS(DataType, - q_m, // column 0 - q_c, // column 1 - q_l, // column 2 - q_r, // column 3 - q_o, // column 4 - q_4, // column 5 - q_arith, // column 6 - q_delta_range, // column 7 - q_elliptic, // column 8 - q_aux, // column 9 - q_lookup, // column 10 - sigma_1, // column 11 - sigma_2, // column 12 - sigma_3, // column 13 - sigma_4, // column 14 - id_1, // column 15 - id_2, // column 16 - id_3, // column 17 - id_4, // column 18 - table_1, // column 19 - table_2, // column 20 - table_3, // column 21 - table_4, // column 22 - lagrange_first, // column 23 - lagrange_last) // column 24 + q_m, // column 0 + q_c, // column 1 + q_l, // column 2 + q_r, // column 3 + q_o, // column 4 + q_4, // column 5 + q_arith, // column 6 + q_delta_range, // column 7 + q_elliptic, // column 8 + q_aux, // column 9 + q_lookup, // column 10 + q_poseidon2_external, // column 11 + q_poseidon2_internal, // column 12 + sigma_1, // column 13 + sigma_2, // column 14 + sigma_3, // column 15 + sigma_4, // column 16 + id_1, // column 17 + id_2, // column 18 + id_3, // column 19 + id_4, // column 20 + table_1, // column 21 + table_2, // column 22 + table_3, // column 23 + table_4, // column 24 + lagrange_first, // column 25 + lagrange_last) // column 26 static constexpr CircuitType CIRCUIT_TYPE = CircuitBuilder::CIRCUIT_TYPE; auto get_selectors() { - return RefArray{ q_m, q_c, q_l, q_r, q_o, q_4, q_arith, q_delta_range, q_elliptic, q_aux, q_lookup }; + return RefArray{ q_m, + q_c, + q_l, + q_r, + q_o, + q_4, + q_arith, + q_delta_range, + q_elliptic, + q_aux, + q_lookup, + q_poseidon2_external, + q_poseidon2_internal }; }; auto get_sigma_polynomials() { return RefArray{ sigma_1, sigma_2, sigma_3, sigma_4 }; }; auto get_id_polynomials() { return RefArray{ id_1, id_2, id_3, id_4 }; }; @@ -434,6 +454,8 @@ class UltraFlavor { const Commitment& q_elliptic, const Commitment& q_aux, const Commitment& q_lookup, + const Commitment& q_poseidon2_external, + const Commitment& q_poseidon2_internal, const Commitment& sigma_1, const Commitment& sigma_2, const Commitment& sigma_3, @@ -466,6 +488,8 @@ class UltraFlavor { this->q_elliptic = q_elliptic; this->q_aux = q_aux; this->q_lookup = q_lookup; + this->q_poseidon2_external = q_poseidon2_external; + this->q_poseidon2_internal = q_poseidon2_internal; this->sigma_1 = sigma_1; this->sigma_2 = sigma_2; this->sigma_3 = sigma_3; @@ -500,6 +524,8 @@ class UltraFlavor { q_elliptic, q_aux, q_lookup, + q_poseidon2_external, + q_poseidon2_internal, sigma_1, sigma_2, sigma_3, @@ -585,6 +611,8 @@ class UltraFlavor { q_elliptic = "Q_ELLIPTIC"; q_aux = "Q_AUX"; q_lookup = "Q_LOOKUP"; + q_poseidon2_external = "Q_POSEIDON2_EXTERNAL"; + q_poseidon2_internal = "Q_POSEIDON2_INTERNAL"; sigma_1 = "SIGMA_1"; sigma_2 = "SIGMA_2"; sigma_3 = "SIGMA_3"; @@ -611,7 +639,7 @@ class UltraFlavor { class VerifierCommitments_ : public AllEntities { public: VerifierCommitments_(const std::shared_ptr& verification_key, - const std::optional& witness_commitments = std::nullopt) + const std::optional>& witness_commitments = std::nullopt) { this->q_m = verification_key->q_m; this->q_c = verification_key->q_c; @@ -624,6 +652,8 @@ class UltraFlavor { this->q_elliptic = verification_key->q_elliptic; this->q_aux = verification_key->q_aux; this->q_lookup = verification_key->q_lookup; + this->q_poseidon2_external = verification_key->q_poseidon2_external; + this->q_poseidon2_internal = verification_key->q_poseidon2_internal; this->sigma_1 = verification_key->sigma_1; this->sigma_2 = verification_key->sigma_2; this->sigma_3 = verification_key->sigma_3; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak.hpp index ecb74ee5494..b9bbfa35c2f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak.hpp @@ -21,6 +21,7 @@ namespace bb { +// TODO(https://github.com/AztecProtocol/barretenberg/issues/1078): Update flavor to support Poseidon relation. class UltraKeccakFlavor { public: using CircuitBuilder = UltraCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp index c1f828e1516..0faaaf60cba 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp @@ -73,9 +73,9 @@ template class UltraRecursiveFlavor_ { using Relations = UltraFlavor::Relations_; static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length(); - static_assert(MAX_PARTIAL_RELATION_LENGTH == 6); + // static_assert(MAX_PARTIAL_RELATION_LENGTH == 7); static constexpr size_t MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length(); - static_assert(MAX_TOTAL_RELATION_LENGTH == 11); + // static_assert(MAX_TOTAL_RELATION_LENGTH == 11); // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta` // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation @@ -138,6 +138,8 @@ template class UltraRecursiveFlavor_ { this->q_elliptic = Commitment::from_witness(builder, native_key->q_elliptic); this->q_aux = Commitment::from_witness(builder, native_key->q_aux); this->q_lookup = Commitment::from_witness(builder, native_key->q_lookup); + this->q_poseidon2_external = Commitment::from_witness(builder, native_key->q_poseidon2_external); + this->q_poseidon2_internal = Commitment::from_witness(builder, native_key->q_poseidon2_internal); this->sigma_1 = Commitment::from_witness(builder, native_key->sigma_1); this->sigma_2 = Commitment::from_witness(builder, native_key->sigma_2); this->sigma_3 = Commitment::from_witness(builder, native_key->sigma_3); @@ -216,50 +218,8 @@ template class UltraRecursiveFlavor_ { using WitnessCommitments = UltraFlavor::WitnessEntities; - class VerifierCommitments : public UltraFlavor::AllEntities { - public: - VerifierCommitments(const std::shared_ptr& verification_key, - const std::optional& witness_commitments = std::nullopt) - { - this->q_m = verification_key->q_m; - this->q_l = verification_key->q_l; - this->q_r = verification_key->q_r; - this->q_o = verification_key->q_o; - this->q_4 = verification_key->q_4; - this->q_c = verification_key->q_c; - this->q_arith = verification_key->q_arith; - this->q_delta_range = verification_key->q_delta_range; - this->q_elliptic = verification_key->q_elliptic; - this->q_aux = verification_key->q_aux; - this->q_lookup = verification_key->q_lookup; - this->sigma_1 = verification_key->sigma_1; - this->sigma_2 = verification_key->sigma_2; - this->sigma_3 = verification_key->sigma_3; - this->sigma_4 = verification_key->sigma_4; - this->id_1 = verification_key->id_1; - this->id_2 = verification_key->id_2; - this->id_3 = verification_key->id_3; - this->id_4 = verification_key->id_4; - this->table_1 = verification_key->table_1; - this->table_2 = verification_key->table_2; - this->table_3 = verification_key->table_3; - this->table_4 = verification_key->table_4; - this->lagrange_first = verification_key->lagrange_first; - this->lagrange_last = verification_key->lagrange_last; - - if (witness_commitments.has_value()) { - auto commitments = witness_commitments.value(); - this->w_l = commitments.w_l; - this->w_r = commitments.w_r; - this->w_o = commitments.w_o; - this->lookup_inverses = commitments.lookup_inverses; - this->lookup_read_counts = commitments.lookup_read_counts; - this->lookup_read_tags = commitments.lookup_read_tags; - this->w_4 = commitments.w_4; - this->z_perm = commitments.z_perm; - } - } - }; + // Reuse the VerifierCommitments from Ultra + using VerifierCommitments = UltraFlavor::VerifierCommitments_; using Transcript = bb::BaseTranscript>; }; diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp index a25bf3f8d81..9a814855092 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp @@ -210,8 +210,10 @@ template class SumcheckProver { if constexpr (Flavor::HasZK) { setup_zk_sumcheck_data(zk_sumcheck_data); }; + bb::PowPolynomial pow_univariate(gate_challenges); - pow_univariate.compute_values(); + pow_univariate.compute_values(multivariate_d); + std::vector multivariate_challenge; multivariate_challenge.reserve(multivariate_d); size_t round_idx = 0; @@ -607,7 +609,6 @@ polynomials that are sent in clear. P_{N_w} \f$, the prover sends the evaluations of the witness polynomials masked by the terms \f$ \rho_j \sum_{i=0}^{d-1} u_i(1-u_i) \f$ for \f$ j= 1, \ldots N_w\f$. If the challenges satisfy the equation \f$\sum_{i=0}^{d-1} u_i(1-u_i) = 0\f$, each masking term is \f$0 \f$, which could lead to the leakage of witness - information. The challenges satisfy this equation with probability \f$ \sim 1/|\mathbb{F}|\f$. * * @param multivariate_challenge */ diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.hpp index 14ccd07c72f..1e572c91304 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.hpp @@ -438,19 +438,7 @@ template class SumcheckVerifierRound { // TODO(#673): Conditionals like this can go away once native verification is is just recursive verification // with a simulated builder. bool sumcheck_round_failed(false); - if constexpr (IsRecursiveFlavor) { - if constexpr (IsECCVMRecursiveFlavor) { - // https://github.com/AztecProtocol/barretenberg/issues/998): Avoids the scenario where the assert_equal - // below fails because we are comparing a constant against a non-constant value and the non-constant - // value is in relaxed form. This happens at the first round when target_total_sum is initially set to - // 0. - total_sum.self_reduce(); - } - target_total_sum.assert_equal(total_sum); - sumcheck_round_failed = (target_total_sum.get_value() != total_sum.get_value()); - } else { - sumcheck_round_failed = (target_total_sum != total_sum); - } + sumcheck_round_failed = (target_total_sum != total_sum); round_failed = round_failed || sumcheck_round_failed; return !sumcheck_round_failed; @@ -472,20 +460,16 @@ template class SumcheckVerifierRound { // TODO(#673): Conditionals like this can go away once native verification is is just recursive verification // with a simulated builder. bool sumcheck_round_failed(false); - if constexpr (IsRecursiveFlavor) { - if constexpr (IsECCVMRecursiveFlavor) { - // https://github.com/AztecProtocol/barretenberg/issues/998): Avoids the scenario where the assert_equal - // below fails because we are comparing a constant against a non-constant value and the non-constant - // value is in relaxed form. This happens at the first round when target_total_sum is initially set to - // 0. - total_sum.self_reduce(); - } - target_total_sum.assert_equal(total_sum); - if (!dummy_round.get_value()) { - sumcheck_round_failed = (target_total_sum.get_value() != total_sum.get_value()); - } - } else { - sumcheck_round_failed = (target_total_sum != total_sum); + if constexpr (IsECCVMRecursiveFlavor) { + // https://github.com/AztecProtocol/barretenberg/issues/998): Avoids the scenario where the assert_equal + // below fails because we are comparing a constant against a non-constant value and the non-constant + // value is in relaxed form. This happens at the first round when target_total_sum is initially set to + // 0. + total_sum.self_reduce(); + } + target_total_sum.assert_equal(total_sum); + if (!dummy_round.get_value()) { + sumcheck_round_failed = (target_total_sum.get_value() != total_sum.get_value()); } round_failed = round_failed || sumcheck_round_failed; diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.hpp index 9b9f6b9de30..6a5ecb02341 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.hpp @@ -73,10 +73,10 @@ class TranslatorCircuitBuilder : public CircuitBuilderBase { // We don't need templating for Goblin using Fr = bb::fr; using Fq = bb::fq; - using Arithmetization = TranslatorArith; public: - static constexpr size_t NUM_WIRES = Arithmetization::NUM_WIRES; + static constexpr size_t NUM_WIRES = 81; + static constexpr size_t NUM_SELECTORS = 0; /** * We won't need these standard gates that are defined as virtual in circuit builder base diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_composer.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_composer.test.cpp index dcc4caef74c..360dd3f4f28 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_composer.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_composer.test.cpp @@ -16,7 +16,7 @@ using namespace bb; namespace { auto& engine = numeric::get_debug_randomness(); -class MegaHonkComposerTests : public ::testing::Test { +class MegaHonkTests : public ::testing::Test { protected: static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } @@ -64,7 +64,7 @@ class MegaHonkComposerTests : public ::testing::Test { * gates * */ -TEST_F(MegaHonkComposerTests, Basic) +TEST_F(MegaHonkTests, Basic) { MegaCircuitBuilder builder; @@ -79,7 +79,7 @@ TEST_F(MegaHonkComposerTests, Basic) * @brief Test proof construction/verification for a structured execution trace * */ -TEST_F(MegaHonkComposerTests, BasicStructured) +TEST_F(MegaHonkTests, BasicStructured) { MegaCircuitBuilder builder; @@ -102,7 +102,7 @@ TEST_F(MegaHonkComposerTests, BasicStructured) * with non-empty 'previous' data. This avoid complications with zero-commitments etc. * */ -TEST_F(MegaHonkComposerTests, SingleCircuit) +TEST_F(MegaHonkTests, SingleCircuit) { auto op_queue = std::make_shared(); @@ -125,7 +125,7 @@ TEST_F(MegaHonkComposerTests, SingleCircuit) * basic arithmetic gates * */ -TEST_F(MegaHonkComposerTests, MultipleCircuitsMergeOnly) +TEST_F(MegaHonkTests, MultipleCircuitsMergeOnly) { // Instantiate EccOpQueue. This will be shared across all circuits in the series auto op_queue = std::make_shared(); @@ -150,7 +150,7 @@ TEST_F(MegaHonkComposerTests, MultipleCircuitsMergeOnly) * basic arithmetic gates * */ -TEST_F(MegaHonkComposerTests, MultipleCircuitsHonkOnly) +TEST_F(MegaHonkTests, MultipleCircuitsHonkOnly) { // Instantiate EccOpQueue. This will be shared across all circuits in the series auto op_queue = std::make_shared(); @@ -175,7 +175,7 @@ TEST_F(MegaHonkComposerTests, MultipleCircuitsHonkOnly) * and basic arithmetic gates * */ -TEST_F(MegaHonkComposerTests, MultipleCircuitsHonkAndMerge) +TEST_F(MegaHonkTests, MultipleCircuitsHonkAndMerge) { // Instantiate EccOpQueue. This will be shared across all circuits in the series auto op_queue = std::make_shared(); diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp index 21de98a3584..928c749ac4d 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp @@ -31,12 +31,10 @@ class MegaTranscriptTests : public ::testing::Test { * * @return TranscriptManifest */ - static TranscriptManifest construct_mega_honk_manifest(size_t circuit_size) + static TranscriptManifest construct_mega_honk_manifest() { TranscriptManifest manifest_expected; - auto log_n = numeric::get_msb(circuit_size); - size_t MAX_PARTIAL_RELATION_LENGTH = Flavor::BATCHED_RELATION_PARTIAL_LENGTH; size_t NUM_SUBRELATIONS = Flavor::NUM_SUBRELATIONS; @@ -88,7 +86,7 @@ class MegaTranscriptTests : public ::testing::Test { round++; } - for (size_t i = 0; i < log_n; i++) { + for (size_t i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) { std::string label = "Sumcheck:gate_challenge_" + std::to_string(i); manifest_expected.add_challenge(round, label); round++; @@ -163,7 +161,7 @@ TEST_F(MegaTranscriptTests, ProverManifestConsistency) auto proof = prover.construct_proof(); // Check that the prover generated manifest agrees with the manifest hard coded in this suite - auto manifest_expected = construct_mega_honk_manifest(instance->proving_key.circuit_size); + auto manifest_expected = construct_mega_honk_manifest(); auto prover_manifest = prover.transcript->get_manifest(); // Note: a manifest can be printed using manifest.print() for (size_t round = 0; round < manifest_expected.size(); ++round) { diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp index 68b3bb7c484..705594a50ee 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp @@ -48,6 +48,8 @@ void ensure_non_zero(auto& polynomial) ASSERT_TRUE(has_non_zero_coefficient); } +// TODO(https://github.com/AztecProtocol/barretenberg/issues/1075): Make the tests run on UltraKeccakFlavor as well so +// we have a means of checking issues without having to run the Solidity verifier contract. class UltraHonkTests : public ::testing::Test { protected: static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } @@ -97,7 +99,6 @@ TEST_F(UltraHonkTests, StructuredTrace) // Construct an instance with a structured execution trace TraceStructure trace_structure = TraceStructure::SMALL_TEST; auto instance = std::make_shared(builder, trace_structure); - info(instance->proving_key.circuit_size); UltraProver prover(instance); auto verification_key = std::make_shared(instance->proving_key); UltraVerifier verifier(verification_key); @@ -937,4 +938,4 @@ TEST_F(UltraHonkTests, range_constraint_small_variable) circuit_builder.assert_equal(a_idx, c_idx); prove_and_verify(circuit_builder, /*expected_result=*/true); -} +} \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp index 7fe626eb220..9a7fd8fa07f 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp @@ -39,7 +39,7 @@ template HonkProof UltraProver_::export_proof() } template void UltraProver_::generate_gate_challenges() { - std::vector gate_challenges(numeric::get_msb(instance->proving_key.circuit_size)); + std::vector gate_challenges(CONST_PROOF_SIZE_LOG_N); for (size_t idx = 0; idx < gate_challenges.size(); idx++) { gate_challenges[idx] = transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp index 5124a0f64eb..887c3b55897 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp @@ -32,12 +32,10 @@ class UltraTranscriptTests : public ::testing::Test { * * @return TranscriptManifest */ - TranscriptManifest construct_ultra_honk_manifest(size_t circuit_size) + TranscriptManifest construct_ultra_honk_manifest() { TranscriptManifest manifest_expected; - auto log_n = numeric::get_msb(circuit_size); - size_t MAX_PARTIAL_RELATION_LENGTH = Flavor::BATCHED_RELATION_PARTIAL_LENGTH; size_t NUM_SUBRELATIONS = Flavor::NUM_SUBRELATIONS; // Size of types is number of bb::frs needed to represent the types @@ -73,7 +71,7 @@ class UltraTranscriptTests : public ::testing::Test { round++; } - for (size_t i = 0; i < log_n; i++) { + for (size_t i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) { std::string label = "Sumcheck:gate_challenge_" + std::to_string(i); manifest_expected.add_challenge(round, label); round++; @@ -141,7 +139,7 @@ TEST_F(UltraTranscriptTests, ProverManifestConsistency) auto proof = prover.construct_proof(); // Check that the prover generated manifest agrees with the manifest hard coded in this suite - auto manifest_expected = construct_ultra_honk_manifest(instance->proving_key.circuit_size); + auto manifest_expected = construct_ultra_honk_manifest(); auto prover_manifest = prover.transcript->get_manifest(); // Note: a manifest can be printed using manifest.print() for (size_t round = 0; round < manifest_expected.size(); ++round) { diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp index 7526a33a115..239f2bc66dd 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp @@ -61,8 +61,8 @@ template bool UltraVerifier_::verify_proof(const HonkP const size_t log_circuit_size = static_cast(numeric::get_msb(key->circuit_size)); auto sumcheck = SumcheckVerifier(log_circuit_size, transcript); - auto gate_challenges = std::vector(log_circuit_size); - for (size_t idx = 0; idx < log_circuit_size; idx++) { + auto gate_challenges = std::vector(CONST_PROOF_SIZE_LOG_N); + for (size_t idx = 0; idx < gate_challenges.size(); idx++) { gate_challenges[idx] = transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } auto [multivariate_challenge, claimed_evaluations, sumcheck_verified] = @@ -70,7 +70,7 @@ template bool UltraVerifier_::verify_proof(const HonkP // If Sumcheck did not verify, return false if (sumcheck_verified.has_value() && !sumcheck_verified.value()) { - info("Sumcheck verification failed."); + info("Ultra Verifier: Sumcheck verification failed."); return false; } diff --git a/barretenberg/sol/bootstrap.sh b/barretenberg/sol/bootstrap.sh index 03f5d31909c..e525e36e8f8 100755 --- a/barretenberg/sol/bootstrap.sh +++ b/barretenberg/sol/bootstrap.sh @@ -19,11 +19,12 @@ cd ../../sol echo "Building c++ binaries..." cd ../cpp cmake --preset clang16 -cmake --build --preset clang16 --target solidity_key_gen solidity_proof_gen +cmake --build --preset clang16 --target solidity_key_gen solidity_proof_gen honk_solidity_proof_gen honk_solidity_key_gen cd ../sol echo "Generating keys..." ./scripts/init.sh +./scripts/init_honk.sh echo "Formatting code..." forge fmt diff --git a/barretenberg/sol/src/honk/instance/Add2Honk.sol b/barretenberg/sol/src/honk/instance/Add2Honk.sol index a353795093c..06be6aa1a25 100644 --- a/barretenberg/sol/src/honk/instance/Add2Honk.sol +++ b/barretenberg/sol/src/honk/instance/Add2Honk.sol @@ -33,7 +33,7 @@ struct Transcript { Fr beta; Fr gamma; Fr[NUMBER_OF_ALPHAS] alphas; - Fr[LOG_N] gateChallenges; + Fr[CONST_PROOF_SIZE_LOG_N] gateChallenges; Fr[CONST_PROOF_SIZE_LOG_N] sumCheckUChallenges; Fr rho; // Zero morph @@ -59,7 +59,7 @@ library TranscriptLib { t.gateChallenges = generateGateChallenges(t.alphas[NUMBER_OF_ALPHAS - 1]); - t.sumCheckUChallenges = generateSumcheckChallenges(proof, t.gateChallenges[LOG_N - 1]); + t.sumCheckUChallenges = generateSumcheckChallenges(proof, t.gateChallenges[CONST_PROOF_SIZE_LOG_N - 1]); t.rho = generateRhoChallenge(proof, t.sumCheckUChallenges[CONST_PROOF_SIZE_LOG_N - 1]); t.zmY = generateZMYChallenge(t.rho, proof); @@ -153,8 +153,12 @@ library TranscriptLib { } } - function generateGateChallenges(Fr previousChallenge) internal view returns (Fr[LOG_N] memory gateChallenges) { - for (uint256 i = 0; i < LOG_N; i++) { + function generateGateChallenges(Fr previousChallenge) + internal + view + returns (Fr[CONST_PROOF_SIZE_LOG_N] memory gateChallenges) + { + for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) { previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge)))); gateChallenges[i] = previousChallenge; } diff --git a/barretenberg/sol/src/honk/instance/BlakeHonk.sol b/barretenberg/sol/src/honk/instance/BlakeHonk.sol index f94fa465c60..3bc154de40b 100644 --- a/barretenberg/sol/src/honk/instance/BlakeHonk.sol +++ b/barretenberg/sol/src/honk/instance/BlakeHonk.sol @@ -30,7 +30,7 @@ struct Transcript { Fr beta; Fr gamma; Fr[NUMBER_OF_ALPHAS] alphas; - Fr[LOG_N] gateChallenges; + Fr[CONST_PROOF_SIZE_LOG_N] gateChallenges; Fr[CONST_PROOF_SIZE_LOG_N] sumCheckUChallenges; Fr rho; // Zero morph @@ -56,7 +56,7 @@ library TranscriptLib { t.gateChallenges = generateGateChallenges(t.alphas[NUMBER_OF_ALPHAS - 1]); - t.sumCheckUChallenges = generateSumcheckChallenges(proof, t.gateChallenges[LOG_N - 1]); + t.sumCheckUChallenges = generateSumcheckChallenges(proof, t.gateChallenges[CONST_PROOF_SIZE_LOG_N - 1]); t.rho = generateRhoChallenge(proof, t.sumCheckUChallenges[CONST_PROOF_SIZE_LOG_N - 1]); t.zmY = generateZMYChallenge(t.rho, proof); @@ -150,8 +150,12 @@ library TranscriptLib { } } - function generateGateChallenges(Fr previousChallenge) internal view returns (Fr[LOG_N] memory gateChallenges) { - for (uint256 i = 0; i < LOG_N; i++) { + function generateGateChallenges(Fr previousChallenge) + internal + view + returns (Fr[CONST_PROOF_SIZE_LOG_N] memory gateChallenges) + { + for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) { previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge)))); gateChallenges[i] = previousChallenge; } diff --git a/barretenberg/sol/src/honk/instance/EcdsaHonk.sol b/barretenberg/sol/src/honk/instance/EcdsaHonk.sol index b90229127ae..92dd87aa01a 100644 --- a/barretenberg/sol/src/honk/instance/EcdsaHonk.sol +++ b/barretenberg/sol/src/honk/instance/EcdsaHonk.sol @@ -30,7 +30,7 @@ struct Transcript { Fr beta; Fr gamma; Fr[NUMBER_OF_ALPHAS] alphas; - Fr[LOG_N] gateChallenges; + Fr[CONST_PROOF_SIZE_LOG_N] gateChallenges; Fr[CONST_PROOF_SIZE_LOG_N] sumCheckUChallenges; Fr rho; // Zero morph @@ -57,7 +57,7 @@ library TranscriptLib { t.gateChallenges = generateGateChallenges(t.alphas[NUMBER_OF_ALPHAS - 1]); - t.sumCheckUChallenges = generateSumcheckChallenges(proof, t.gateChallenges[LOG_N - 1]); + t.sumCheckUChallenges = generateSumcheckChallenges(proof, t.gateChallenges[CONST_PROOF_SIZE_LOG_N - 1]); t.rho = generateRhoChallenge(proof, t.sumCheckUChallenges[CONST_PROOF_SIZE_LOG_N - 1]); t.zmY = generateZMYChallenge(t.rho, proof); @@ -151,8 +151,12 @@ library TranscriptLib { } } - function generateGateChallenges(Fr previousChallenge) internal view returns (Fr[LOG_N] memory gateChallenges) { - for (uint256 i = 0; i < LOG_N; i++) { + function generateGateChallenges(Fr previousChallenge) + internal + view + returns (Fr[CONST_PROOF_SIZE_LOG_N] memory gateChallenges) + { + for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) { previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge)))); gateChallenges[i] = previousChallenge; } diff --git a/barretenberg/sol/src/ultra/keys/Add2UltraVerificationKey.sol b/barretenberg/sol/src/ultra/keys/Add2UltraVerificationKey.sol index 27f1983ed5f..a0d4ffe2030 100644 --- a/barretenberg/sol/src/ultra/keys/Add2UltraVerificationKey.sol +++ b/barretenberg/sol/src/ultra/keys/Add2UltraVerificationKey.sol @@ -1,11 +1,11 @@ -// Verification Key Hash: f7bbd1b4758c8616f966f56728b3d7127a0d1ca6763cbaf70b4719914be476bd +// Verification Key Hash: cb63e1832e42d0a3dc85a0e3bbd22598bbb6cd6fcdb99e9c33f3907e88e3cb89 // SPDX-License-Identifier: Apache-2.0 // Copyright 2022 Aztec pragma solidity >=0.8.4; library Add2UltraVerificationKey { function verificationKeyHash() internal pure returns (bytes32) { - return 0xf7bbd1b4758c8616f966f56728b3d7127a0d1ca6763cbaf70b4719914be476bd; + return 0xcb63e1832e42d0a3dc85a0e3bbd22598bbb6cd6fcdb99e9c33f3907e88e3cb89; } function loadVerificationKey(uint256 _vk, uint256 _omegaInverseLoc) internal pure { diff --git a/barretenberg/sol/src/ultra/keys/BlakeUltraVerificationKey.sol b/barretenberg/sol/src/ultra/keys/BlakeUltraVerificationKey.sol index b8a1d2efd68..9fff4b5d5bf 100644 --- a/barretenberg/sol/src/ultra/keys/BlakeUltraVerificationKey.sol +++ b/barretenberg/sol/src/ultra/keys/BlakeUltraVerificationKey.sol @@ -1,11 +1,11 @@ -// Verification Key Hash: 7370a14d9a35deb926608bdc13693b06292d2f66052be3dd6d13d35441270318 +// Verification Key Hash: 5a6117dce0e70786bb6b9b3d1c4fd733404425849005cd2242fb3b12e431a162 // SPDX-License-Identifier: Apache-2.0 // Copyright 2022 Aztec pragma solidity >=0.8.4; library BlakeUltraVerificationKey { function verificationKeyHash() internal pure returns (bytes32) { - return 0x7370a14d9a35deb926608bdc13693b06292d2f66052be3dd6d13d35441270318; + return 0x5a6117dce0e70786bb6b9b3d1c4fd733404425849005cd2242fb3b12e431a162; } function loadVerificationKey(uint256 _vk, uint256 _omegaInverseLoc) internal pure { diff --git a/barretenberg/sol/src/ultra/keys/EcdsaUltraVerificationKey.sol b/barretenberg/sol/src/ultra/keys/EcdsaUltraVerificationKey.sol index 82e67a786f6..3d6bc213f06 100644 --- a/barretenberg/sol/src/ultra/keys/EcdsaUltraVerificationKey.sol +++ b/barretenberg/sol/src/ultra/keys/EcdsaUltraVerificationKey.sol @@ -1,11 +1,11 @@ -// Verification Key Hash: 3b1c156f02c5934c94573e30a9d55a6398e8d1f616136797c008194d26892a55 +// Verification Key Hash: 39dd0e98b3f192bce78868c74aa2b07397650909b73e3589a5bfbfbecba53dfc // SPDX-License-Identifier: Apache-2.0 // Copyright 2022 Aztec pragma solidity >=0.8.4; library EcdsaUltraVerificationKey { function verificationKeyHash() internal pure returns (bytes32) { - return 0x3b1c156f02c5934c94573e30a9d55a6398e8d1f616136797c008194d26892a55; + return 0x39dd0e98b3f192bce78868c74aa2b07397650909b73e3589a5bfbfbecba53dfc; } function loadVerificationKey(uint256 _vk, uint256 _omegaInverseLoc) internal pure { diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index 9e3bc20bb90..fc5f57b5d91 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -208,10 +208,10 @@ library Constants { uint256 internal constant LOGS_HASHES_NUM_BYTES_PER_BASE_ROLLUP = 64; uint256 internal constant NUM_MSGS_PER_BASE_PARITY = 4; uint256 internal constant NUM_BASE_PARITY_PER_ROOT_PARITY = 4; - uint256 internal constant RECURSIVE_PROOF_LENGTH = 409; - uint256 internal constant NESTED_RECURSIVE_PROOF_LENGTH = 409; - uint256 internal constant TUBE_PROOF_LENGTH = 409; - uint256 internal constant VERIFICATION_KEY_LENGTH_IN_FIELDS = 120; + uint256 internal constant RECURSIVE_PROOF_LENGTH = 439; + uint256 internal constant NESTED_RECURSIVE_PROOF_LENGTH = 439; + uint256 internal constant TUBE_PROOF_LENGTH = 439; + uint256 internal constant VERIFICATION_KEY_LENGTH_IN_FIELDS = 128; uint256 internal constant SENDER_SELECTOR = 0; uint256 internal constant ADDRESS_SELECTOR = 1; uint256 internal constant STORAGE_ADDRESS_SELECTOR = 1; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr index 2a4467f8c37..cf082ee91ff 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -275,11 +275,11 @@ global NUM_MSGS_PER_BASE_PARITY: u32 = 4; global NUM_BASE_PARITY_PER_ROOT_PARITY: u32 = 4; // Lengths of the different types of proofs in fields -global RECURSIVE_PROOF_LENGTH = 409; -global NESTED_RECURSIVE_PROOF_LENGTH = 409; +global RECURSIVE_PROOF_LENGTH = 439; +global NESTED_RECURSIVE_PROOF_LENGTH = 439; global TUBE_PROOF_LENGTH = RECURSIVE_PROOF_LENGTH; // in the future these can differ -global VERIFICATION_KEY_LENGTH_IN_FIELDS = 120; +global VERIFICATION_KEY_LENGTH_IN_FIELDS = 128; /** * Enumerate the hash_indices which are used for pedersen hashing. diff --git a/noir/noir-repo/test_programs/execution_success/verify_honk_proof/Prover.toml b/noir/noir-repo/test_programs/execution_success/verify_honk_proof/Prover.toml index 6e5c36559bd..21189dad938 100644 --- a/noir/noir-repo/test_programs/execution_success/verify_honk_proof/Prover.toml +++ b/noir/noir-repo/test_programs/execution_success/verify_honk_proof/Prover.toml @@ -1,4 +1,6 @@ key_hash = "0x096129b1c6e108252fc5c829c4cc9b7e8f0d1fd9f29c2532b563d6396645e08f" -proof = ["0x0000000000000000000000000000000000000000000000000000000000000020","0x0000000000000000000000000000000000000000000000000000000000000011","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000042ab5d6d1986846cf","0x00000000000000000000000000000000000000000000000b75c020998797da78","0x0000000000000000000000000000000000000000000000005a107acb64952eca","0x000000000000000000000000000000000000000000000000000031e97a575e9d","0x00000000000000000000000000000000000000000000000b5666547acf8bd5a4","0x00000000000000000000000000000000000000000000000c410db10a01750aeb","0x00000000000000000000000000000000000000000000000d722669117f9758a4","0x000000000000000000000000000000000000000000000000000178cbf4206471","0x000000000000000000000000000000000000000000000000e91b8a11e7842c38","0x000000000000000000000000000000000000000000000007fd51009034b3357f","0x000000000000000000000000000000000000000000000009889939f81e9c7402","0x0000000000000000000000000000000000000000000000000000f94656a2ca48","0x000000000000000000000000000000000000000000000006fb128b46c1ddb67f","0x0000000000000000000000000000000000000000000000093fe27776f50224bd","0x000000000000000000000000000000000000000000000004a0c80c0da527a081","0x0000000000000000000000000000000000000000000000000001b52c2020d746","0x0000000000000000000000000000005a9bae947e1e91af9e4033d8d6aa6ed632","0x000000000000000000000000000000000025e485e013446d4ac7981c88ba6ecc","0x000000000000000000000000000000ff1e0496e30ab24a63b32b2d1120b76e62","0x00000000000000000000000000000000001afe0a8a685d7cd85d1010e55d9d7c","0x000000000000000000000000000000b0804efd6573805f991458295f510a2004","0x00000000000000000000000000000000000c81a178016e2fe18605022d5a8b0e","0x000000000000000000000000000000eba51e76eb1cfff60a53a0092a3c3dea47","0x000000000000000000000000000000000022e7466247b533282f5936ac4e6c15","0x00000000000000000000000000000071b1d76edf770edff98f00ff4deec264cd","0x00000000000000000000000000000000001e48128e68794d8861fcbb2986a383","0x000000000000000000000000000000d3a2af4915ae6d86b097adc377fafda2d4","0x000000000000000000000000000000000006359de9ca452dab3a4f1f8d9c9d98","0x0000000000000000000000000000000d9d719a8b9f020ad3642d60fe704e696f","0x00000000000000000000000000000000000ddfdbbdefc4ac1580ed38e12cfa49","0x0000000000000000000000000000008289fe9754ce48cd01b7be96a861b5e157","0x00000000000000000000000000000000000ff3e0896bdea021253b3d360fa678","0x0000000000000000000000000000000d9d719a8b9f020ad3642d60fe704e696f","0x00000000000000000000000000000000000ddfdbbdefc4ac1580ed38e12cfa49","0x0000000000000000000000000000008289fe9754ce48cd01b7be96a861b5e157","0x00000000000000000000000000000000000ff3e0896bdea021253b3d360fa678","0x000000000000000000000000000000f968b227a358a305607f3efc933823d288","0x00000000000000000000000000000000000eaf8adb390375a76d95e918b65e08","0x000000000000000000000000000000bb34b4b447aae56f5e24f81c3acd6d547f","0x00000000000000000000000000000000002175d012746260ebcfe339a91a81e1","0x0000000000000000000000000000005b739ed2075f2b046062b8fc6a2d1e9863","0x00000000000000000000000000000000001285cd1030d338c0e1603b4da2c838","0x00000000000000000000000000000027447d6c281eb38b2b937af4a516d60c04","0x000000000000000000000000000000000019bc3d980465fbb4a656a74296fc58","0x000000000000000000000000000000b484788ace8f7df86dd5e325d2e9b12599","0x00000000000000000000000000000000000a2ca0d10eb7b767114ae230b728d3","0x000000000000000000000000000000c6dfc7092f16f95795e437664498b88d53","0x0000000000000000000000000000000000131067b4e4d95a4f6f8cf5c9b5450a","0x0f413f22eec51f2a02800e0cafaeec1d92d744fbbaef213c687b9edabd6985f5","0x21230f4ff26c80ffb5d037a9d1d26c3f955ca34cbeca4f54db6656b932967a0c","0x0521f877fe35535767f99597cc50effbd283dcae6812ee0a7620d796ccbfd642","0x202b01350a9cc5c20ec0f3eaada338c0a3b793811bd539418ffa3cc4302615e2","0x2d1214d9b0d41058ad4a172d9c0aecc5bdabe95e687c3465050c6b5396509be4","0x1113b344a151b0af091cb28d728b752ebb4865da6cd7ee68471b961ca5cf69b9","0x2aa66d0954bb83e17bd5c9928d3aa7a7df75d741d409f7c15ba596804ba643fb","0x2e26bc7a530771ef7a95d5360d537e41cf94d8a0942764ff09881c107f91a106","0x0f14f32b921bb63ad1df00adab7c82af58ea8aa7f353f14b281208d8c5fab504","0x13429515c0c53b6502bbcdf545defb3cb69a986c9263e070fcbb397391aae1a3","0x1f21cac5e2f262afc1006a21454cc6bcb018c44e53ad8ab61cebbac99e539176","0x2a9886a6ddc8a61b097c668cd362fc8acdee8dde74f7b1af192c3e060bb2948f","0x2d718181e408ead2e9bcd30a84ad1fccbaf8d48ab6d1820bad4933d284b503c4","0x2634c1aafc902f14508f34d3d7e9d485f42d1a4c95b5a1ef73711ed0d3c68d77","0x092ede9777e6472ce5ffd8c963d466006189e960e2c591d338dc8d4af1a057fb","0x1cba45b17fd24f1cb1b4ab7b83eee741f6c77ba70a497dc4de259eceb7d5ea26","0x246e887c7bf2e17f919b2393b6e9b00b33e8822d862544a775aac05cb7bff710","0x04c3f539fe8689971948afcb437f1ecbd444a5bddaca1c8a450348dcd8480047","0x20c6a423ae4fd58e8951aa378d02d77baf90508ceb48856db2319d70938b186e","0x1bcf8786b554b3316d8ebdbc9d006a4e5d4865aad512ffd404b7f83550d3d030","0x09ab038260518f0970564afcd6bf22e2abf6b1fa5e12a327bbf195b6ca5edd78","0x1024e32554746f89c195286ba6ccfc9765e5d14bbe8064bc6fdf22d16ec6b495","0x17706656f8dbd7e47bb257a6428f0cb7278ea02fa9e6ce431d7bcc9133fba9c7","0x25a3e8a33c15ef2a4dd16313a6049bf1d468b4cdc141f238f2d51a1e8e1c22b3","0x1198863f08006edb27aee23164fb117a4ddec1bf1ed89807aa907e5cd24bf068","0x1862b4856b5b4d4a064f873e221703e4e2cd1ebfca1337dedca56485c38ed5a0","0x062214af1ea6dd6bf8895b92d394571c43970b6f967e1c794624d96071b25ad3","0x1e5be9428ddcf1f9b0cbafc28101e792ec5cf73852b0cd0b84fbff71b4490e09","0x2d4189bea5b1e30f63c64bd26df82f18bcaf885ec8887b54634b2557869ce87f","0x0f2e5d9a908850e9d44925e17d8b12d1adb1ed029799c9b5858598504242bbc0","0x3050dc85746a57931d99f3f35e77c2ba561fba0baa018b79ff1fd544026833ae","0x2a591a32437e5e0b875a137fd868bd1b6dbc003ff1b661f26e00627cc7c5cf47","0x27946841e1670ad9c65717016d0cedf524724217236e81b9fd0a264a36ebfb0e","0x0fc396e9d19d6e68e289602e292ee345542d0d28bf6de34fa62cc577cbdfb1df","0x08e7433a07a44c0c9c4dd4b273a2685bbd1a91fd5cf2b43409458fab42a23e1b","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x12bd9bfb029c3503a5c6deea87b0a0f11bb9f7ea584af2d48f3e48d7e09247ae","0x2ccc4810748c0a82dfc0f063d0b8c7999ffe9474653080e6ef92b3cb7a428784","0x08eb574d7fecadadb508c8bd35fdad06b99110609d679763c2e3645229b1b95a","0x0f1a65e747c8021ed7c454a4be1e89b1bce66ead9ed980fa98a7a050eafe98a1","0x1c8ff9e36684ec71614dee4c17859b06c742089f6029d3694a16e00dac9b57f1","0x0303101a8ba712aeca4da85b767ab8d3ecf489ec7d746f8ee20041717cc000e9","0x0aaf64c65e7088e5596108c9601467911fea809ca6540d79af77e6e66e36cd99","0x17caf164ce74ea7edfb1390e07763d2197797ec26661b92cde18a98d61d2fddc","0x18cb055c7ad6d01437725bb457681d81f3ecadc4f35d838a3c13daf25a44456a","0x2d78602b8bbcd32b36a99a6e2d248e7fe044ef1b50813133370412f9ef5299f0","0x2b139276ea86d426a115479e4154f72a6bd83a6253bf13e9670dc6b4664378f0","0x127c7837b384902c39a104036c09546728571c46c8166b1b9b13b3a615ebb781","0x05faa4816f83cf0189a482ad943c94b9ec6474002f2b327f8698763ad0ea0985","0x2f90359cc30ee693fb3aced96523cf7aebd152c22329eee56a398d9a4ac0628e","0x0a71beaf17a59c5a238f04c1f203848d87502c5057a78c13f0cfb0f9876e7714","0x2696c1e6d089556adaeb95c8a5e3065b00a393a38c2d69e9bd6ce8cdc49d87da","0x1f3d165a7dc6564a036e451eb9cb7f1e1cb1e6d29daa75e3f135ea3e58a79ccd","0x1473a660819bdd838d56122b72b32b267211e9f1103239480ec50fa85c9e1035","0x0a8ccaeb22451f391b3fc3467c8e6e900270a7afb7b510e8acf5a4f06f1c0888","0x03b3080afc0658cc87e307758cebc171921f43eca159b9dedf7f72aa8dd926bd","0x2dd7d6663fa0e1755dfafac352c361fcd64c7f4d53627e3646870ac169cc4a07","0x1ec54b883f5f35ccad0e75695af20790d9860104095bab34c9bf01628dd40cb9","0x193dff50f83c241f7a9e087a29ce72ecf3f6d8563593f786dcd04c32bcfd4ced","0x135122c0dae26cda8ca1c09de8225064ad86d10423ab0aaa53b481aa4626e1d6","0x08d5a56cbfab5aeed56d3cdd7fb6b30fc26b0c1a5b63fccd7fa44c53ba6fd35a","0x0d12f126dfa2daad3726d00ca339284cc22e36c6d81bb7a4b95c6f9598b60e7c","0x2e8b24bbdf2fd839d3c7cae1f0eeb96bfcfaeef30b27476f2fafcb17da78cd5e","0x2364acfe0cea39b7f749c5f303b99504977357925f810f684c60f35d16315211","0x06ca062eb70b8c51cfac35345e7b6b51f33a8ec9ebe204fb9b4911200bf508b7","0x266c0aa1ccb97186815bf69084f600d06ddd934e59a38dfe602ee5d6b9487f22","0x1d817537a49c6d0e3b4b65c6665334b91d7593142e60065048be9e55ceb5e7ab","0x05e9b7256a368df053c691952b59e9327a7c12ed322bbd6f72c669b9b9c26d49","0x05e9b7256a368df053c691952b59e9327a7c12ed322bbd6f72c669b9b9c26d49","0x25b77026673a1e613e50df0e88fb510973739d5f9064bd364079a9f884209632","0x25c9bc7a3f6aae3d43ff68b5614b34b5eaceff37157b37347995d231784ac1fd","0x085f69baef22680ae15f4801ef4361ebe9c7fc24a94b5bc2527dce8fb705439e","0x0d7c6b9ce31bfc32238a205455baf5ffe99cd30eb0f7bb5b504e1d4501e01382","0x1001a8cc4bc1221c814fba0eddcf3c40619b133373640c600de5bed0a0a05b10","0x20f5894be90e52977cb70f4f4cbd5101693db0360848939750db7e91109d54b6","0x22c09cb26db43f0599408b4daed0f4f496c66424e6affa41c14387d8e0af851b","0x24e5f41357798432426a9549d71e8cc681eaebacbe87f6e3bf38e85de5aa2f3d","0x06eb90100c736fbf2b87432d7821ecdc0b365024739bc36363d48b905973f5b9","0x000000000000000000000000000000ece6d09ed58e9f5661c01140b10558a8c2","0x000000000000000000000000000000000012b6e4f37adcb34b8e88ff8b6eebce","0x000000000000000000000000000000b226a2bb93593fa1fab19a44767828a3f5","0x00000000000000000000000000000000002b5b518342030543092e1428a7e33c","0x00000000000000000000000000000022ba33857034a0574c216eb3c1ddff3025","0x00000000000000000000000000000000001918e58df857985a7cf9eae7802165","0x00000000000000000000000000000045c2d840b96fb6106cc14dcad89dd5f675","0x00000000000000000000000000000000000afdfac1e3a1febdd0208867d44f98","0x00000000000000000000000000000042ebed6c5ec45d794f119aef24c192af0f","0x00000000000000000000000000000000002d05ef250900bbcc5751bbeb210d6a","0x00000000000000000000000000000060d604bdda48eecc90ed065bd9770e1323","0x00000000000000000000000000000000001fed91c63d0041660c1cbc84c2ffbb","0x00000000000000000000000000000054196b549cde36092e8184c7f4f7d878de","0x00000000000000000000000000000000000153f26a01294329922b492485cc31","0x00000000000000000000000000000056ebea579d10dbb440f0222931df2c0059","0x00000000000000000000000000000000000d2cbc61ce5b7cdd7fce398da4637b","0x000000000000000000000000000000e2b9512360b9797d96675d8a2fd2f7aa5d","0x000000000000000000000000000000000025742905f105ff895f74e7c3daa34a","0x000000000000000000000000000000a2dd7df55db59bd41b83518d4403fbc382","0x00000000000000000000000000000000002c1d9c3cbb9371d4cc4e9f900b9a46","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000000000bcf12ae40c9425c3e67654b84181f90502","0x00000000000000000000000000000000000b6d3faa8a71ff6ef1aa887b7307cf","0x0000000000000000000000000000001f6f719acc23b8f84808c0275d61cfb456","0x0000000000000000000000000000000000296030933ed0c134457ae71c393dfe","0x000000000000000000000000000000ebe1a57cdd7d3d763289b40ef5ed9a7ae0","0x000000000000000000000000000000000010f30483e7df51fca2316d3367603c","0x0000000000000000000000000000000149b7b283ab18060618c8e051864c03cd","0x00000000000000000000000000000000001ef7763235a3a25e241a5f06704dc3"] -public_inputs = ["0x0000000000000000000000000000000000000000000000000000000000000003"] -verification_key = ["0x0000000000000000000000000000000000000000000000000000000000000020","0x0000000000000000000000000000000000000000000000000000000000000011","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000003","0x0000000000000000000000000000000000000000000000000000000000000004","0x0000000000000000000000000000000000000000000000000000000000000005","0x0000000000000000000000000000000000000000000000000000000000000006","0x0000000000000000000000000000000000000000000000000000000000000007","0x0000000000000000000000000000000000000000000000000000000000000008","0x0000000000000000000000000000000000000000000000000000000000000009","0x000000000000000000000000000000000000000000000000000000000000000a","0x000000000000000000000000000000000000000000000000000000000000000b","0x000000000000000000000000000000000000000000000000000000000000000c","0x000000000000000000000000000000000000000000000000000000000000000d","0x000000000000000000000000000000000000000000000000000000000000000e","0x000000000000000000000000000000000000000000000000000000000000000f","0x0000000000000000000000000000000000000000000000000000000000000010","0x00000000000000000000000000000060e430ad1c23bfcf3514323aae3f206e84","0x00000000000000000000000000000000001b5c3ff4c2458d8f481b1c068f27ae","0x000000000000000000000000000000bb510ab2112def34980e4fc6998ad9dd16","0x00000000000000000000000000000000000576e7c105b43e061e13cb877fefe1","0x000000000000000000000000000000ced074785d11857b065d8199e6669a601c","0x00000000000000000000000000000000000053b48a4098c1c0ae268f273952f7","0x000000000000000000000000000000d1d4b26e941db8168cee8f6de548ae0fd8","0x00000000000000000000000000000000001a9adf5a6dadc3d948bb61dfd63f4c","0x0000000000000000000000000000009ce1faac6f8de6ebb18f1db17372c82ad5","0x00000000000000000000000000000000002002681bb417184b2df070a16a3858","0x000000000000000000000000000000161baa651a8092e0e84725594de5aba511","0x00000000000000000000000000000000000be0064399c2a1efff9eb0cdcb2223","0x0000000000000000000000000000008673be6fd1bdbe980a29d8c1ded54381e7","0x000000000000000000000000000000000008a5158a7d9648cf1d234524c9fa0c","0x0000000000000000000000000000002b4fce6e4b1c72062b296d49bca2aa4130","0x00000000000000000000000000000000002e45a9eff4b6769e55fb710cded44f","0x00000000000000000000000000000072b85bf733758b76bcf97333efb85a23e3","0x000000000000000000000000000000000017da0ea508994fc82862715e4b5592","0x00000000000000000000000000000094fa74695cf058dba8ff35aec95456c6c3","0x0000000000000000000000000000000000211acddb851061c24b8f159e832bd1","0x000000000000000000000000000000303b5e5c531384b9a792e11702ad3bcab0","0x00000000000000000000000000000000000d336dff51a60b8833d5d7f6d4314c","0x0000000000000000000000000000009f825dde88092070747180d581c342444a","0x0000000000000000000000000000000000237fbd6511a03cca8cac01b555fe01","0x0000000000000000000000000000007c313205159495df6d8de292079a4844ff","0x000000000000000000000000000000000018facdfc468530dd45e8f7a1d38ce9","0x0000000000000000000000000000000d1ce33446fc3dc4ab40ca38d92dac74e1","0x00000000000000000000000000000000000852d8e3e0e8f4435af3e94222688b","0x0000000000000000000000000000006c04ee19ec1dfec87ed47d6d04aa158de2","0x000000000000000000000000000000000013240f97a584b45184c8ec31319b5f","0x000000000000000000000000000000cefb5d240b07ceb4be26ea429b6dc9d9e0","0x00000000000000000000000000000000002dad22022121d689f57fb38ca21349","0x000000000000000000000000000000c9f189f2a91aeb664ce376d8b157ba98f8","0x00000000000000000000000000000000002531a51ad54f124d58094b219818d2","0x000000000000000000000000000000ef1e6db71809307f677677e62b4163f556","0x0000000000000000000000000000000000272da4396fb2a7ee0638b9140e523d","0x0000000000000000000000000000002e54c0244a7732c87bc4712a76dd8c83fb","0x000000000000000000000000000000000007db77b3e04b7eba9643da57cbbe4d","0x000000000000000000000000000000e0dfe1ddd7f74ae0d636c910c3e85830d8","0x00000000000000000000000000000000000466fa9b57ec4664abd1505b490862","0x0000000000000000000000000000009ee55ae8a32fe5384c79907067cc27192e","0x00000000000000000000000000000000000799d0e465cec07ecb5238c854e830","0x0000000000000000000000000000001d5910ad361e76e1c241247a823733c39f","0x00000000000000000000000000000000002b03f2ccf7507564da2e6678bef8fe","0x000000000000000000000000000000231147211b3c75e1f47d150e4bbd2fb22e","0x00000000000000000000000000000000000d19ee104a10d3c701cfd87473cbbe","0x0000000000000000000000000000006705f3f382637d00f698e2c5c94ed05ae9","0x00000000000000000000000000000000000b9c792da28bb60601dd7ce4b74e68","0x000000000000000000000000000000ac5acc8cc21e4ddb225c510670f80c80b3","0x00000000000000000000000000000000002da9d3fa57343e6998aba19429b9fa","0x0000000000000000000000000000004bacbf54b7c17a560df0af18b6d0d527be","0x00000000000000000000000000000000000faea33aeca2025b22c288964b21eb","0x000000000000000000000000000000492e756298d68d6e95de096055cc0336c3","0x00000000000000000000000000000000001a12a12f004859e5a3675c7315121b","0x000000000000000000000000000000893d521d512f30e6d32afbbc0cecd8ee00","0x00000000000000000000000000000000001674b3c1ef12c6da690631e0d86c04","0x000000000000000000000000000000aa6cb02a52e7a613873d4ac9b411349945","0x00000000000000000000000000000000001ecb1fe9c493add46751f9940f73e1","0x00000000000000000000000000000045b3d362ca82cba69fb2b9c733a5b8c351","0x000000000000000000000000000000000019a683586af466e331945b732d2f8c","0x000000000000000000000000000000fc79b052dfdfe67c0ecfc06b4267ffd694","0x00000000000000000000000000000000001336a70c396393038d5e9913744ac2","0x0000000000000000000000000000005450d29af1e9438e91cd33ddeb2548226e","0x000000000000000000000000000000000000993a602891cfd0e6f6ecf7404933","0x000000000000000000000000000000498efddab90a32e9b2db729ed6e9b40192","0x00000000000000000000000000000000002425efebe9628c63ca6fc28bdb5901","0x000000000000000000000000000000d8488157f875a21ab5f93f1c2b641f3de9","0x0000000000000000000000000000000000290f95ada3936604dc4b14df7504e3","0x0000000000000000000000000000005d6902187f3ed60dcce06fca211b40329a","0x00000000000000000000000000000000002b5870a6ba0b20aaa0178e5adfbc36","0x000000000000000000000000000000e5c2519171fa0e548fc3c4966ffc1ce570","0x00000000000000000000000000000000001cb8d8f4793b7debbdc429389dbf2d","0x000000000000000000000000000000a3ee22dd60456277b86c32a18982dcb185","0x00000000000000000000000000000000002493c99a3d068b03f8f2b8d28b57ce","0x000000000000000000000000000000f6c3731486320082c20ec71bbdc92196c1","0x00000000000000000000000000000000001ded39c4c8366469843cd63f09ecac","0x000000000000000000000000000000494997477ab161763e46601d95844837ef","0x00000000000000000000000000000000002e0cddbc5712d79b59cb3b41ebbcdd","0x000000000000000000000000000000426db4c64531d350750df62dbbc41a1bd9","0x0000000000000000000000000000000000303126892f664d8d505964d14315ec","0x00000000000000000000000000000076a6b2c6040c0c62bd59acfe3e3e125672","0x000000000000000000000000000000000000874a5ad262eecc6b565e0b085074","0x000000000000000000000000000000ef082fb517183c9c6841c2b8ef2ca1df04","0x0000000000000000000000000000000000127b2a745a1b74968c3edc18982b9b","0x000000000000000000000000000000c9efd4f8c3d56e1eb23d789a8f710d5be6","0x000000000000000000000000000000000015a18748490ff4c2b1871081954e86","0x000000000000000000000000000000a0011ef987dc016ab110eacd554a1d8bbf","0x00000000000000000000000000000000002097c84955059442a95df075833071","0x000000000000000000000000000000d38e9426ad3085b68b00a93c17897c2877","0x00000000000000000000000000000000002aecd48089890ea0798eb952c66824","0x00000000000000000000000000000078d8a9ce405ce559f441f2e71477ff3ddb","0x00000000000000000000000000000000001216bdb2f0d961bb8a7a23331d2150","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000000000ee40d90bea71fba7a412dd61fcf34e8ceb","0x0000000000000000000000000000000000140b0936c323fd2471155617b6af56","0x0000000000000000000000000000002b90071823185c5ff8e440fd3d73b6fefc","0x00000000000000000000000000000000002b6c10790a5f6631c87d652e059df4"] +proof = ["0x0000000000000000000000000000000000000000000000000000000000000040","0x0000000000000000000000000000000000000000000000000000000000000011","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000042ab5d6d1986846cf","0x00000000000000000000000000000000000000000000000b75c020998797da78","0x0000000000000000000000000000000000000000000000005a107acb64952eca","0x000000000000000000000000000000000000000000000000000031e97a575e9d","0x00000000000000000000000000000000000000000000000b5666547acf8bd5a4","0x00000000000000000000000000000000000000000000000c410db10a01750aeb","0x00000000000000000000000000000000000000000000000d722669117f9758a4","0x000000000000000000000000000000000000000000000000000178cbf4206471","0x000000000000000000000000000000000000000000000000e91b8a11e7842c38","0x000000000000000000000000000000000000000000000007fd51009034b3357f","0x000000000000000000000000000000000000000000000009889939f81e9c7402","0x0000000000000000000000000000000000000000000000000000f94656a2ca48","0x000000000000000000000000000000000000000000000006fb128b46c1ddb67f","0x0000000000000000000000000000000000000000000000093fe27776f50224bd","0x000000000000000000000000000000000000000000000004a0c80c0da527a081","0x0000000000000000000000000000000000000000000000000001b52c2020d746","0x0000000000000000000000000000005a9bae947e1e91af9e4033d8d6aa6ed632","0x000000000000000000000000000000000025e485e013446d4ac7981c88ba6ecc","0x000000000000000000000000000000ff1e0496e30ab24a63b32b2d1120b76e62","0x00000000000000000000000000000000001afe0a8a685d7cd85d1010e55d9d7c","0x000000000000000000000000000000b0804efd6573805f991458295f510a2004","0x00000000000000000000000000000000000c81a178016e2fe18605022d5a8b0e","0x000000000000000000000000000000eba51e76eb1cfff60a53a0092a3c3dea47","0x000000000000000000000000000000000022e7466247b533282f5936ac4e6c15","0x00000000000000000000000000000071b1d76edf770edff98f00ff4deec264cd","0x00000000000000000000000000000000001e48128e68794d8861fcbb2986a383","0x000000000000000000000000000000d3a2af4915ae6d86b097adc377fafda2d4","0x000000000000000000000000000000000006359de9ca452dab3a4f1f8d9c9d98","0x0000000000000000000000000000006cf7dd96d7636fda5953191b1ad776d491","0x00000000000000000000000000000000001633d881a08d136e834cb13a28fcc6","0x00000000000000000000000000000001254956cff6908b069fca0e6cf1c47eb1","0x000000000000000000000000000000000006f4d4dd3890e997e75e75886bf8f7","0x0000000000000000000000000000006cf7dd96d7636fda5953191b1ad776d491","0x00000000000000000000000000000000001633d881a08d136e834cb13a28fcc6","0x00000000000000000000000000000001254956cff6908b069fca0e6cf1c47eb1","0x000000000000000000000000000000000006f4d4dd3890e997e75e75886bf8f7","0x000000000000000000000000000000f968b227a358a305607f3efc933823d288","0x00000000000000000000000000000000000eaf8adb390375a76d95e918b65e08","0x000000000000000000000000000000bb34b4b447aae56f5e24f81c3acd6d547f","0x00000000000000000000000000000000002175d012746260ebcfe339a91a81e1","0x000000000000000000000000000000286fcda0e28617c86e195005b9f2efc555","0x00000000000000000000000000000000000dc409eb684b23f6a97175bcb9b486","0x000000000000000000000000000000e8de6a193cd36414f598bc7c48d67c3b59","0x00000000000000000000000000000000002a8a791544cad8c712de871e3de50a","0x000000000000000000000000000000d6f1e64b562df0f17ecc6aa46392f8d5a3","0x00000000000000000000000000000000000aac977763f33fd6a360ccc50a827a","0x000000000000000000000000000000899fa957f5597c6419e3ead9843d21d917","0x000000000000000000000000000000000016c4611846952bd6833c35fb11c0da","0x013dbfbfbfb2ae7d524edb15343e551d9510b3116223baaa67312d17652f2fb1","0x2f268eb3217ef1ac66016aa14d43033f932335371795b5e6dcb0c87c8ad0d050","0x2d5dbd52e00ae837e9868289fbe9057f16ea5b76c7e362603e8883f0de4b3e94","0x0e357b6a266c20d5e546c2931475eb044d7e75e08ec31b5e8623aec30f964323","0x0a9ace4dea44d0a2e8d12d495a683f508714356656aea3882436b729ead24165","0x0c17102a98ccb76faf0f78d669ee9cfb694849896787c985225d92e1af3cab35","0x09cc7cb719deb139c84fd9fa273e862a1b5d1cec2501c6cd8ba3c37ca06ac07f","0x15a0369f3f95d53687dfe79483baf75597d8b281fe0595caf1f7c9ccf99d985e","0x17fb53a42b3d1fa5d26ab19dfcc0d74d1781cee0be98dcc492c22e8f3442c4db","0x291d6810fc6afc5c2254fd283843a74c85a77275eee3049ea8ed9c88e02a99b8","0x0ad40d1627c31247dfb894584a71f8599cfcb85afe84b20186fc07fccae1aa4a","0x251cd908fb4e9fe88660f2303f8d7e4d7886da32fddc0319a842b99543659c0b","0x1885bdea3dd82085ca67502ebec8ad87213493e18a06cfa27e2c69810481b4a7","0x239ab5ba86866bc6705091f82a6a29444dc76b0e7d94cede7eb745cce36ab2cf","0x088d29a03baa491845d152124189dfb8bf70ba9bf1fb00c379199dbb0195c663","0x18c9fbe3227988d2da599eba82d60f4de25b442b663585fdc611e37305fa77fc","0x010242ae641a8cc4d06b5d24e38d9fa6254f981e28f238ccf6aad580f780d3f5","0x00128d34b122e84d7e23276b1f13f5789a562e82c727e9ffcfd7bbaccbe69e04","0x0776defaf478bfea4db2698542314e27213f63c96e41f98d4d82a47ed6fab55d","0x273014a360eaaa493e398df82f18d9cae37f4b6c0ead20100cad3f5491805298","0x2b13528eb9ab6fa705f2b48c9ec6ce054ac984e3adf17d4d73431e8456bf4a3c","0x22dafe1d63e39cd2effb236da2e131ee1c8cf4049ce504431dcaf98f75c47ad8","0x1afb5bc7eb8d30d807101357bb290f9c3113523f4aacc1154a27b075e46a4fa4","0x0782dd7df679163e5f0c126abc901d00f3d7d0856b4c02a199ab691ecd7566e6","0x2e556c722c99a84a09ffdcc719178277f8e6c9e31a4769270e3b522b944b8ea2","0x1be933a48dca8ef26202d3f135998ac8bed6947020b7447ffb6033b0e37f2065","0x2d8ebae210848de2464f5435f1fd4b5467ee938910d7779002614943060bbb32","0x2da854bbee38a94a6a9c2c85dd05bb4c879173720b67f93f78b9de93cdb427b0","0x0fa2649472af2e79489c466b58002f8f284f953085ac0a98dfabee85b78f63cf","0x304a09437636026ef0746c4b8ac1ca0ff250c5630fb5bd03ddafddd7cbde850e","0x0c83bb3c6ee0faa1646ee4d8dd83f67ec98e5d63ac802f7bdebfcdf21dee62f1","0x229d7e4524b30c18a6b94f0054e6d2ea8eb2396f58f9c808d2c9f991e2be2399","0x1265bf5e1aaddeae09242b1435e2f8f9e7487bf76a0461752777f6ea1ff75ad6","0x2f32f53281b7a363d6bec84ca21c71c3206d906b036e8b36b0702780e3b1b870","0x017fb18c9aef4d6d2bc99f5d7f9a002c8921fcd7c7ba69bf05930b55c2829cb7","0x2ec761c02ef6f2eefb7c9b2d6df71795d0ce0820f86797e2e11415cb5b122f22","0x2b1722960f42a1b40ffae3e4b9419fc8ff5cb8139a2c7e89af332ba2e95c1b5f","0x2dafa15594da2318245475c77eae3712429226b3005852e70f567efff0a7d79a","0x2ed44d7e3d5f44ac8f7c144ee0ba9d369c82428827c19b010384708bbc52a3f9","0x2777eedda697c7f90aee44fa97cfe62596d16c43fa3545b48d622023ca7a446a","0x1a47a5c1b0f41905aa0bad6248be8c7887ddea3ad9dfc8462b23a95b073c8a49","0x093656d571e84ac676a265dd509c98513039552b7a24e001b003ca618cc4ea5c","0x15c901e8a7ff0f1ae1989b5cfb687975c16716a8014a4052d527d4db4ecbaeb4","0x08bfa20e83096b0be58e4c96232510c8ef9824c0a62b91ffcc4592b217753a72","0x021913efbdfbc73aa5f4a97c79f352ac61f71248947f5eb5713c1b107c632703","0x00df89625aef270fab2a8c33ba742e1375423f4cfb3f63514ae748e004bb8cf4","0x2455f76c8ee59e93cbe7fe192cf0f766e1399617cabfa230cf27ca2a18cd58d5","0x150c3e56ea4f6442ed6b11030c98682a8f5e3c9cd6fd18949254a7c79b3cb5b6","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x01e89c6fe644aea7f63301278dbdb4ea29cf4d33f8b0cdcd79cb106e0bf0a753","0x2d49d23421e253903b8a5d0911642b9ce218cef4e350cf8689704eb1f3ae38d4","0x072956ca447343d788791fee1ef222f280048ad4aefb6cb7bc96b538f482f525","0x168176bf15c8ca63457acf05efbe54af452ea41f935ab82c2a96fedde10ba52f","0x20a13690f13491f7f3b756a1dc3b69a3f96d78355c70289583032a593bfc87bc","0x273e0a32ab3ef0d3f179b62520b31015ccfc8b53c76a1bb323b41e40ff954596","0x28019d4b05546b44e35d5dc74375b75dabb6fae49a07381605c60423c6163d26","0x10beda0b8dd484c63f0937820e2c7e9be832a0031efe3557631608895255ca5f","0x095a8f04a901526e4d70b1560bfff29b5a3c30347725d1e420c1b30ee2bf8a1c","0x1fb742e863a5c76262ffec93b3351405b0840b326fa5fffd73f40abcd5f05f05","0x11fa63cfcb2e603fe4e4668d75f05a2cf22650b84a91d1753e83f0e7ae83b4ad","0x2872e3d3c431a8b7ee4cec1c2a999a42c40ae33382fbba80a6d4c1a39b2d57a3","0x17e8c2a5f809f9935d7c6d7cb2f8859a513864b53f53de3d2a14c74cd690bd1a","0x20a552298d691393ae401382b3015689231ad988d3eb0521d414dcd2e8781053","0x183eb6bca59a141b4e8136179a258272ec9c25ec80bdb0458b6880c711707a28","0x03cd147a2a4c8dc272f3e240b8b0090d45e994e5fd40e07a54f6765795cd5ef8","0x082b135b3a20da4c766242b4258e27dbc050e4b8958bb15431626f2eeed9bd2b","0x28c894a6a719a32fe8d78ded46bc685ba035e5579c88fbc5bcbc0f09d8c5268b","0x06418cceff50837f923e63a37c2c534d13d9f59793c3aa6274813baa64d1899e","0x2b4a27b672f85c4fc697605da213de8b950a629602c5b8c6403e6c1c1065388a","0x0e2b817c6a79d6d1027f0376fb26ec81a140a4402e2dcdff6152cf01f2f4dbf9","0x2ae0fbce87dc53f0ff5473117e1c49a8197a14f8eaaec00cb5b10f94e844111f","0x2368004a1dee06f505e75ada3e9f8cc4c801f6a2068620da51ba11f537453835","0x2009df8e6f49f67dcaecb93e4a9ef81aaff096136d26f0fe691e14cd580c47da","0x2e512617136e8da2817856e57f13087a75fcc512faefc6d4b2eedd73c58a9b35","0x2848fcd535bd7c8017ca331a14919aa492ed05b04e9d0745480d291205eac8dc","0x19bb0990cb37f3a8f6c3db78219b07d6accd08e889586660e92dd6000755f09a","0x15520c8158b2e36c40c5fa46d5281c45d3df2c7f5d974a1f9549bfca6cbceaea","0x0e285f4df658d99922c286c5a253d6f6f37aa6c52d7a0fc1a20f3e6da9df23e1","0x0f9cd4667f4c1e86f83eda9e752a05c0cc630b0827a93a68322fa258dffb0f24","0x12d8b0dbbea3dccfe5d2dd090daf8ab4d2fac74fada9c49875b0c9122663a8ad","0x2e8c814d93f027ecff08c4e58555aadfc0f9ec3889eff2150f2b5bb6c557add0","0x013516a1456c5831aba87e4057878f6f3f18471e0674fd1e89be3e18351ec394","0x14418aa79dc84fd791d5638bdc103786ef8181a714ee8e022d3a1e792cbc7959","0x14418aa79dc84fd791d5638bdc103786ef8181a714ee8e022d3a1e792cbc7959","0x25c5e6c96a39bb36e19106d4049b675f0279084cc757c4e2acf6e497c61056a2","0x231aaafcf2a4c6fd8da18ce5ae5b33790f2c306a2692c6383c9a0787c50ac269","0x0a5f7665f0997081f9b38ec64e9a18542ac3a9648060f8cc720fc04669224730","0x0f1c9d9d1ac6f62825c6038117ed30540be434e8fd2d88150dcd4fece39b335a","0x1308871c8fcb09f07e5257f5cc5678d98842a8d18b2af09b5132d9af3cb1893e","0x28801985290dac4eba72ed01ee06fe88f6fc533dc1a46bd86e2d35be8021b042","0x14407f38cfba3cc61fca173b41133ab05a1c176caf8bb597588b01817e9eeaa3","0x0ea1a9f6f95f6193e512a7bd3db0c147f66687662934aed53cb657935b1e4eb9","0x1bc4ab6eacd61b5fd9e414b0186ef5deaadaf59aa9e53cb8d8812255baa28109","0x00000000000000000000000000000093a4da68a2fac0ee94841efdfc57eb748c","0x00000000000000000000000000000000001c22f1f5f927bee6adb649cc132391","0x0000000000000000000000000000003d0c2acea76c551f58876b3c35f19f345a","0x00000000000000000000000000000000002e94fded0a0b7f4fd1c882fd2a4e52","0x00000000000000000000000000000022e23b6fa0f72844bf8f60ea140cca5663","0x000000000000000000000000000000000013380f284bf3cb98b9a7cbae7d702b","0x000000000000000000000000000000942a13cf93056815c3f7439c9eed0a103e","0x00000000000000000000000000000000002be14bec02c6dae4625d32866de4fc","0x000000000000000000000000000000e2a2c75dc664c12695b4f7795c61f92669","0x000000000000000000000000000000000000725da448f376bde6cf63bcf79463","0x000000000000000000000000000000f54eee585f8ab367dc66a587e1d4cdbd8c","0x0000000000000000000000000000000000071106624ae5623a070f0addc18433","0x000000000000000000000000000000d60352bea3b2adb311b1a3beb25acb8aed","0x00000000000000000000000000000000001965b7c781e33f94e90c743c7881ed","0x0000000000000000000000000000006458a2aa57539e2b192f9c3ed69f9fb674","0x00000000000000000000000000000000001fc9c667723a4e66d752c6b426d444","0x0000000000000000000000000000008d1ff1c5d59a463c5b46bcf52f41ad3c63","0x00000000000000000000000000000000001b3e73df070a35c49a03fab1c76e9b","0x0000000000000000000000000000001c17a62b6c0a7ab14de83391e06f780adb","0x000000000000000000000000000000000012c7fbe2591b9ae72dd526e4ed1d7f","0x000000000000000000000000000000a758fa0c72d6a93155cb18b3fcc7defd34","0x00000000000000000000000000000000000cea12961770ce7cb6f2a4aed009fe","0x000000000000000000000000000000ef6e9647803aac315fa6d287e0e66f4767","0x0000000000000000000000000000000000259a82b8d6c6015cc51d2681f26ad4","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000008152b373c87004bef7d2c55ec8c540b67f","0x00000000000000000000000000000000000a55be5fdcb0a0dce4976d7bb78b0c","0x000000000000000000000000000000f749ea03f04ac964706139b9d1db595ecb","0x000000000000000000000000000000000013218e14dae80c066b4e46e9309fb2","0x0000000000000000000000000000004bbd7f950c36ce69db39e2b234a9e3f9b0","0x00000000000000000000000000000000002a0c3994d892ca5ea26984abbb30fb","0x0000000000000000000000000000006c1b39306846620bd546ac2c897834f259","0x000000000000000000000000000000000020350b9f507d6e25961a11be3e494b"] +public_inputs = [ + "0x0000000000000000000000000000000000000000000000000000000000000003", +] +verification_key =["0x0000000000000000000000000000000000000000000000000000000000000040","0x0000000000000000000000000000000000000000000000000000000000000011","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000003","0x0000000000000000000000000000000000000000000000000000000000000004","0x0000000000000000000000000000000000000000000000000000000000000005","0x0000000000000000000000000000000000000000000000000000000000000006","0x0000000000000000000000000000000000000000000000000000000000000007","0x0000000000000000000000000000000000000000000000000000000000000008","0x0000000000000000000000000000000000000000000000000000000000000009","0x000000000000000000000000000000000000000000000000000000000000000a","0x000000000000000000000000000000000000000000000000000000000000000b","0x000000000000000000000000000000000000000000000000000000000000000c","0x000000000000000000000000000000000000000000000000000000000000000d","0x000000000000000000000000000000000000000000000000000000000000000e","0x000000000000000000000000000000000000000000000000000000000000000f","0x0000000000000000000000000000000000000000000000000000000000000010","0x00000000000000000000000000000060e430ad1c23bfcf3514323aae3f206e84","0x00000000000000000000000000000000001b5c3ff4c2458d8f481b1c068f27ae","0x000000000000000000000000000000bb510ab2112def34980e4fc6998ad9dd16","0x00000000000000000000000000000000000576e7c105b43e061e13cb877fefe1","0x000000000000000000000000000000ced074785d11857b065d8199e6669a601c","0x00000000000000000000000000000000000053b48a4098c1c0ae268f273952f7","0x000000000000000000000000000000d1d4b26e941db8168cee8f6de548ae0fd8","0x00000000000000000000000000000000001a9adf5a6dadc3d948bb61dfd63f4c","0x0000000000000000000000000000009ce1faac6f8de6ebb18f1db17372c82ad5","0x00000000000000000000000000000000002002681bb417184b2df070a16a3858","0x000000000000000000000000000000161baa651a8092e0e84725594de5aba511","0x00000000000000000000000000000000000be0064399c2a1efff9eb0cdcb2223","0x0000000000000000000000000000008673be6fd1bdbe980a29d8c1ded54381e7","0x000000000000000000000000000000000008a5158a7d9648cf1d234524c9fa0c","0x0000000000000000000000000000002b4fce6e4b1c72062b296d49bca2aa4130","0x00000000000000000000000000000000002e45a9eff4b6769e55fb710cded44f","0x00000000000000000000000000000072b85bf733758b76bcf97333efb85a23e3","0x000000000000000000000000000000000017da0ea508994fc82862715e4b5592","0x00000000000000000000000000000094fa74695cf058dba8ff35aec95456c6c3","0x0000000000000000000000000000000000211acddb851061c24b8f159e832bd1","0x000000000000000000000000000000303b5e5c531384b9a792e11702ad3bcab0","0x00000000000000000000000000000000000d336dff51a60b8833d5d7f6d4314c","0x0000000000000000000000000000009f825dde88092070747180d581c342444a","0x0000000000000000000000000000000000237fbd6511a03cca8cac01b555fe01","0x0000000000000000000000000000007c313205159495df6d8de292079a4844ff","0x000000000000000000000000000000000018facdfc468530dd45e8f7a1d38ce9","0x0000000000000000000000000000000d1ce33446fc3dc4ab40ca38d92dac74e1","0x00000000000000000000000000000000000852d8e3e0e8f4435af3e94222688b","0x0000000000000000000000000000006c04ee19ec1dfec87ed47d6d04aa158de2","0x000000000000000000000000000000000013240f97a584b45184c8ec31319b5f","0x000000000000000000000000000000cefb5d240b07ceb4be26ea429b6dc9d9e0","0x00000000000000000000000000000000002dad22022121d689f57fb38ca21349","0x000000000000000000000000000000c9f189f2a91aeb664ce376d8b157ba98f8","0x00000000000000000000000000000000002531a51ad54f124d58094b219818d2","0x000000000000000000000000000000ef1e6db71809307f677677e62b4163f556","0x0000000000000000000000000000000000272da4396fb2a7ee0638b9140e523d","0x0000000000000000000000000000002e54c0244a7732c87bc4712a76dd8c83fb","0x000000000000000000000000000000000007db77b3e04b7eba9643da57cbbe4d","0x000000000000000000000000000000e0dfe1ddd7f74ae0d636c910c3e85830d8","0x00000000000000000000000000000000000466fa9b57ec4664abd1505b490862","0x0000000000000000000000000000009ee55ae8a32fe5384c79907067cc27192e","0x00000000000000000000000000000000000799d0e465cec07ecb5238c854e830","0x0000000000000000000000000000001d5910ad361e76e1c241247a823733c39f","0x00000000000000000000000000000000002b03f2ccf7507564da2e6678bef8fe","0x000000000000000000000000000000ee40d90bea71fba7a412dd61fcf34e8ceb","0x0000000000000000000000000000000000140b0936c323fd2471155617b6af56","0x0000000000000000000000000000002b90071823185c5ff8e440fd3d73b6fefc","0x00000000000000000000000000000000002b6c10790a5f6631c87d652e059df4","0x00000000000000000000000000000029a17181c7934fc3fdbd352eac5cb521b9","0x00000000000000000000000000000000001f497cbf5284ff29a2d336e5991999","0x000000000000000000000000000000072bd9c0c6beda1fdee6d4ff0432ba9e1b","0x000000000000000000000000000000000013ea38a0bd2aa751a490a724fac818","0x000000000000000000000000000000c599f63dcd3edd49f08ae5c3141c1e3493","0x00000000000000000000000000000000002bdb36be0bea09950dd32a8ccf6fbc","0x00000000000000000000000000000047f27f29724e7f19eba0340256a0bd4b7d","0x00000000000000000000000000000000001c1c5ccf87a962129ca785f8f35120","0x000000000000000000000000000000c5c71efdae00679bbe4a95096e012b1817","0x000000000000000000000000000000000017a365de041e317817d0135f2b48e0","0x0000000000000000000000000000008ae711ac402f7848d719c93a89ba8d39f1","0x00000000000000000000000000000000002b6fb40ed8a1935226f4f9786a0499","0x0000000000000000000000000000002f03a71501d83de1da5715a4e9462d6198","0x00000000000000000000000000000000001644064443b8546f48eae693af47b8","0x00000000000000000000000000000083763ab1b6e8fe269b2fe4c7b9c448c08d","0x000000000000000000000000000000000021d7cc18c59676a8eeb47c0111c251","0x000000000000000000000000000000b5f937153073e03ea7d51a996e0ebc2e6b","0x000000000000000000000000000000000011ddd0e26457373eb06e0493177672","0x000000000000000000000000000000c5f6eb9f6fc8fa99811a4a88c74a6d018b","0x000000000000000000000000000000000025bcd07a0732c123567834f5109558","0x000000000000000000000000000000aeb08a0b1a4442189448b4e97490568146","0x000000000000000000000000000000000002a1744e4771705536a88f07e0f90f","0x000000000000000000000000000000b938568293bd0724b0ea76c2ec34c4a829","0x0000000000000000000000000000000000053296e8f3b9ad3af877dfa9c7c2a7","0x000000000000000000000000000000f0ca1db6323996eba26bdc86dafef9d10b","0x00000000000000000000000000000000001441a46c58af03d5645d52721d956a","0x0000000000000000000000000000008bbf8f884013c66c28ba09c2fbd573b656","0x0000000000000000000000000000000000206c391ca06fac27d1908e94570243","0x0000000000000000000000000000002d4f5aaed88ba4f79612d53b804ca8f194","0x00000000000000000000000000000000001674011c96392df08970fa6b7b4cb8","0x0000000000000000000000000000009f88297c1729d76c4d9306853598c91325","0x0000000000000000000000000000000000256f51adfcacc3c1e340be4d32d3e9","0x0000000000000000000000000000000ab9955eec0d74eb799afed2a802b24d75","0x00000000000000000000000000000000001fcbe43ea105b30d36ed0b21b03411","0x000000000000000000000000000000d66b1d5433f1aa5305cd1edce7c22de466","0x00000000000000000000000000000000002331546a256b8a3b751956806680d4","0x000000000000000000000000000000e97954ad6cd6f45fb15c91434121db4304","0x00000000000000000000000000000000002e20a97e09d50f227ced47e7a98250","0x0000000000000000000000000000001ebbc27eb9ebededefba79522eb58ae89b","0x0000000000000000000000000000000000090efa4974e566e81d1177b85a30be","0x0000000000000000000000000000005eafa070b9c9632404052642e3bc14f9fd","0x00000000000000000000000000000000001489068864102daca6a6b8bc4d448b","0x0000000000000000000000000000009ebc91aaaac036a6477cadbe54e8556dfd","0x00000000000000000000000000000000000ef6d835e2ed3343b95c82c8c54037","0x00000000000000000000000000000033b28b529dff46e93af4e7422530478e4a","0x000000000000000000000000000000000020a86c2f8591bf190bcddcc03c42fb","0x000000000000000000000000000000a9679d0acc088f7dc27bf6d866bcd2dda2","0x00000000000000000000000000000000002fb9d0d2d4099402bed74f738f64cc","0x00000000000000000000000000000023b09f876a29a061582848a8b9a5870c12","0x00000000000000000000000000000000001d5bb906f03f0d49e9c4791bc43af9","0x00000000000000000000000000000017aac9854ea240d8ec97bf760c4d4ba870","0x00000000000000000000000000000000000b227a556c414ada0dc75bb303e30e","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000009b624fa65d1a24b7f14a8f25f3789622af","0x000000000000000000000000000000000013d47bff8c630e847b70e2732fd3f0","0x00000000000000000000000000000061d21663e93132f32921075f4c936a84df","0x00000000000000000000000000000000001a74ca4e118fb480b9b999902989a3"] diff --git a/noir/noir-repo/test_programs/execution_success/verify_honk_proof/src/main.nr b/noir/noir-repo/test_programs/execution_success/verify_honk_proof/src/main.nr index d785dabffb0..2da4082295e 100644 --- a/noir/noir-repo/test_programs/execution_success/verify_honk_proof/src/main.nr +++ b/noir/noir-repo/test_programs/execution_success/verify_honk_proof/src/main.nr @@ -1,9 +1,9 @@ // This circuit aggregates a single Honk proof from `assert_statement_recursive`. -global SIZE_OF_PROOF_IF_LOGN_IS_28 : u32 = 409; +global SIZE_OF_PROOF_IF_LOGN_IS_28 : u32 = 439; global HONK_IDENTIFIER : u32 = 1; fn main( - verification_key: [Field; 120], + verification_key: [Field; 128], // This is the proof without public inputs attached. // // This means: the size of this does not change with the number of public inputs. diff --git a/noir/verify_honk_proof/src/main.nr b/noir/verify_honk_proof/src/main.nr index 673290ed171..b60a47ccc7f 100644 --- a/noir/verify_honk_proof/src/main.nr +++ b/noir/verify_honk_proof/src/main.nr @@ -1,9 +1,9 @@ // This circuit aggregates a single Honk proof from `assert_statement_recursive`. -global SIZE_OF_PROOF_IF_LOGN_IS_28 : u32 = 409; +global SIZE_OF_PROOF_IF_LOGN_IS_28 : u32 = 439; global HONK_IDENTIFIER : u32 = 1; fn main( - verification_key: [Field; 120], + verification_key: [Field; 128], // This is the proof without public inputs attached. // // This means: the size of this does not change with the number of public inputs. diff --git a/scripts/earthly-ci b/scripts/earthly-ci index d7e3a230e67..7ddd76ba55f 100755 --- a/scripts/earthly-ci +++ b/scripts/earthly-ci @@ -93,7 +93,8 @@ while [ $ATTEMPT_COUNT -lt $MAX_ATTEMPTS ]; do elif grep 'status 125: docker: Error response from daemon: layer does not exist.' $OUTPUT_FILE >/dev/null \ || grep 'could not determine buildkit address - is Docker or Podman running?' $OUTPUT_FILE >/dev/null \ || grep 'please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host' $OUTPUT_FILE >/dev/null \ - || grep 'docker: failed to register layer' $OUTPUT_FILE >/dev/null ; then + || grep 'docker: failed to register layer' $OUTPUT_FILE >/dev/null \ + || grep 'docker: unexpected EOF' $OUTPUT_FILE >/dev/null ; then wipe_non_cache_docker_state # wait for other docker restarts sleep 20 diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index 0952b7f1a84..4943d1fd764 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -192,10 +192,10 @@ export const L2_TO_L1_MSGS_NUM_BYTES_PER_BASE_ROLLUP = 256; export const LOGS_HASHES_NUM_BYTES_PER_BASE_ROLLUP = 64; export const NUM_MSGS_PER_BASE_PARITY = 4; export const NUM_BASE_PARITY_PER_ROOT_PARITY = 4; -export const RECURSIVE_PROOF_LENGTH = 409; -export const NESTED_RECURSIVE_PROOF_LENGTH = 409; -export const TUBE_PROOF_LENGTH = 409; -export const VERIFICATION_KEY_LENGTH_IN_FIELDS = 120; +export const RECURSIVE_PROOF_LENGTH = 439; +export const NESTED_RECURSIVE_PROOF_LENGTH = 439; +export const TUBE_PROOF_LENGTH = 439; +export const VERIFICATION_KEY_LENGTH_IN_FIELDS = 128; export const SENDER_SELECTOR = 0; export const ADDRESS_SELECTOR = 1; export const STORAGE_ADDRESS_SELECTOR = 1;