From fad593ab66def0b547a0efe61f9ff5017577c697 Mon Sep 17 00:00:00 2001 From: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com> Date: Tue, 8 Jul 2025 22:35:27 +0200 Subject: [PATCH 1/3] chore: delete IsFoldingFlavor concept (#15427) Closes https://github.com/AztecProtocol/barretenberg/issues/1443 Closes https://github.com/AztecProtocol/barretenberg/issues/1426 Closes https://github.com/AztecProtocol/barretenberg/issues/1115 --- .../protogalaxy_bench/protogalaxy.bench.cpp | 2 +- .../cpp/src/barretenberg/eccvm/eccvm.test.cpp | 10 +- .../src/barretenberg/eccvm/eccvm_flavor.hpp | 4 +- .../src/barretenberg/eccvm/eccvm_prover.cpp | 8 +- .../src/barretenberg/eccvm/eccvm_prover.hpp | 22 ++-- .../src/barretenberg/eccvm/eccvm_verifier.cpp | 10 +- .../src/barretenberg/eccvm/eccvm_verifier.hpp | 20 +-- .../barretenberg/flavor/flavor_concepts.hpp | 43 +----- .../src/barretenberg/flavor/mega_flavor.hpp | 2 +- .../flavor/mega_recursive_flavor.hpp | 4 +- .../src/barretenberg/flavor/ultra_flavor.hpp | 2 +- .../flavor/ultra_recursive_flavor.hpp | 4 +- .../protogalaxy/combiner.test.cpp | 12 +- .../protogalaxy/protogalaxy.test.cpp | 4 +- .../protogalaxy/protogalaxy_prover.hpp | 8 +- .../protogalaxy/protogalaxy_prover_impl.hpp | 6 +- .../protogalaxy_prover_internal.hpp | 49 ++++--- .../protogalaxy/protogalaxy_verifier.hpp | 2 +- .../cpp/src/barretenberg/relations/utils.hpp | 79 +++-------- .../eccvm_verifier/eccvm_recursive_flavor.hpp | 5 +- .../eccvm_recursive_verifier.cpp | 7 +- .../decider_recursive_verifier.cpp | 6 +- .../decider_recursive_verifier.hpp | 3 - .../honk_verifier/oink_recursive_verifier.cpp | 12 +- .../honk_verifier/oink_recursive_verifier.hpp | 2 +- .../ultra_recursive_verifier.cpp | 4 +- .../ultra_recursive_verifier.hpp | 1 - .../recursive_decider_verification_key.hpp | 7 +- .../translator_recursive_flavor.hpp | 3 +- .../translator_recursive_verifier.cpp | 10 +- .../translator_recursive_verifier.hpp | 1 - .../sumcheck/partial_evaluation.test.cpp | 105 ++++++++++----- .../src/barretenberg/sumcheck/sumcheck.hpp | 124 ++++++++++++------ .../barretenberg/sumcheck/sumcheck.test.cpp | 78 ++++++----- .../barretenberg/sumcheck/sumcheck_round.hpp | 27 ++-- .../sumcheck/sumcheck_round.test.cpp | 27 ++-- .../translator_vm/translator_flavor.hpp | 4 +- .../translator_vm/translator_prover.cpp | 20 ++- .../translator_vm/translator_verifier.cpp | 10 +- .../translator_vm/translator_verifier.hpp | 14 +- .../ultra_honk/decider_prover.cpp | 19 ++- .../ultra_honk/decider_prover.hpp | 1 - .../ultra_honk/decider_proving_key.hpp | 4 +- .../ultra_honk/decider_verification_key.hpp | 4 +- .../ultra_honk/decider_verifier.cpp | 6 +- .../barretenberg/ultra_honk/oink_prover.cpp | 16 ++- .../barretenberg/ultra_honk/oink_prover.hpp | 4 +- .../barretenberg/ultra_honk/oink_verifier.cpp | 15 ++- .../barretenberg/ultra_honk/oink_verifier.hpp | 4 +- .../barretenberg/ultra_honk/sumcheck.test.cpp | 27 ++-- .../barretenberg/vm2/constraining/flavor.hpp | 5 +- .../vm2/constraining/flavor_settings.hpp | 1 - .../barretenberg/vm2/constraining/prover.cpp | 9 +- .../recursion/recursive_flavor.hpp | 3 +- .../recursion/recursive_verifier.cpp | 9 +- .../recursion/recursive_verifier.hpp | 2 +- .../vm2/constraining/verifier.cpp | 9 +- 57 files changed, 468 insertions(+), 431 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp index df9a0eed4fee..177f9d18aa7b 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp @@ -29,7 +29,7 @@ void compute_row_evaluations(State& state) noexcept { using PGInternal = ProtogalaxyProverInternal>; using Polys = Flavor::ProverPolynomials; - using Alphas = Flavor::RelationSeparator; + using Alphas = Flavor::SubrelationSeparators; using Params = RelationParameters; const size_t dyadic_size = 1 << state.range(0); diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm.test.cpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm.test.cpp index 13427739ca03..0953e5076213 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm.test.cpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm.test.cpp @@ -151,19 +151,19 @@ TEST_F(ECCVMTests, CommittedSumcheck) // Run Sumcheck on the ECCVM Prover polynomials using SumcheckProver = SumcheckProver; - SumcheckProver sumcheck_prover(pk->circuit_size, prover_transcript); + SumcheckProver sumcheck_prover( + pk->circuit_size, pk->polynomials, prover_transcript, alpha, gate_challenges, relation_parameters); ZKData zk_sumcheck_data = ZKData(CONST_ECCVM_LOG_N, prover_transcript); - auto prover_output = - sumcheck_prover.prove(pk->polynomials, relation_parameters, alpha, gate_challenges, zk_sumcheck_data); + auto prover_output = sumcheck_prover.prove(zk_sumcheck_data); std::shared_ptr verifier_transcript = std::make_shared(); verifier_transcript->load_proof(prover_transcript->export_proof()); // Execute Sumcheck Verifier - SumcheckVerifier sumcheck_verifier(verifier_transcript); - SumcheckOutput verifier_output = sumcheck_verifier.verify(relation_parameters, alpha, gate_challenges); + SumcheckVerifier sumcheck_verifier(verifier_transcript, alpha); + SumcheckOutput verifier_output = sumcheck_verifier.verify(relation_parameters, gate_challenges); // Evaluate prover's round univariates at corresponding challenges and compare them with the claimed evaluations // computed by the verifier diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp index 27a32805c1a1..83122e3d9970 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp @@ -44,7 +44,6 @@ class ECCVMFlavor { using Commitment = typename G1::affine_element; using CommitmentKey = bb::CommitmentKey; using VerifierCommitmentKey = bb::VerifierCommitmentKey; - using RelationSeparator = FF; using MSM = bb::eccvm::MSM; // indicates when evaluating sumcheck, edges must be extended to be MAX_TOTAL_RELATION_LENGTH @@ -95,6 +94,9 @@ class ECCVMFlavor { using Relations = Relations_; using LookupRelation = ECCVMLookupRelation; + static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations(); + using SubrelationSeparators = std::array; + static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length(); // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta` diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.cpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.cpp index 93e4a273b8d2..86dae5eca53e 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.cpp @@ -113,16 +113,20 @@ void ECCVMProver::execute_relation_check_rounds() using Sumcheck = SumcheckProver; - Sumcheck sumcheck(key->circuit_size, transcript); + // Each linearly independent subrelation contribution is multiplied by `alpha^i`, where + // i = 0, ..., NUM_SUBRELATIONS- 1. FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + std::vector gate_challenges(CONST_ECCVM_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)); } + Sumcheck sumcheck(key->circuit_size, key->polynomials, transcript, alpha, gate_challenges, relation_parameters); + zk_sumcheck_data = ZKData(key->log_circuit_size, transcript, key->commitment_key); - sumcheck_output = sumcheck.prove(key->polynomials, relation_parameters, alpha, gate_challenges, zk_sumcheck_data); + sumcheck_output = sumcheck.prove(zk_sumcheck_data); } /** diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.hpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.hpp index 3922aeb14540..dc54bb6a4212 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.hpp @@ -22,20 +22,20 @@ namespace bb { class ECCVMProver { public: using Flavor = ECCVMFlavor; - using FF = typename Flavor::FF; - using BF = typename Flavor::BF; - using Commitment = typename Flavor::Commitment; - using PCS = typename Flavor::PCS; - using CommitmentKey = typename Flavor::CommitmentKey; - using ProvingKey = typename Flavor::ProvingKey; - using Polynomial = typename Flavor::Polynomial; - using CommitmentLabels = typename Flavor::CommitmentLabels; - using Transcript = typename Flavor::Transcript; + using FF = Flavor::FF; + using BF = Flavor::BF; + using Commitment = Flavor::Commitment; + using PCS = Flavor::PCS; + using CommitmentKey = Flavor::CommitmentKey; + using ProvingKey = Flavor::ProvingKey; + using Polynomial = Flavor::Polynomial; + using CommitmentLabels = Flavor::CommitmentLabels; + using Transcript = Flavor::Transcript; using TranslationEvaluations = bb::TranslationEvaluations_; - using CircuitBuilder = typename Flavor::CircuitBuilder; + using CircuitBuilder = Flavor::CircuitBuilder; using ZKData = ZKSumcheckData; using SmallSubgroupIPA = SmallSubgroupIPAProver; - using OpeningClaim = ProverOpeningClaim; + using OpeningClaim = ProverOpeningClaim; explicit ECCVMProver(CircuitBuilder& builder, const std::shared_ptr& transcript, diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.cpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.cpp index 3d190457d534..6804a6769754 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.cpp @@ -53,9 +53,13 @@ bool ECCVMVerifier::verify_proof(const ECCVMProof& proof) transcript->template receive_from_prover(commitment_labels.lookup_inverses); commitments.z_perm = transcript->template receive_from_prover(commitment_labels.z_perm); + // Each linearly independent subrelation contribution is multiplied by `alpha^i`, where + // i = 0, ..., NUM_SUBRELATIONS- 1. + const FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + // Execute Sumcheck Verifier - SumcheckVerifier sumcheck(transcript); - FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + SumcheckVerifier sumcheck(transcript, alpha); + std::vector gate_challenges(CONST_ECCVM_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)); @@ -66,7 +70,7 @@ bool ECCVMVerifier::verify_proof(const ECCVMProof& proof) libra_commitments[0] = transcript->template receive_from_prover("Libra:concatenation_commitment"); - auto sumcheck_output = sumcheck.verify(relation_parameters, alpha, gate_challenges); + auto sumcheck_output = sumcheck.verify(relation_parameters, gate_challenges); libra_commitments[1] = transcript->template receive_from_prover("Libra:grand_sum_commitment"); libra_commitments[2] = transcript->template receive_from_prover("Libra:quotient_commitment"); diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.hpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.hpp index 23273f000335..2162bfdefd8c 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.hpp @@ -11,16 +11,16 @@ namespace bb { class ECCVMVerifier { using Flavor = ECCVMFlavor; - using FF = typename Flavor::FF; - using Curve = typename Flavor::Curve; - using Commitment = typename Flavor::Commitment; - using CommitmentLabels = typename Flavor::CommitmentLabels; - using Transcript = typename Flavor::Transcript; - using ProvingKey = typename Flavor::ProvingKey; - using VerificationKey = typename Flavor::VerificationKey; - using VerifierCommitments = typename Flavor::VerifierCommitments; - using VerifierCommitmentKey = typename Flavor::VerifierCommitmentKey; - using PCS = typename Flavor::PCS; + using FF = Flavor::FF; + using Curve = Flavor::Curve; + using Commitment = Flavor::Commitment; + using CommitmentLabels = Flavor::CommitmentLabels; + using Transcript = Flavor::Transcript; + using ProvingKey = Flavor::ProvingKey; + using VerificationKey = Flavor::VerificationKey; + using VerifierCommitments = Flavor::VerifierCommitments; + using VerifierCommitmentKey = Flavor::VerifierCommitmentKey; + using PCS = Flavor::PCS; public: explicit ECCVMVerifier(const std::shared_ptr& transcript) diff --git a/barretenberg/cpp/src/barretenberg/flavor/flavor_concepts.hpp b/barretenberg/cpp/src/barretenberg/flavor/flavor_concepts.hpp index 601cb43c9510..fe2fade918e3 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/flavor_concepts.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/flavor_concepts.hpp @@ -57,49 +57,8 @@ concept IsRecursiveFlavor = IsAnyOf; -// These concepts are relevant for Sumcheck, where the logic is different for BN254 and Grumpkin Flavors +// This concept is relevant for the Sumcheck Prover, where the logic differs between BN254 and Grumpkin template concept IsGrumpkinFlavor = IsAnyOf; -template concept IsECCVMRecursiveFlavor = IsAnyOf; - -#ifdef STARKNET_GARAGA_FLAVORS -template concept IsFoldingFlavor = IsAnyOf, - UltraRecursiveFlavor_, - UltraRollupRecursiveFlavor_, - MegaRecursiveFlavor_, - MegaRecursiveFlavor_, - MegaZKRecursiveFlavor_, - MegaZKRecursiveFlavor_>; -#else -// TODO(https://github.com/AztecProtocol/barretenberg/issues/1426): Rename this. -template concept IsFoldingFlavor = IsAnyOf, - UltraRecursiveFlavor_, - UltraZKRecursiveFlavor_, - UltraZKRecursiveFlavor_, - UltraRollupRecursiveFlavor_, - MegaRecursiveFlavor_, - MegaRecursiveFlavor_, - MegaZKRecursiveFlavor_, - MegaZKRecursiveFlavor_>; -#endif - template inline std::string flavor_get_label(Container&& container, const Element& element) { for (auto [label, data] : zip_view(container.get_labels(), container.get_all())) { diff --git a/barretenberg/cpp/src/barretenberg/flavor/mega_flavor.hpp b/barretenberg/cpp/src/barretenberg/flavor/mega_flavor.hpp index a266ff8979d0..89588d9f1d13 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/mega_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/mega_flavor.hpp @@ -108,7 +108,7 @@ class MegaFlavor { // subrelation. This is because using powers of alpha would increase the degree of Protogalaxy polynomial $G$ (the // combiner) too much. static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations(); - using RelationSeparator = std::array; + using SubrelationSeparators = std::array; template using ProtogalaxyTupleOfTuplesOfUnivariatesNoOptimisticSkipping = diff --git a/barretenberg/cpp/src/barretenberg/flavor/mega_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/flavor/mega_recursive_flavor.hpp index c000ec9313ec..fb4bfb0ca608 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/mega_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/mega_recursive_flavor.hpp @@ -88,8 +88,8 @@ template class MegaRecursiveFlavor_ { // For instances of this flavour, used in folding, we need a unique sumcheck batching challenge for each // subrelation. This is because using powers of alpha would increase the degree of Protogalaxy polynomial $G$ (the // combiner) to much. - static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations(); - using RelationSeparator = std::array; + static constexpr size_t NUM_SUBRELATIONS = MegaFlavor::NUM_SUBRELATIONS; + using SubrelationSeparators = std::array; // define the container for storing the univariate contribution from each relation in Sumcheck using TupleOfArraysOfValues = decltype(create_tuple_of_arrays_of_values()); diff --git a/barretenberg/cpp/src/barretenberg/flavor/ultra_flavor.hpp b/barretenberg/cpp/src/barretenberg/flavor/ultra_flavor.hpp index d8ba2f741b3e..8310c2236f1f 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/ultra_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/ultra_flavor.hpp @@ -96,7 +96,7 @@ class UltraFlavor { // For instances of this flavour, used in folding, we need a unique sumcheck batching challenge for each // subrelation. This is because using powers of alpha would increase the degree of Protogalaxy polynomial $G$ (the // combiner) too much. - using RelationSeparator = std::array; + using SubrelationSeparators = std::array; // 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 diff --git a/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive_flavor.hpp index 456f60db1b94..f386130fb131 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive_flavor.hpp @@ -101,8 +101,8 @@ template class UltraRecursiveFlavor_ { // For instances of this flavour, used in folding, we need a unique sumcheck batching challenges for each // subrelation to avoid increasing the degree of Protogalaxy polynomial $G$ (the // combiner) too much. - static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations(); - using RelationSeparator = std::array; + static constexpr size_t NUM_SUBRELATIONS = NativeFlavor::NUM_SUBRELATIONS; + using SubrelationSeparators = std::array; // define the container for storing the univariate contribution from each relation in Sumcheck using TupleOfArraysOfValues = decltype(create_tuple_of_arrays_of_values()); diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/combiner.test.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/combiner.test.cpp index 93a2aad31bcc..eb7daeeead2e 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/combiner.test.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/combiner.test.cpp @@ -40,7 +40,7 @@ class PGInternalTest : public ProtogalaxyProverInternal& gate_separators, const UnivariateRelationParametersNoOptimisticSkipping& relation_parameters, - const UnivariateRelationSeparator& alphas) + const UnivariateSubrelationSeparators& alphas) { TupleOfTuplesOfUnivariatesNoOptimisticSkipping accumulators; return compute_combiner_no_optimistic_skipping( @@ -62,7 +62,7 @@ class PGInternalTest : public ProtogalaxyProverInternal& gate_separators, const UnivariateRelationParametersNoOptimisticSkipping& relation_parameters, - const UnivariateRelationSeparator& alphas, + const UnivariateSubrelationSeparators& alphas, TupleOfTuplesOfUnivariatesNoOptimisticSkipping& univariate_accumulators) { PROFILE_THIS(); @@ -209,7 +209,7 @@ TEST(Protogalaxy, CombinerOn2Keys) } DeciderProvingKeys keys{ keys_data }; - PGInternalTest::UnivariateRelationSeparator alphas; + PGInternalTest::UnivariateSubrelationSeparators alphas; alphas.fill(bb::Univariate(FF(0))); // focus on the arithmetic relation only GateSeparatorPolynomial gate_separators({ 2 }, /*log_num_monomials=*/1); PGInternalTest::UnivariateRelationParametersNoOptimisticSkipping univariate_relation_parameters_no_skpping; @@ -244,7 +244,7 @@ TEST(Protogalaxy, CombinerOn2Keys) } DeciderProvingKeys keys{ keys_data }; - PGInternalTest::UnivariateRelationSeparator alphas; + PGInternalTest::UnivariateSubrelationSeparators alphas; alphas.fill(bb::Univariate(FF(0))); // focus on the arithmetic relation only const auto create_add_gate = [](auto& polys, const size_t idx, FF w_l, FF w_r) { @@ -349,7 +349,7 @@ TEST(Protogalaxy, CombinerOptimizationConsistency) } DeciderProvingKeys keys{ keys_data }; - PGInternalTest::UnivariateRelationSeparator alphas; + PGInternalTest::UnivariateSubrelationSeparators alphas; alphas.fill(bb::Univariate(FF(0))); // focus on the arithmetic relation only GateSeparatorPolynomial gate_separators({ 2 }, /*log_num_monomials=*/1); @@ -435,7 +435,7 @@ TEST(Protogalaxy, CombinerOptimizationConsistency) } DeciderProvingKeys keys{ keys_data }; - PGInternalTest::UnivariateRelationSeparator alphas; + PGInternalTest::UnivariateSubrelationSeparators alphas; alphas.fill(bb::Univariate(FF(0))); // focus on the arithmetic relation only const auto create_add_gate = [](auto& polys, const size_t idx, FF w_l, FF w_r) { diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp index 1654d576f058..b3ef924f3350 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp @@ -167,7 +167,7 @@ template class ProtogalaxyTests : public testing::Test { */ static void test_pertubator_polynomial() { - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; const size_t log_size(3); const size_t size(1 << log_size); // Construct fully random prover polynomials @@ -177,7 +177,7 @@ template class ProtogalaxyTests : public testing::Test { } auto relation_parameters = bb::RelationParameters::get_random(); - RelationSeparator alphas; + SubrelationSeparators alphas; for (auto& alpha : alphas) { alpha = FF::random_element(); } diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp index 6e6ce7acfeea..980908b0c059 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp @@ -23,7 +23,7 @@ template class ProtogalaxyProver using TupleOfTuplesOfUnivariates = typename Flavor::template ProtogalaxyTupleOfTuplesOfUnivariates; using UnivariateRelationParameters = bb::RelationParameters>; - using UnivariateRelationSeparator = + using UnivariateSubrelationSeparators = std::array, Flavor::NUM_SUBRELATIONS - 1>; using Transcript = typename Flavor::Transcript; @@ -49,7 +49,7 @@ template class ProtogalaxyProver CombinerQuotient combiner_quotient; FF perturbator_evaluation; UnivariateRelationParameters relation_parameters; - UnivariateRelationSeparator alphas; + UnivariateSubrelationSeparators alphas; PGInternal pg_internal; @@ -101,7 +101,7 @@ template class ProtogalaxyProver * @details Compute combiner (G polynomial in the paper) and then its quotient (K polynomial), whose coefficient * will be sent to the verifier. */ - std::tuple, UnivariateRelationSeparator, UnivariateRelationParameters, FF, CombinerQuotient> + std::tuple, UnivariateSubrelationSeparators, UnivariateRelationParameters, FF, CombinerQuotient> combiner_quotient_round(const std::vector& gate_challenges, const std::vector& deltas, const DeciderProvingKeys& keys); @@ -115,7 +115,7 @@ template class ProtogalaxyProver */ void update_target_sum_and_fold(const DeciderProvingKeys& keys, const CombinerQuotient& combiner_quotient, - const UnivariateRelationSeparator& alphas, + const UnivariateSubrelationSeparators& alphas, const UnivariateRelationParameters& univariate_relation_parameters, const FF& perturbator_evaluation); diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp index 02f67ada232e..e8bc761bffba 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp @@ -75,7 +75,7 @@ std::tuple, Polynomial> Pr template std::tuple, - typename ProtogalaxyProver_::UnivariateRelationSeparator, + typename ProtogalaxyProver_::UnivariateSubrelationSeparators, typename ProtogalaxyProver_::UnivariateRelationParameters, typename Flavor::FF, typename ProtogalaxyProver_::CombinerQuotient> @@ -89,7 +89,7 @@ ProtogalaxyProver_::combiner_quotient_round(const std::vector< const std::vector updated_gate_challenges = update_gate_challenges(perturbator_challenge, gate_challenges, deltas); - const UnivariateRelationSeparator alphas = PGInternal::compute_and_extend_alphas(keys); + const UnivariateSubrelationSeparators alphas = PGInternal::compute_and_extend_alphas(keys); const GateSeparatorPolynomial gate_separators{ updated_gate_challenges, CONST_PG_LOG_N }; const UnivariateRelationParameters relation_parameters = PGInternal::template compute_extended_relation_parameters(keys); @@ -115,7 +115,7 @@ template void ProtogalaxyProver_::update_target_sum_and_fold( const DeciderProvingKeys& keys, const CombinerQuotient& combiner_quotient, - const UnivariateRelationSeparator& alphas, + const UnivariateSubrelationSeparators& alphas, const UnivariateRelationParameters& univariate_relation_parameters, const FF& perturbator_evaluation) { diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp index abe8b6ea05c8..cf400fa30e96 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp @@ -32,13 +32,13 @@ template class ProtogalaxyProverInternal { using ProverPolynomials = typename Flavor::ProverPolynomials; using Relations = typename Flavor::Relations; using AllValues = typename Flavor::AllValues; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; static constexpr size_t NUM_KEYS = DeciderProvingKeys_::NUM; using UnivariateRelationParametersNoOptimisticSkipping = bb::RelationParameters>; using UnivariateRelationParameters = bb::RelationParameters>; - using UnivariateRelationSeparator = + using UnivariateSubrelationSeparators = std::array, Flavor::NUM_SUBRELATIONS - 1>; // The length of ExtendedUnivariate is the largest length (==max_relation_degree + 1) of a univariate polynomial @@ -107,24 +107,25 @@ template class ProtogalaxyProverInternal { * @return FF The evaluation of the linearly-independent (i.e., 'per-row') subrelations */ inline static FF process_subrelation_evaluations(const RelationEvaluations& evals, - const std::array& challenges, + const SubrelationSeparators& challenges, FF& linearly_dependent_contribution) { - // TODO(https://github.com/AztecProtocol/barretenberg/issues/1115): Iniitalize with first subrelation value to - // avoid Montgomery allocating 0 and doing a mul. This is about 60ns per row. - FF linearly_independent_contribution{ 0 }; + // Initialize result with the contribution from the first subrelation + FF linearly_independent_contribution = std::get<0>(evals)[0]; size_t idx = 0; auto scale_by_challenge_and_accumulate = [&](Element& element) { - using Relation = typename std::tuple_element_t; - const Element contribution = element * challenges[idx]; - if (subrelation_is_linearly_independent()) { - linearly_independent_contribution += contribution; - } else { - linearly_dependent_contribution += contribution; + if constexpr (!(relation_idx == 0 && subrelation_idx == 0)) { + using Relation = typename std::tuple_element_t; + // Accumulate scaled subrelation contribution + const Element contribution = element * challenges[idx++]; + if constexpr (subrelation_is_linearly_independent()) { + linearly_independent_contribution += contribution; + } else { + linearly_dependent_contribution += contribution; + } } - idx++; }; RelationUtils::apply_to_tuple_of_arrays_elements(scale_by_challenge_and_accumulate, evals); return linearly_independent_contribution; @@ -143,7 +144,7 @@ template class ProtogalaxyProverInternal { * linearly dependent subrelation and α_j is its corresponding batching challenge. */ Polynomial compute_row_evaluations(const ProverPolynomials& polynomials, - const RelationSeparator& alphas_, + const SubrelationSeparators& alphas, const RelationParameters& relation_parameters) { @@ -153,13 +154,6 @@ template class ProtogalaxyProverInternal { const size_t polynomial_size = polynomials.get_polynomial_size(); Polynomial aggregated_relation_evaluations(polynomial_size); - const std::array alphas = [&alphas_]() { - std::array tmp; - tmp[0] = 1; - std::copy(alphas_.begin(), alphas_.end(), tmp.begin() + 1); - return tmp; - }(); - // Determine the number of threads over which to distribute the work const size_t num_threads = compute_num_threads(polynomial_size); @@ -359,7 +353,7 @@ template class ProtogalaxyProverInternal { ExtendedUnivariateWithRandomization compute_combiner(const DeciderPKs& keys, const GateSeparatorPolynomial& gate_separators, const UnivariateRelationParameters& relation_parameters, - const UnivariateRelationSeparator& alphas, + const UnivariateSubrelationSeparators& alphas, TupleOfTuplesOfUnivariates& univariate_accumulators) { PROFILE_THIS(); @@ -423,7 +417,7 @@ template class ProtogalaxyProverInternal { ExtendedUnivariateWithRandomization compute_combiner(const DeciderPKs& keys, const GateSeparatorPolynomial& gate_separators, const UnivariateRelationParameters& relation_parameters, - const UnivariateRelationSeparator& alphas) + const UnivariateSubrelationSeparators& alphas) { TupleOfTuplesOfUnivariates accumulators; return compute_combiner(keys, gate_separators, relation_parameters, alphas, accumulators); @@ -456,10 +450,11 @@ template class ProtogalaxyProverInternal { static ExtendedUnivariateWithRandomization batch_over_relations( TupleOfTuplesOfUnivariatesNoOptimisticSkipping& univariate_accumulators, - const UnivariateRelationSeparator& alpha) + const UnivariateSubrelationSeparators& alphas) { auto result = std::get<0>(std::get<0>(univariate_accumulators)).template extend_to(); + size_t idx = 0; const auto scale_and_sum = [&](auto& element) { if constexpr (outer_idx == 0 && inner_idx == 0) { @@ -467,7 +462,7 @@ template class ProtogalaxyProverInternal { } auto extended = element.template extend_to(); - extended *= alpha[idx]; + extended *= alphas[idx]; result += extended; idx++; }; @@ -567,9 +562,9 @@ template class ProtogalaxyProverInternal { * @brief Combine the relation batching parameters (alphas) from each decider proving key into a univariate for * using in the combiner computation. */ - static UnivariateRelationSeparator compute_and_extend_alphas(const DeciderPKs& keys) + static UnivariateSubrelationSeparators compute_and_extend_alphas(const DeciderPKs& keys) { - UnivariateRelationSeparator result; + UnivariateSubrelationSeparators result; size_t alpha_idx = 0; for (auto& alpha : result) { Univariate tmp; diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp index e70cb6196eed..07f58c0553d8 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp @@ -22,7 +22,7 @@ template class ProtogalaxyVerifier_ { using VerificationKey = typename Flavor::VerificationKey; using WitnessCommitments = typename Flavor::WitnessCommitments; using CommitmentLabels = typename Flavor::CommitmentLabels; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; static constexpr size_t NUM_SUBRELATIONS = Flavor::NUM_SUBRELATIONS; diff --git a/barretenberg/cpp/src/barretenberg/relations/utils.hpp b/barretenberg/cpp/src/barretenberg/relations/utils.hpp index 8116bba45f97..64f4e3c0aa4b 100644 --- a/barretenberg/cpp/src/barretenberg/relations/utils.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/utils.hpp @@ -23,7 +23,7 @@ template class RelationUtils { using Relations = typename Flavor::Relations; using PolynomialEvaluations = typename Flavor::AllValues; using RelationEvaluations = typename Flavor::TupleOfArraysOfValues; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; static constexpr size_t NUM_RELATIONS = Flavor::NUM_RELATIONS; static constexpr size_t NUM_SUBRELATIONS = Flavor::NUM_SUBRELATIONS; @@ -68,40 +68,21 @@ template class RelationUtils { * @brief Scale Univariates, each representing a subrelation, by different challenges * * @param tuple Tuple of tuples of Univariates - * @param challenge Array of NUM_SUBRELATIONS - 1 challenges (because the first subrelation doesn't need to be + * @param subrelation_separators Array of NUM_SUBRELATIONS challenges with the first entry equal to 1. * scaled) - * @param current_scalar power of the challenge */ - static void scale_univariates(auto& tuple, const RelationSeparator& challenges, FF& current_scalar) - requires bb::IsFoldingFlavor + static void scale_univariates(auto& tuple, const SubrelationSeparators& subrelation_separators) { size_t idx = 0; - std::array tmp{ current_scalar }; - std::copy(challenges.begin(), challenges.end(), tmp.begin() + 1); - auto scale_by_challenges = [&](auto& element) { - element *= tmp[idx]; - idx++; + auto scale_by_challenges = [&](auto& element) { + // Don't need to scale first univariate + if constexpr (!(outer_idx == 0 && inner_idx == 0)) { + element *= subrelation_separators[idx++]; + } }; apply_to_tuple_of_tuples(tuple, scale_by_challenges); } - /** - * @brief Scale Univariates by consecutive powers of the provided challenge - * - * @param tuple Tuple of tuples of Univariates - * @param challenge - * @param current_scalar power of the challenge - */ - static void scale_univariates(auto& tuple, const RelationSeparator& challenge, FF& current_scalar) - requires(!bb::IsFoldingFlavor) - { - auto scale_by_consecutive_powers_of_challenge = [&](auto&... elements) { - ((elements *= current_scalar, current_scalar *= challenge), ...); - }; - - std::apply([&](auto&&... args) { (std::apply(scale_by_consecutive_powers_of_challenge, args), ...); }, tuple); - } - /** * @brief Componentwise addition of two tuples * @details Used for adding tuples of Univariates but in general works for any object for which += is @@ -233,45 +214,21 @@ template class RelationUtils { * scaled) * @param result Batched result */ - static void scale_and_batch_elements(auto& tuple, - const RelationSeparator& challenges, - FF current_scalar, - FF& result) - requires bb::IsFoldingFlavor + static FF scale_and_batch_elements(auto& tuple, const SubrelationSeparators& subrelation_separators) { + // Initialize result with the contribution from the first subrelation + FF result = std::get<0>(tuple)[0]; + size_t idx = 0; - std::array tmp{ current_scalar }; - std::copy(challenges.begin(), challenges.end(), tmp.begin() + 1); - auto scale_by_challenges_and_accumulate = [&](auto& element) { - for (auto& entry : element) { - result += entry * tmp[idx]; - idx++; - } - }; - apply_to_tuple_of_arrays(scale_by_challenges_and_accumulate, tuple); - } - /** - * @brief Scale elements by consecutive powers of a given challenge then sum the result - * @param result Batched result - */ - static void scale_and_batch_elements(auto& tuple, const RelationSeparator& challenge, FF current_scalar, FF& result) - requires(!bb::IsFoldingFlavor) - { - // TODO(https://github.com/AztecProtocol/barretenberg/issues/1443) write one method to remove IsFoldingFlavor - // and !IsFoldingFlavor - constexpr const size_t last_index = std::tuple_size_v> - 1; - const auto& last_array = std::get(tuple); - const auto* last_element_ptr = last_array.empty() ? nullptr : &last_array.back(); - auto scale_by_challenge_and_accumulate = [&](auto& element) { - for (auto& entry : element) { - result += entry * current_scalar; - if (last_element_ptr == nullptr || &entry != last_element_ptr) { - current_scalar *= challenge; - } + auto scale_by_challenges_and_accumulate = [&](auto& element) { + if constexpr (!(outer_idx == 0 && inner_idx == 0)) { + // Accumulate scaled subrelation contribution + result += element * subrelation_separators[idx++]; } }; - apply_to_tuple_of_arrays(scale_by_challenge_and_accumulate, tuple); + apply_to_tuple_of_arrays_elements(scale_by_challenges_and_accumulate, tuple); + return result; } /** diff --git a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp index db653b774a02..536ef0eec811 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp @@ -10,7 +10,6 @@ #include "barretenberg/flavor/flavor.hpp" #include "barretenberg/flavor/flavor_macros.hpp" #include "barretenberg/flavor/relation_definitions.hpp" -#include "barretenberg/polynomials/univariate.hpp" #include "barretenberg/relations/ecc_vm/ecc_lookup_relation.hpp" #include "barretenberg/relations/ecc_vm/ecc_msm_relation.hpp" #include "barretenberg/relations/ecc_vm/ecc_point_table_relation.hpp" @@ -34,7 +33,6 @@ class ECCVMRecursiveFlavor { using GroupElement = Curve::Element; using FF = Curve::ScalarField; using BF = Curve::BaseField; - using RelationSeparator = FF; using NativeFlavor = ECCVMFlavor; using NativeVerificationKey = NativeFlavor::VerificationKey; using PCS = IPA; @@ -63,6 +61,9 @@ class ECCVMRecursiveFlavor { // Reuse the Relations from ECCVM using Relations = ECCVMFlavor::Relations_; + static constexpr size_t NUM_SUBRELATIONS = ECCVMFlavor::NUM_SUBRELATIONS; + using SubrelationSeparators = std::array; + static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = ECCVMFlavor::MAX_PARTIAL_RELATION_LENGTH; // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta` diff --git a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.cpp index 9ce432627742..185c429cfcb1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.cpp @@ -79,8 +79,11 @@ ECCVMRecursiveVerifier::IpaClaimAndProof ECCVMRecursiveVerifier::verify_proof(co commitments.z_perm = transcript->template receive_from_prover(commitment_labels.z_perm); // Execute Sumcheck Verifier - Sumcheck sumcheck(transcript); + // Each linearly independent subrelation contribution is multiplied by `alpha^i`, where + // i = 0, ..., NUM_SUBRELATIONS- 1. const FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + Sumcheck sumcheck(transcript, alpha); + std::vector gate_challenges(CONST_ECCVM_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)); @@ -91,7 +94,7 @@ ECCVMRecursiveVerifier::IpaClaimAndProof ECCVMRecursiveVerifier::verify_proof(co libra_commitments[0] = transcript->template receive_from_prover("Libra:concatenation_commitment"); - auto sumcheck_output = sumcheck.verify(relation_parameters, alpha, gate_challenges); + auto sumcheck_output = sumcheck.verify(relation_parameters, gate_challenges); libra_commitments[1] = transcript->template receive_from_prover("Libra:grand_sum_commitment"); libra_commitments[2] = transcript->template receive_from_prover("Libra:quotient_commitment"); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.cpp index 153f3e59482c..b1d4471658c8 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.cpp @@ -50,10 +50,10 @@ DeciderRecursiveVerifier_::PairingPoints DeciderRecursiveVerifier_vk_and_hash->vk->circuit_size); - Sumcheck sumcheck(transcript, accumulator->target_sum); + Sumcheck sumcheck(transcript, accumulator->alphas, accumulator->target_sum); - SumcheckOutput output = sumcheck.verify( - accumulator->relation_parameters, accumulator->alphas, accumulator->gate_challenges, padding_indicator_array); + SumcheckOutput output = + sumcheck.verify(accumulator->relation_parameters, accumulator->gate_challenges, padding_indicator_array); // Execute Shplemini rounds. ClaimBatcher claim_batcher{ diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.hpp index 8b535a21ff79..1913d28e1355 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.hpp @@ -6,8 +6,6 @@ #pragma once #include "barretenberg/flavor/mega_recursive_flavor.hpp" -#include "barretenberg/flavor/ultra_recursive_flavor.hpp" -#include "barretenberg/flavor/ultra_rollup_recursive_flavor.hpp" #include "barretenberg/honk/proof_system/types/proof.hpp" #include "barretenberg/stdlib/pairing_points.hpp" #include "barretenberg/stdlib/proof/proof.hpp" @@ -24,7 +22,6 @@ template class DeciderRecursiveVerifier_ { using VerificationKey = typename Flavor::VerificationKey; using VerifierCommitmentKey = typename Flavor::VerifierCommitmentKey; using Builder = typename Flavor::CircuitBuilder; - using RelationSeparator = typename Flavor::RelationSeparator; using PairingPoints = stdlib::recursion::PairingPoints; using RecursiveDeciderVK = RecursiveDeciderVerificationKey_; using NativeDeciderVK = bb::DeciderVerificationKey_; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/oink_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/oink_recursive_verifier.cpp index c3b8b6e6a677..4319444a16d6 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/oink_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/oink_recursive_verifier.cpp @@ -116,12 +116,14 @@ template void OinkRecursiveVerifier_::verify() // Get commitment to permutation and lookup grand products commitments.z_perm = transcript->template receive_from_prover(domain_separator + labels.z_perm); - RelationSeparator alphas; - std::array args; - for (size_t idx = 0; idx < alphas.size(); ++idx) { - args[idx] = domain_separator + "alpha_" + std::to_string(idx); + // Get the subrelation separation challenges for sumcheck/combiner computation + std::array challenge_labels; + + for (size_t idx = 0; idx < Flavor::NUM_SUBRELATIONS - 1; ++idx) { + challenge_labels[idx] = domain_separator + "alpha_" + std::to_string(idx); } - alphas = transcript->template get_challenges(args); + // It is more efficient to generate an array of challenges than to generate them individually. + SubrelationSeparators alphas = transcript->template get_challenges(challenge_labels); decider_vk->relation_parameters = RelationParameters{ eta, eta_two, eta_three, beta, gamma, public_input_delta }; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/oink_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/oink_recursive_verifier.hpp index 640b82635cb2..62e6f824a3fc 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/oink_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/oink_recursive_verifier.hpp @@ -18,7 +18,7 @@ template class OinkRecursiveVerifier_ { using RecursiveDeciderVK = RecursiveDeciderVerificationKey_; using VerificationKey = typename Flavor::VerificationKey; using Builder = typename Flavor::CircuitBuilder; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; using Transcript = bb::BaseTranscript>; using WitnessCommitments = typename Flavor::WitnessCommitments; using OinkProof = std::vector; 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 29b7c109f0e5..884c1547f582 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 @@ -94,7 +94,7 @@ UltraRecursiveVerifier_::Output UltraRecursiveVerifier_::verify_ constrain_log_circuit_size(padding_indicator_array, key->vk_and_hash->vk->circuit_size); - auto sumcheck = Sumcheck(transcript); + Sumcheck sumcheck(transcript, key->alphas); // Receive commitments to Libra masking polynomials std::array libra_commitments = {}; @@ -102,7 +102,7 @@ UltraRecursiveVerifier_::Output UltraRecursiveVerifier_::verify_ libra_commitments[0] = transcript->template receive_from_prover("Libra:concatenation_commitment"); } SumcheckOutput sumcheck_output = - sumcheck.verify(key->relation_parameters, key->alphas, gate_challenges, padding_indicator_array); + sumcheck.verify(key->relation_parameters, gate_challenges, padding_indicator_array); // For MegaZKFlavor: the sumcheck output contains claimed evaluations of the Libra polynomials if constexpr (Flavor::HasZK) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp index 1c89bb76f17c..b587988cdea9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp @@ -34,7 +34,6 @@ template class UltraRecursiveVerifier_ { using VKAndHash = typename Flavor::VKAndHash; using VerifierCommitmentKey = typename Flavor::VerifierCommitmentKey; using Builder = typename Flavor::CircuitBuilder; - using RelationSeparator = typename Flavor::RelationSeparator; using PairingObject = PairingPoints; using Transcript = bb::BaseTranscript>; using OinkVerifier = OinkRecursiveVerifier_; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/recursive_decider_verification_key.hpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/recursive_decider_verification_key.hpp index ad95293688a2..63ab42a5fad5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/recursive_decider_verification_key.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/recursive_decider_verification_key.hpp @@ -24,7 +24,7 @@ template class RecursiveDeciderVerificationKey_ { using VKAndHash = typename Flavor::VKAndHash; using WitnessCommitments = typename Flavor::WitnessCommitments; using CommitmentLabels = typename Flavor::CommitmentLabels; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; using Builder = typename Flavor::CircuitBuilder; using NativeFlavor = typename Flavor::NativeFlavor; using NativeVerificationKey = typename Flavor::NativeFlavor::VerificationKey; @@ -37,7 +37,8 @@ template class RecursiveDeciderVerificationKey_ { bool is_accumulator = false; std::vector public_inputs; - RelationSeparator alphas; // a challenge for each subrelation + // An array {1, α₁, …, αₖ}, where k = NUM_SUBRELATIONS - 1. + SubrelationSeparators alphas; RelationParameters relation_parameters; std::vector gate_challenges; // The target sum, which is typically nonzero for a ProtogalaxyProver's accmumulator @@ -70,7 +71,7 @@ template class RecursiveDeciderVerificationKey_ { for (auto [native_public_input] : zip_view(verification_key->public_inputs)) { public_inputs.emplace_back(FF::from_witness(builder, native_public_input)); } - for (size_t alpha_idx = 0; alpha_idx < alphas.size(); alpha_idx++) { + for (size_t alpha_idx = 0; alpha_idx < Flavor::NUM_SUBRELATIONS - 1; alpha_idx++) { alphas[alpha_idx] = FF::from_witness(builder, verification_key->alphas[alpha_idx]); } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp index e95e98fda0af..3d844d7a4213 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp @@ -40,7 +40,8 @@ class TranslatorRecursiveFlavor { using Commitment = Curve::AffineElement; using FF = Curve::ScalarField; using BF = Curve::BaseField; - using RelationSeparator = FF; + static constexpr size_t NUM_SUBRELATIONS = TranslatorFlavor::NUM_SUBRELATIONS; + using SubrelationSeparators = std::array; using NativeFlavor = TranslatorFlavor; using NativeVerificationKey = NativeFlavor::VerificationKey; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.cpp index c8e9f3dbe726..0d43dee97514 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.cpp @@ -127,8 +127,12 @@ TranslatorRecursiveVerifier::PairingPoints TranslatorRecursiveVerifier::verify_p commitments.z_perm = transcript->template receive_from_prover(commitment_labels.z_perm); // Execute Sumcheck Verifier - Sumcheck sumcheck(transcript); - FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + // Each linearly independent subrelation contribution is multiplied by `alpha^i`, where + // i = 0, ..., NUM_SUBRELATIONS- 1. + const FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + + Sumcheck sumcheck(transcript, alpha); + std::vector gate_challenges(TranslatorFlavor::CONST_TRANSLATOR_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)); @@ -143,7 +147,7 @@ TranslatorRecursiveVerifier::PairingPoints TranslatorRecursiveVerifier::verify_p std::array padding_indicator_array; std::ranges::fill(padding_indicator_array, one); - auto sumcheck_output = sumcheck.verify(relation_parameters, alpha, gate_challenges, padding_indicator_array); + auto sumcheck_output = sumcheck.verify(relation_parameters, gate_challenges, padding_indicator_array); libra_commitments[1] = transcript->template receive_from_prover("Libra:grand_sum_commitment"); libra_commitments[2] = transcript->template receive_from_prover("Libra:quotient_commitment"); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.hpp index 661a93cd9f80..3319f3035cbc 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.hpp @@ -28,7 +28,6 @@ class TranslatorRecursiveVerifier { using VerificationKey = Flavor::VerificationKey; using NativeVerificationKey = Flavor::NativeVerificationKey; using VerifierCommitmentKey = Flavor::VerifierCommitmentKey; - using RelationSeparator = Flavor::RelationSeparator; using PairingPoints = stdlib::recursion::PairingPoints; using TranslationEvaluations = TranslationEvaluations_; using Transcript = Flavor::Transcript; diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/partial_evaluation.test.cpp b/barretenberg/cpp/src/barretenberg/sumcheck/partial_evaluation.test.cpp index 3416e4224b74..41834afa6f73 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/partial_evaluation.test.cpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/partial_evaluation.test.cpp @@ -43,13 +43,14 @@ TYPED_TEST_SUITE(PartialEvaluationTests, Flavors); TYPED_TEST(PartialEvaluationTests, TwoRoundsSpecial) { using Flavor = TypeParam; - using FF = typename Flavor::FF; - using Polynomial = typename Flavor::Polynomial; - using Transcript = typename Flavor::Transcript; + using FF = Flavor::FF; + using Polynomial = Flavor::Polynomial; + using Transcript = Flavor::Transcript; + using SubrelationSeparators = Flavor::SubrelationSeparators; // values here are chosen to check another test - const size_t multivariate_d(2); - const size_t multivariate_n(1 << multivariate_d); + static constexpr size_t multivariate_d(2); + static constexpr size_t multivariate_n(1 << multivariate_d); FF v00 = 0; FF v10 = 1; @@ -59,9 +60,14 @@ TYPED_TEST(PartialEvaluationTests, TwoRoundsSpecial) Polynomial f0(4); f0.template copy_vector({ v00, v10, v01, v11 }); - auto full_polynomials = std::array({ f0 }); + typename Flavor::ProverPolynomials full_polynomials; + full_polynomials.q_m = f0; auto transcript = Transcript::prover_init_empty(); - auto sumcheck = SumcheckProver(multivariate_n, transcript); + SubrelationSeparators alpha{ 1 }; + std::vector gate_challenges{ 1, 1 }; + + SumcheckProver sumcheck( + multivariate_n, full_polynomials, transcript, alpha, gate_challenges, {}); FF round_challenge_0 = { 0x6c7301b49d85a46c, 0x44311531e39c64f6, 0xb13d66d8d6c1a24c, 0x04410c360230a295 }; round_challenge_0.self_to_montgomery_form(); @@ -85,12 +91,13 @@ TYPED_TEST(PartialEvaluationTests, TwoRoundsSpecial) TYPED_TEST(PartialEvaluationTests, TwoRoundsGeneric) { using Flavor = TypeParam; - using FF = typename Flavor::FF; - using Polynomial = typename Flavor::Polynomial; - using Transcript = typename Flavor::Transcript; + using FF = Flavor::FF; + using Polynomial = Flavor::Polynomial; + using Transcript = Flavor::Transcript; + using SubrelationSeparators = Flavor::SubrelationSeparators; - const size_t multivariate_d(2); - const size_t multivariate_n(1 << multivariate_d); + static constexpr size_t multivariate_d(2); + static constexpr size_t multivariate_n(1 << multivariate_d); FF v00 = FF::random_element(); FF v10 = FF::random_element(); @@ -100,9 +107,14 @@ TYPED_TEST(PartialEvaluationTests, TwoRoundsGeneric) Polynomial f0(4); f0.template copy_vector({ v00, v10, v01, v11 }); - auto full_polynomials = std::array({ f0 }); auto transcript = Transcript::prover_init_empty(); - auto sumcheck = SumcheckProver(multivariate_n, transcript); + SubrelationSeparators alpha{ 1 }; + typename Flavor::ProverPolynomials full_polynomials; + full_polynomials.q_m = f0; + std::vector gate_challenges{ 1, 1 }; + + SumcheckProver sumcheck( + multivariate_n, full_polynomials, transcript, alpha, gate_challenges, {}); FF round_challenge_0 = FF::random_element(); FF expected_lo = v00 * (FF(1) - round_challenge_0) + v10 * round_challenge_0; @@ -146,12 +158,13 @@ TYPED_TEST(PartialEvaluationTests, TwoRoundsGeneric) TYPED_TEST(PartialEvaluationTests, ThreeRoundsSpecial) { using Flavor = TypeParam; - using FF = typename Flavor::FF; - using Polynomial = typename Flavor::Polynomial; - using Transcript = typename Flavor::Transcript; + using FF = Flavor::FF; + using Polynomial = Flavor::Polynomial; + using Transcript = Flavor::Transcript; + using SubrelationSeparators = Flavor::SubrelationSeparators; - const size_t multivariate_d(3); - const size_t multivariate_n(1 << multivariate_d); + static constexpr size_t multivariate_d(3); + static constexpr size_t multivariate_n(1 << multivariate_d); FF v000 = 1; FF v100 = 2; @@ -165,9 +178,15 @@ TYPED_TEST(PartialEvaluationTests, ThreeRoundsSpecial) Polynomial f0(8); f0.template copy_vector({ v000, v100, v010, v110, v001, v101, v011, v111 }); - auto full_polynomials = std::array({ f0 }); + typename Flavor::ProverPolynomials full_polynomials; + full_polynomials.q_m = f0; auto transcript = Transcript::prover_init_empty(); - auto sumcheck = SumcheckProver(multivariate_n, transcript); + SubrelationSeparators alpha{ 1 }; + + std::vector gate_challenges{ 1, 1, 1 }; + + SumcheckProver sumcheck( + multivariate_n, full_polynomials, transcript, alpha, gate_challenges, {}); FF round_challenge_0 = 1; FF expected_q1 = v000 * (FF(1) - round_challenge_0) + v100 * round_challenge_0; // 2 @@ -201,12 +220,13 @@ TYPED_TEST(PartialEvaluationTests, ThreeRoundsSpecial) TYPED_TEST(PartialEvaluationTests, ThreeRoundsGeneric) { using Flavor = TypeParam; - using FF = typename Flavor::FF; - using Polynomial = typename Flavor::Polynomial; - using Transcript = typename Flavor::Transcript; + using FF = Flavor::FF; + using Polynomial = Flavor::Polynomial; + using Transcript = Flavor::Transcript; + using SubrelationSeparators = Flavor::SubrelationSeparators; - const size_t multivariate_d(3); - const size_t multivariate_n(1 << multivariate_d); + static constexpr size_t multivariate_d(3); + static constexpr size_t multivariate_n(1 << multivariate_d); FF v000 = FF::random_element(); FF v100 = FF::random_element(); @@ -220,9 +240,15 @@ TYPED_TEST(PartialEvaluationTests, ThreeRoundsGeneric) Polynomial f0(8); f0.template copy_vector({ v000, v100, v010, v110, v001, v101, v011, v111 }); - auto full_polynomials = std::array({ f0 }); + typename Flavor::ProverPolynomials full_polynomials; + full_polynomials.q_m = f0; + auto transcript = Transcript::prover_init_empty(); - auto sumcheck = SumcheckProver(multivariate_n, transcript); + SubrelationSeparators alpha{ 1 }; + std::vector gate_challenges{ 1, 1, 1 }; + + SumcheckProver sumcheck( + multivariate_n, full_polynomials, transcript, alpha, gate_challenges, {}); FF round_challenge_0 = FF::random_element(); FF expected_q1 = v000 * (FF(1) - round_challenge_0) + v100 * round_challenge_0; @@ -256,12 +282,13 @@ TYPED_TEST(PartialEvaluationTests, ThreeRoundsGeneric) TYPED_TEST(PartialEvaluationTests, ThreeRoundsGenericMultiplePolys) { using Flavor = TypeParam; - using FF = typename Flavor::FF; - using Polynomial = typename Flavor::Polynomial; - using Transcript = typename Flavor::Transcript; + using FF = Flavor::FF; + using Polynomial = Flavor::Polynomial; + using Transcript = Flavor::Transcript; + using SubrelationSeparators = Flavor::SubrelationSeparators; - const size_t multivariate_d(3); - const size_t multivariate_n(1 << multivariate_d); + static constexpr size_t multivariate_d(3); + static constexpr size_t multivariate_n(1 << multivariate_d); std::array v000; std::array v100; std::array v010; @@ -286,9 +313,17 @@ TYPED_TEST(PartialEvaluationTests, ThreeRoundsGenericMultiplePolys) f1.template copy_vector({ v000[1], v100[1], v010[1], v110[1], v001[1], v101[1], v011[1], v111[1] }); f2.template copy_vector({ v000[2], v100[2], v010[2], v110[2], v001[2], v101[2], v011[2], v111[2] }); - auto full_polynomials = std::array{ f0, f1, f2 }; + typename Flavor::ProverPolynomials full_polynomials; + // Set the first 3 ProverPolynomials + full_polynomials.q_m = f0; + full_polynomials.q_c = f1; + full_polynomials.q_l = f2; auto transcript = Transcript::prover_init_empty(); - auto sumcheck = SumcheckProver(multivariate_n, transcript); + SubrelationSeparators alpha{ 1 }; + std::vector gate_challenges{ 1, 1, 1 }; + + SumcheckProver sumcheck( + multivariate_n, full_polynomials, transcript, alpha, gate_challenges, {}); std::array expected_q1; std::array expected_q2; diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp index 777f4ba02e90..fdc028a7ea8c 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp @@ -130,7 +130,7 @@ template using ClaimedEvaluations = typename Flavor::AllValues; using ZKData = ZKSumcheckData; using Transcript = typename Flavor::Transcript; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; using CommitmentKey = typename Flavor::CommitmentKey; /** @@ -148,9 +148,19 @@ template const size_t multivariate_n; // The number of variables const size_t multivariate_d; + // A reference to all prover multilinear polynomials. + ProverPolynomials& full_polynomials; std::shared_ptr transcript; + // Contains the core sumcheck methods such as `compute_univariate`. SumcheckProverRound round; + // An array of size NUM_SUBRELATIONS-1 containing challenges or consecutive powers of a single challenge that + // separate linearly independent subrelation. + SubrelationSeparators alphas; + // pow_β(X₀, ..., X_{d−1}) = ∏ₖ₌₀^{d−1} (1 − Xₖ + Xₖ ⋅ βₖ) + bb::GateSeparatorPolynomial gate_separators; + // Contains various challenges, such as `beta` and `gamma` used in the Grand Product argument. + bb::RelationParameters relation_parameters; std::vector multivariate_challenge; @@ -172,35 +182,53 @@ template * TODO(#224)(Cody): might want to just do C-style multidimensional array? for guaranteed adjacency? */ PartiallyEvaluatedMultivariates partially_evaluated_polynomials; - // prover instantiates sumcheck with circuit size and a prover transcript - SumcheckProver(size_t multivariate_n, const std::shared_ptr& transcript) + + // SumcheckProver constructor for the Flavors that generate NUM_SUBRELATIONS - 1 subrelation separator challenges. + SumcheckProver(size_t multivariate_n, + ProverPolynomials& prover_polynomials, + std::shared_ptr transcript, + const SubrelationSeparators& relation_separator, + const std::vector& gate_challenges, + const RelationParameters& relation_parameters) : multivariate_n(multivariate_n) , multivariate_d(numeric::get_msb(multivariate_n)) - , transcript(transcript) - , round(multivariate_n){}; - + , full_polynomials(prover_polynomials) + , transcript(std::move(transcript)) + , round(multivariate_n) + , alphas(relation_separator) + , gate_separators(gate_challenges, multivariate_d) + , relation_parameters(relation_parameters){}; + + // SumcheckProver constructor for the Flavors that generate a single challeng `alpha` and use its powers as + // subrelation seperator challenges. + SumcheckProver(size_t multivariate_n, + ProverPolynomials& prover_polynomials, + std::shared_ptr transcript, + const FF& alpha, + const std::vector& gate_challenges, + const RelationParameters& relation_parameters) + : multivariate_n(multivariate_n) + , multivariate_d(numeric::get_msb(multivariate_n)) + , full_polynomials(prover_polynomials) + , transcript(std::move(transcript)) + , round(multivariate_n) + , alphas(initialize_relation_separator(alpha)) + , gate_separators(gate_challenges, multivariate_d) + , relation_parameters(relation_parameters){}; /** * @brief Non-ZK version: Compute round univariate, place it in transcript, compute challenge, partially evaluate. * Repeat until final round, then get full evaluations of prover polynomials, and place them in transcript. * @details See Detailed description of \ref bb::SumcheckProver< Flavor > "Sumcheck Prover . - * @param full_polynomials Container for ProverPolynomials - * @param relation_parameters - * @param alpha Batching challenge for subrelations. - * @param gate_challenges * @return SumcheckOutput */ - SumcheckOutput prove(ProverPolynomials& full_polynomials, - const bb::RelationParameters& relation_parameters, - const RelationSeparator alpha, - const std::vector& gate_challenges) + SumcheckOutput prove() { - bb::GateSeparatorPolynomial gate_separators(gate_challenges, multivariate_d); - - multivariate_challenge.reserve(multivariate_d); + multivariate_challenge.reserve(virtual_log_n); // In the first round, we compute the first univariate polynomial and populate the book-keeping table of // #partially_evaluated_polynomials, which has \f$ n/2 \f$ rows and \f$ N \f$ columns. When the Flavor has ZK, // compute_univariate also takes into account the zk_sumcheck_data. - auto round_univariate = round.compute_univariate(full_polynomials, relation_parameters, gate_separators, alpha); + auto round_univariate = + round.compute_univariate(full_polynomials, relation_parameters, gate_separators, alphas); // Initialize the partially evaluated polynomials which will be used in the following rounds. // This will use the information in the structured full polynomials to save memory if possible. partially_evaluated_polynomials = PartiallyEvaluatedMultivariates(full_polynomials, multivariate_n); @@ -225,7 +253,7 @@ template // Write the round univariate to the transcript round_univariate = - round.compute_univariate(partially_evaluated_polynomials, relation_parameters, gate_separators, alpha); + round.compute_univariate(partially_evaluated_polynomials, relation_parameters, gate_separators, alphas); // Place evaluations of Sumcheck Round Univariate in the transcript transcript->send_to_verifier("Sumcheck:univariate_" + std::to_string(round_idx), round_univariate); FF round_challenge = transcript->template get_challenge("Sumcheck:u_" + std::to_string(round_idx)); @@ -259,18 +287,10 @@ template * @brief ZK-version of `prove` that runs Sumcheck with disabled rows and masking of Round Univariates. * The masking is ensured by adding random Libra univariates to the Sumcheck round univariates. * - * @param full_polynomials - * @param relation_parameters - * @param alpha - * @param gate_challenges * @param zk_sumcheck_data * @return SumcheckOutput */ - SumcheckOutput prove(ProverPolynomials& full_polynomials, - const bb::RelationParameters& relation_parameters, - const RelationSeparator alpha, - const std::vector& gate_challenges, - ZKData& zk_sumcheck_data) + SumcheckOutput prove(ZKData& zk_sumcheck_data) requires Flavor::HasZK { CommitmentKey ck; @@ -285,7 +305,6 @@ template } } - bb::GateSeparatorPolynomial gate_separators(gate_challenges, multivariate_d); vinfo("starting sumcheck rounds..."); multivariate_challenge.reserve(multivariate_d); @@ -296,11 +315,12 @@ template auto hiding_univariate = round.compute_hiding_univariate(full_polynomials, relation_parameters, gate_separators, - alpha, + alphas, zk_sumcheck_data, row_disabling_polynomial, round_idx); - auto round_univariate = round.compute_univariate(full_polynomials, relation_parameters, gate_separators, alpha); + auto round_univariate = + round.compute_univariate(full_polynomials, relation_parameters, gate_separators, alphas); round_univariate += hiding_univariate; // Initialize the partially evaluated polynomials which will be used in the following rounds. @@ -344,12 +364,12 @@ template hiding_univariate = round.compute_hiding_univariate(partially_evaluated_polynomials, relation_parameters, gate_separators, - alpha, + alphas, zk_sumcheck_data, row_disabling_polynomial, round_idx); round_univariate = - round.compute_univariate(partially_evaluated_polynomials, relation_parameters, gate_separators, alpha); + round.compute_univariate(partially_evaluated_polynomials, relation_parameters, gate_separators, alphas); round_univariate += hiding_univariate; if constexpr (!IsGrumpkinFlavor) { @@ -458,7 +478,7 @@ template * @param round_size \f$2^{d-i}\f$ * @param round_challenge \f$u_i\f$ */ - void partially_evaluate(auto& polynomials, FF round_challenge) + void partially_evaluate(auto& polynomials, const FF& round_challenge) { auto pep_view = partially_evaluated_polynomials.get_all(); auto poly_view = polynomials.get_all(); @@ -484,7 +504,7 @@ template * Specialization for array, see \ref bb::SumcheckProver::partially_evaluate "generic version". */ template - void partially_evaluate(std::array& polynomials, FF round_challenge) + void partially_evaluate(std::array& polynomials, const FF& round_challenge) { auto pep_view = partially_evaluated_polynomials.get_all(); // after the first round, operate in place on partially_evaluated_polynomials @@ -615,7 +635,7 @@ template class // compute full_honk_relation_purported_value using ClaimedLibraEvaluations = typename std::vector; using Transcript = typename Flavor::Transcript; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; using Commitment = typename Flavor::Commitment; /** @@ -631,6 +651,9 @@ template class std::shared_ptr transcript; SumcheckVerifierRound round; + // An array of size NUM_SUBRELATIONS-1 containing challenges or consecutive powers of a single challenge that + // separate linearly independent subrelation. + SubrelationSeparators alphas; FF libra_evaluation{ 0 }; FF libra_challenge; FF libra_total_sum; @@ -640,9 +663,17 @@ template class std::vector round_univariate_commitments = {}; std::vector> round_univariate_evaluations = {}; - explicit SumcheckVerifier(std::shared_ptr transcript, FF target_sum = 0) - : transcript(transcript) - , round(target_sum){}; + explicit SumcheckVerifier(std::shared_ptr transcript, + SubrelationSeparators& relation_separator, + FF target_sum = 0) + : transcript(std::move(transcript)) + , round(target_sum) + , alphas(relation_separator){}; + + explicit SumcheckVerifier(std::shared_ptr transcript, const FF& alpha, FF target_sum = 0) + : transcript(std::move(transcript)) + , round(target_sum) + , alphas(initialize_relation_separator(alpha)){}; /** * @brief Extract round univariate, check sum, generate challenge, compute next target sum..., repeat until * final round, then use purported evaluations to generate purported full Honk relation value and check against @@ -653,7 +684,6 @@ template class * @param transcript */ SumcheckOutput verify(const bb::RelationParameters& relation_parameters, - RelationSeparator alpha, std::vector& gate_challenges, const std::array& padding_indicator_array) requires(!IsGrumpkinFlavor) @@ -708,7 +738,7 @@ template class // Evaluate the Honk relation at the point (u_0, ..., u_{d-1}) using claimed evaluations of prover polynomials. // In ZK Flavors, the evaluation is corrected by full_libra_purported_value FF full_honk_purported_value = round.compute_full_relation_purported_value( - purported_evaluations, relation_parameters, gate_separators, alpha); + purported_evaluations, relation_parameters, gate_separators, alphas); // For ZK Flavors: compute the evaluation of the Row Disabling Polynomial at the sumcheck challenge and of the // libra univariate used to hide the contribution from the actual Honk relation @@ -760,7 +790,6 @@ template class * @return SumcheckOutput */ SumcheckOutput verify(const bb::RelationParameters& relation_parameters, - RelationSeparator alpha, const std::vector& gate_challenges) requires IsGrumpkinFlavor { @@ -814,7 +843,7 @@ template class // Evaluate the Honk relation at the point (u_0, ..., u_{d-1}) using claimed evaluations of prover polynomials. // In ZK Flavors, the evaluation is corrected by full_libra_purported_value FF full_honk_purported_value = round.compute_full_relation_purported_value( - purported_evaluations, relation_parameters, gate_separators, alpha); + purported_evaluations, relation_parameters, gate_separators, alphas); // Compute the evaluations of the polynomial (1 - \sum L_i) where the sum is for i corresponding to the rows // where all sumcheck relations are disabled @@ -867,4 +896,13 @@ template class }; }; +template std::array initialize_relation_separator(const FF& alpha) +{ + std::array alphas; + alphas[0] = alpha; + for (size_t i = 1; i < N; ++i) { + alphas[i] = alphas[i - 1] * alpha; + } + return alphas; +} } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp index 23d6ae0a7a48..e216b093976d 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp @@ -15,7 +15,7 @@ template class SumcheckTests : public ::testing::Test { public: using FF = typename Flavor::FF; using ProverPolynomials = typename Flavor::ProverPolynomials; - using RelationSeparator = Flavor::RelationSeparator; + using SubrelationSeparators = Flavor::SubrelationSeparators; using ZKData = ZKSumcheckData; const size_t NUM_POLYNOMIALS = Flavor::NUM_ALL_ENTITIES; @@ -55,8 +55,7 @@ template class SumcheckTests : public ::testing::Test { auto transcript = Flavor::Transcript::prover_init_empty(); - auto sumcheck = SumcheckProver(multivariate_n, transcript); - RelationSeparator alpha; + SubrelationSeparators alpha; for (size_t idx = 0; idx < alpha.size(); idx++) { alpha[idx] = transcript->template get_challenge("Sumcheck:alpha_" + std::to_string(idx)); } @@ -66,7 +65,10 @@ template class SumcheckTests : public ::testing::Test { gate_challenges[idx] = transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } - auto output = sumcheck.prove(full_polynomials, {}, alpha, gate_challenges); + + SumcheckProver sumcheck(multivariate_n, full_polynomials, transcript, alpha, gate_challenges, {}); + + auto output = sumcheck.prove(); FF u_0 = output.challenge[0]; FF u_1 = output.challenge[1]; @@ -129,9 +131,7 @@ template class SumcheckTests : public ::testing::Test { auto transcript = Flavor::Transcript::prover_init_empty(); - auto sumcheck = SumcheckProver(multivariate_n, transcript); - - RelationSeparator alpha; + SubrelationSeparators alpha; for (size_t idx = 0; idx < alpha.size(); idx++) { alpha[idx] = transcript->template get_challenge("Sumcheck:alpha_" + std::to_string(idx)); } @@ -141,13 +141,16 @@ template class SumcheckTests : public ::testing::Test { gate_challenges[idx] = transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } + + SumcheckProver sumcheck(multivariate_n, full_polynomials, transcript, alpha, gate_challenges, {}); + SumcheckOutput output; if constexpr (Flavor::HasZK) { ZKData zk_sumcheck_data = ZKData(multivariate_d, transcript); - output = sumcheck.prove(full_polynomials, {}, alpha, gate_challenges, zk_sumcheck_data); + output = sumcheck.prove(zk_sumcheck_data); } else { - output = sumcheck.prove(full_polynomials, {}, alpha, gate_challenges); + output = sumcheck.prove(); } FF u_0 = output.challenge[0]; FF u_1 = output.challenge[1]; @@ -242,34 +245,41 @@ template class SumcheckTests : public ::testing::Test { .public_input_delta = FF::one(), }; auto prover_transcript = Flavor::Transcript::prover_init_empty(); - auto sumcheck_prover = SumcheckProver(multivariate_n, prover_transcript); - - RelationSeparator prover_alpha; - for (size_t idx = 0; idx < prover_alpha.size(); idx++) { + SubrelationSeparators prover_alpha{ 1 }; + for (size_t idx = 1; idx < prover_alpha.size(); idx++) { prover_alpha[idx] = prover_transcript->template get_challenge("Sumcheck:alpha_" + std::to_string(idx)); } + std::vector prover_gate_challenges(multivariate_d); for (size_t idx = 0; idx < multivariate_d; idx++) { prover_gate_challenges[idx] = prover_transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } + + SumcheckProver sumcheck_prover(multivariate_n, + full_polynomials, + prover_transcript, + prover_alpha, + prover_gate_challenges, + relation_parameters); + SumcheckOutput output; if constexpr (Flavor::HasZK) { ZKData zk_sumcheck_data = ZKData(multivariate_d, prover_transcript); - output = sumcheck_prover.prove( - full_polynomials, relation_parameters, prover_alpha, prover_gate_challenges, zk_sumcheck_data); + output = sumcheck_prover.prove(zk_sumcheck_data); } else { - output = sumcheck_prover.prove(full_polynomials, relation_parameters, prover_alpha, prover_gate_challenges); + output = sumcheck_prover.prove(); } auto verifier_transcript = Flavor::Transcript::verifier_init_empty(prover_transcript); - auto sumcheck_verifier = SumcheckVerifier(verifier_transcript); - RelationSeparator verifier_alpha; - for (size_t idx = 0; idx < verifier_alpha.size(); idx++) { + SubrelationSeparators verifier_alpha{ 1 }; + for (size_t idx = 1; idx < verifier_alpha.size(); idx++) { verifier_alpha[idx] = verifier_transcript->template get_challenge("Sumcheck:alpha_" + std::to_string(idx)); } + auto sumcheck_verifier = SumcheckVerifier(verifier_transcript, verifier_alpha); + std::vector verifier_gate_challenges(multivariate_d); for (size_t idx = 0; idx < multivariate_d; idx++) { verifier_gate_challenges[idx] = @@ -277,8 +287,8 @@ template class SumcheckTests : public ::testing::Test { } std::array padding_indicator_array; std::ranges::fill(padding_indicator_array, FF{ 1 }); - auto verifier_output = sumcheck_verifier.verify( - relation_parameters, verifier_alpha, verifier_gate_challenges, padding_indicator_array); + auto verifier_output = + sumcheck_verifier.verify(relation_parameters, verifier_gate_challenges, padding_indicator_array); auto verified = verifier_output.verified; @@ -334,9 +344,7 @@ template class SumcheckTests : public ::testing::Test { .public_input_delta = FF::one(), }; auto prover_transcript = Flavor::Transcript::prover_init_empty(); - auto sumcheck_prover = SumcheckProver(multivariate_n, prover_transcript); - - RelationSeparator prover_alpha; + SubrelationSeparators prover_alpha; for (size_t idx = 0; idx < prover_alpha.size(); idx++) { prover_alpha[idx] = prover_transcript->template get_challenge("Sumcheck:alpha_" + std::to_string(idx)); } @@ -345,24 +353,32 @@ template class SumcheckTests : public ::testing::Test { prover_gate_challenges[idx] = prover_transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } + + SumcheckProver sumcheck_prover(multivariate_n, + full_polynomials, + prover_transcript, + prover_alpha, + prover_gate_challenges, + relation_parameters); + SumcheckOutput output; if constexpr (Flavor::HasZK) { // construct libra masking polynomials and compute auxiliary data ZKData zk_sumcheck_data = ZKData(multivariate_d, prover_transcript); - output = sumcheck_prover.prove( - full_polynomials, relation_parameters, prover_alpha, prover_gate_challenges, zk_sumcheck_data); + output = sumcheck_prover.prove(zk_sumcheck_data); } else { - output = sumcheck_prover.prove(full_polynomials, relation_parameters, prover_alpha, prover_gate_challenges); + output = sumcheck_prover.prove(); } auto verifier_transcript = Flavor::Transcript::verifier_init_empty(prover_transcript); - auto sumcheck_verifier = SumcheckVerifier(verifier_transcript); - RelationSeparator verifier_alpha; + SubrelationSeparators verifier_alpha; for (size_t idx = 0; idx < verifier_alpha.size(); idx++) { verifier_alpha[idx] = verifier_transcript->template get_challenge("Sumcheck:alpha_" + std::to_string(idx)); } + SumcheckVerifier sumcheck_verifier(verifier_transcript, verifier_alpha); + std::vector verifier_gate_challenges(multivariate_d); for (size_t idx = 0; idx < multivariate_d; idx++) { verifier_gate_challenges[idx] = @@ -371,8 +387,8 @@ template class SumcheckTests : public ::testing::Test { std::array padding_indicator_array; std::ranges::fill(padding_indicator_array, FF{ 1 }); - auto verifier_output = sumcheck_verifier.verify( - relation_parameters, verifier_alpha, verifier_gate_challenges, padding_indicator_array); + auto verifier_output = + sumcheck_verifier.verify(relation_parameters, verifier_gate_challenges, padding_indicator_array); auto verified = verifier_output.verified; diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.hpp index a272d05257ae..9adc2ac0daad 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.hpp @@ -47,7 +47,7 @@ template class SumcheckProverRound { using Utils = bb::RelationUtils; using Relations = typename Flavor::Relations; using SumcheckTupleOfTuplesOfUnivariates = typename Flavor::SumcheckTupleOfTuplesOfUnivariates; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; public: using FF = typename Flavor::FF; @@ -166,7 +166,7 @@ template class SumcheckProverRound { SumcheckRoundUnivariate compute_univariate(ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials, const bb::RelationParameters& relation_parameters, const bb::GateSeparatorPolynomial& gate_separators, - const RelationSeparator alpha) + const SubrelationSeparators& alphas) { PROFILE_THIS_NAME("compute_univariate"); @@ -274,7 +274,7 @@ template class SumcheckProverRound { } // Batch the univariate contributions from each sub-relation to obtain the round univariate - return batch_over_relations(univariate_accumulators, alpha, gate_separators); + return batch_over_relations(univariate_accumulators, alphas, gate_separators); } /** @@ -286,7 +286,7 @@ template class SumcheckProverRound { SumcheckRoundUnivariate compute_hiding_univariate(ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials, const bb::RelationParameters& relation_parameters, const bb::GateSeparatorPolynomial& gate_separators, - const RelationSeparator& alpha, + const SubrelationSeparators& alpha, const ZKData& zk_sumcheck_data, const RowDisablingPolynomial row_disabling_polynomial, const size_t round_idx) @@ -313,7 +313,7 @@ template class SumcheckProverRound { ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials, const bb::RelationParameters& relation_parameters, const bb::GateSeparatorPolynomial& gate_separators, - const RelationSeparator alpha, + const SubrelationSeparators& alphas, const size_t round_idx, const RowDisablingPolynomial row_disabling_polynomial) requires UseRowDisablingPolynomial @@ -332,7 +332,7 @@ template class SumcheckProverRound { relation_parameters, gate_separators[(edge_idx >> 1) * gate_separators.periodicity]); } - result = batch_over_relations(univariate_accumulator, alpha, gate_separators); + result = batch_over_relations(univariate_accumulator, alphas, gate_separators); bb::Univariate row_disabling_factor = bb::Univariate({ row_disabling_polynomial.eval_at_0, row_disabling_polynomial.eval_at_1 }); SumcheckRoundUnivariate row_disabling_factor_extended = @@ -360,11 +360,10 @@ template class SumcheckProverRound { */ template static ExtendedUnivariate batch_over_relations(ContainerOverSubrelations& univariate_accumulators, - const RelationSeparator& challenge, + const SubrelationSeparators& challenge, const bb::GateSeparatorPolynomial& gate_separators) { - auto running_challenge = FF(1); - Utils::scale_univariates(univariate_accumulators, challenge, running_challenge); + Utils::scale_univariates(univariate_accumulators, challenge); auto result = ExtendedUnivariate(0); extend_and_batch_univariates(univariate_accumulators, result, gate_separators); @@ -520,7 +519,7 @@ template class SumcheckVerifierRound { using Utils = bb::RelationUtils; using Relations = typename Flavor::Relations; using TupleOfArraysOfValues = typename Flavor::TupleOfArraysOfValues; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; public: using FF = typename Flavor::FF; @@ -603,7 +602,7 @@ template class SumcheckVerifierRound { FF compute_full_relation_purported_value(const ClaimedEvaluations& purported_evaluations, const bb::RelationParameters& relation_parameters, const bb::GateSeparatorPolynomial& gate_separators, - const RelationSeparator alpha) + const SubrelationSeparators& alphas) { // The verifier should never skip computation of contributions from any relation Utils::template accumulate_relation_evaluations_without_skipping<>(purported_evaluations, @@ -611,10 +610,8 @@ template class SumcheckVerifierRound { relation_parameters, gate_separators.partial_evaluation_result); - FF running_challenge{ 1 }; - FF output{ 0 }; - Utils::scale_and_batch_elements(relation_evaluations, alpha, running_challenge, output); - return output; + return Utils::scale_and_batch_elements(relation_evaluations, alphas); + ; } /** * @brief Temporary method to pad Protogalaxy gate challenges and the gate challenges in diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.test.cpp b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.test.cpp index 8754388e4fce..1c85fec1004b 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.test.cpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck_round.test.cpp @@ -14,7 +14,7 @@ TEST(SumcheckRound, SumcheckTupleOfTuplesOfUnivariates) { using Flavor = UltraFlavor; using FF = typename Flavor::FF; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; // Define three linear univariates of different sizes Univariate univariate_1({ 1, 2, 3 }); @@ -26,11 +26,10 @@ TEST(SumcheckRound, SumcheckTupleOfTuplesOfUnivariates) auto tuple_of_tuples = std::make_tuple(std::make_tuple(univariate_1), std::make_tuple(univariate_2, univariate_3)); // Use scale_univariate_accumulators to scale by challenge powers - RelationSeparator challenge = {}; + SubrelationSeparators challenge = {}; challenge[0] = 5; - challenge[1] = challenge[0].sqr(); - FF running_challenge = 1; - RelationUtils::scale_univariates(tuple_of_tuples, challenge, running_challenge); + challenge[1] = 25; + RelationUtils::scale_univariates(tuple_of_tuples, challenge); // Use extend_and_batch_univariates to extend to MAX_LENGTH then accumulate GateSeparatorPolynomial gate_separators({ 1 }); @@ -38,7 +37,7 @@ TEST(SumcheckRound, SumcheckTupleOfTuplesOfUnivariates) SumcheckProverRound::extend_and_batch_univariates(tuple_of_tuples, result, gate_separators); // Repeat the batching process manually - auto result_expected = univariate_1.template extend_to() * 1 + + auto result_expected = univariate_1.template extend_to() + univariate_2.template extend_to() * challenge[0] + univariate_3.template extend_to() * challenge[1]; @@ -66,25 +65,23 @@ TEST(SumcheckRound, TuplesOfEvaluationArrays) using Flavor = UltraFlavor; using Utils = RelationUtils; using FF = typename Flavor::FF; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; // Define two arrays of arbitrary elements - std::array evaluations_1 = { 4 }; + std::array evaluations_1 = { 4, 3 }; std::array evaluations_2 = { 6, 2 }; // Construct a tuple auto tuple_of_arrays = std::make_tuple(evaluations_1, evaluations_2); // Use scale_and_batch_elements to scale by challenge powers - FF running_challenge = 1; - RelationSeparator challenge = {}; - challenge[0] = 5; - challenge[1] = challenge[0].sqr(); - FF result = 0; - Utils::scale_and_batch_elements(tuple_of_arrays, challenge, running_challenge, result); + SubrelationSeparators challenge{ 5, 25, 125 }; + + FF result = Utils::scale_and_batch_elements(tuple_of_arrays, challenge); // Repeat the batching process manually - auto result_expected = evaluations_1[0] * 1 + evaluations_2[0] * challenge[0] + evaluations_2[1] * challenge[1]; + auto result_expected = evaluations_1[0] + evaluations_1[1] * challenge[0] + evaluations_2[0] * challenge[1] + + evaluations_2[1] * challenge[2]; // Compare batched result EXPECT_EQ(result, result_expected); diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp index 64c20d712cb3..3843e2fb878b 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp @@ -40,7 +40,6 @@ class TranslatorFlavor { using FF = Curve::ScalarField; using BF = Curve::BaseField; using Polynomial = bb::Polynomial; - using RelationSeparator = FF; // indicates when evaluating sumcheck, edges must be extended to be MAX_TOTAL_RELATION_LENGTH static constexpr bool USE_SHORT_MONOMIALS = false; @@ -152,6 +151,9 @@ class TranslatorFlavor { TranslatorZeroConstraintsRelation>; using Relations = Relations_; + static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations(); + using SubrelationSeparators = std::array; + 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(); diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_prover.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_prover.cpp index db07e5103268..a4d33fe2a5e9 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_prover.cpp @@ -133,23 +133,29 @@ void TranslatorProver::execute_relation_check_rounds() { using Sumcheck = SumcheckProver; - Sumcheck sumcheck(key->proving_key->circuit_size, transcript); - FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + // Each linearly independent subrelation contribution is multiplied by `alpha^i`, where + // i = 0, ..., NUM_SUBRELATIONS- 1. + const FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + std::vector gate_challenges(Flavor::CONST_TRANSLATOR_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)); } + const size_t circuit_size = key->proving_key->circuit_size; + + Sumcheck sumcheck( + circuit_size, key->proving_key->polynomials, transcript, alpha, gate_challenges, relation_parameters); + const size_t log_subgroup_size = static_cast(numeric::get_msb(Flavor::Curve::SUBGROUP_SIZE)); - // // Create a temporary commitment key that is only used to initialise the ZKSumcheckData - // // If proving in WASM, the commitment key that is part of the Translator proving key remains deallocated - // // until we enter the PCS round + // Create a temporary commitment key that is only used to initialise the ZKSumcheckData + // If proving in WASM, the commitment key that is part of the Translator proving key remains deallocated + // until we enter the PCS round CommitmentKey ck(1 << (log_subgroup_size + 1)); zk_sumcheck_data = ZKData(key->proving_key->log_circuit_size, transcript, ck); - sumcheck_output = - sumcheck.prove(key->proving_key->polynomials, relation_parameters, alpha, gate_challenges, zk_sumcheck_data); + sumcheck_output = sumcheck.prove(zk_sumcheck_data); } /** diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_verifier.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_verifier.cpp index 192da1faf932..9062f35c500a 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_verifier.cpp @@ -97,9 +97,13 @@ bool TranslatorVerifier::verify_proof(const HonkProof& proof, // Get commitment to permutation and lookup grand products commitments.z_perm = transcript->template receive_from_prover(commitment_labels.z_perm); + // Each linearly independent subrelation contribution is multiplied by `alpha^i`, where + // i = 0, ..., NUM_SUBRELATIONS- 1. + const FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + // Execute Sumcheck Verifier - Sumcheck sumcheck(transcript); - FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + Sumcheck sumcheck(transcript, alpha); + std::vector gate_challenges(Flavor::CONST_TRANSLATOR_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)); @@ -112,7 +116,7 @@ bool TranslatorVerifier::verify_proof(const HonkProof& proof, std::array padding_indicator_array; std::ranges::fill(padding_indicator_array, FF{ 1 }); - auto sumcheck_output = sumcheck.verify(relation_parameters, alpha, gate_challenges, padding_indicator_array); + auto sumcheck_output = sumcheck.verify(relation_parameters, gate_challenges, padding_indicator_array); // If Sumcheck did not verify, return false if (!sumcheck_output.verified) { diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_verifier.hpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_verifier.hpp index a706df037269..a893d6985ed7 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_verifier.hpp @@ -14,14 +14,14 @@ namespace bb { class TranslatorVerifier { public: using Flavor = TranslatorFlavor; - using FF = typename Flavor::FF; - using BF = typename Flavor::BF; - using Commitment = typename Flavor::Commitment; - using ProvingKey = typename Flavor::ProvingKey; - using VerificationKey = typename Flavor::VerificationKey; - using VerifierCommitmentKey = typename Flavor::VerifierCommitmentKey; + using FF = Flavor::FF; + using BF = Flavor::BF; + using Commitment = Flavor::Commitment; + using ProvingKey = Flavor::ProvingKey; + using VerificationKey = Flavor::VerificationKey; + using VerifierCommitmentKey = Flavor::VerifierCommitmentKey; using TranslationEvaluations = bb::TranslationEvaluations_; - using Transcript = typename Flavor::Transcript; + using Transcript = Flavor::Transcript; BF evaluation_input_x = 0; BF batching_challenge_v = 0; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.cpp index 37a678dca605..66c632370bcf 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.cpp @@ -35,7 +35,12 @@ template void DeciderProver_::execute_relatio { using Sumcheck = SumcheckProver; size_t polynomial_size = proving_key->proving_key.circuit_size; - auto sumcheck = Sumcheck(polynomial_size, transcript); + Sumcheck sumcheck(polynomial_size, + proving_key->proving_key.polynomials, + transcript, + proving_key->alphas, + proving_key->gate_challenges, + proving_key->relation_parameters); { PROFILE_THIS_NAME("sumcheck.prove"); @@ -44,17 +49,9 @@ template void DeciderProver_::execute_relatio const size_t log_subgroup_size = static_cast(numeric::get_msb(Curve::SUBGROUP_SIZE)); CommitmentKey commitment_key(1 << (log_subgroup_size + 1)); zk_sumcheck_data = ZKData(numeric::get_msb(polynomial_size), transcript, commitment_key); - sumcheck_output = sumcheck.prove(proving_key->proving_key.polynomials, - proving_key->relation_parameters, - proving_key->alphas, - proving_key->gate_challenges, - zk_sumcheck_data); + sumcheck_output = sumcheck.prove(zk_sumcheck_data); } else { - - sumcheck_output = sumcheck.prove(proving_key->proving_key.polynomials, - proving_key->relation_parameters, - proving_key->alphas, - proving_key->gate_challenges); + sumcheck_output = sumcheck.prove(); } } } diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.hpp index 07d5ccf2aab6..5c29eaa300f6 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.hpp @@ -30,7 +30,6 @@ template class DeciderProver_ { using PCS = typename Flavor::PCS; using DeciderPK = DeciderProvingKey_; using Transcript = typename Flavor::Transcript; - using RelationSeparator = typename Flavor::RelationSeparator; using ZKData = ZKSumcheckData; using SmallSubgroupIPA = SmallSubgroupIPAProver; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp index e464a5c282e0..ecef4400effb 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp @@ -39,7 +39,7 @@ template class DeciderProvingKey_ { using FF = typename Flavor::FF; using ProverPolynomials = typename Flavor::ProverPolynomials; using Polynomial = typename Flavor::Polynomial; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; // Flag indicating whether the polynomials will be constructed with fixed block sizes for each gate type bool is_structured; @@ -50,7 +50,7 @@ template class DeciderProvingKey_ { ProvingKey proving_key; bool is_accumulator = false; - RelationSeparator alphas; // a challenge for each subrelation + SubrelationSeparators alphas; // a challenge for each subrelation bb::RelationParameters relation_parameters; std::vector gate_challenges; // The target sum, which is typically nonzero for a ProtogalaxyProver's accmumulator diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verification_key.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verification_key.hpp index 2a54acdd621b..0bc6fe9dfbef 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verification_key.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verification_key.hpp @@ -24,13 +24,13 @@ template class DeciderVerificationKey_ { using VerifierCommitmentKey = typename Flavor::VerifierCommitmentKey; using WitnessCommitments = typename Flavor::WitnessCommitments; using CommitmentLabels = typename Flavor::CommitmentLabels; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; std::shared_ptr vk; bool is_accumulator = false; std::vector public_inputs; - RelationSeparator alphas; // a challenge for each subrelation + SubrelationSeparators alphas; // a challenge for each subrelation RelationParameters relation_parameters; std::vector gate_challenges; // The target sum, which is typically nonzero for a ProtogalaxyProver's accmumulator diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.cpp index 34657cc863ac..6213d03fecc3 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.cpp @@ -54,14 +54,14 @@ template typename DeciderVerifier_::Output DeciderVeri padding_indicator_array[idx] = (idx < log_circuit_size) ? FF{ 1 } : FF{ 0 }; } - SumcheckVerifier sumcheck(transcript, accumulator->target_sum); + SumcheckVerifier sumcheck(transcript, accumulator->alphas, accumulator->target_sum); // For MegaZKFlavor: receive commitments to Libra masking polynomials std::array libra_commitments = {}; if constexpr (Flavor::HasZK) { libra_commitments[0] = transcript->template receive_from_prover("Libra:concatenation_commitment"); } - SumcheckOutput sumcheck_output = sumcheck.verify( - accumulator->relation_parameters, accumulator->alphas, accumulator->gate_challenges, padding_indicator_array); + SumcheckOutput sumcheck_output = + sumcheck.verify(accumulator->relation_parameters, accumulator->gate_challenges, padding_indicator_array); // For MegaZKFlavor: the sumcheck output contains claimed evaluations of the Libra polynomials if constexpr (Flavor::HasZK) { diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp index 7e90f335f091..5ac90a709d27 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp @@ -235,15 +235,19 @@ template void OinkProver::execute_grand_produ } } -template typename Flavor::RelationSeparator OinkProver::generate_alphas_round() +template typename Flavor::SubrelationSeparators OinkProver::generate_alphas_round() { PROFILE_THIS_NAME("OinkProver::generate_alphas_round"); - RelationSeparator alphas; - std::array args; - for (size_t idx = 0; idx < alphas.size(); ++idx) { - args[idx] = domain_separator + "alpha_" + std::to_string(idx); + + // Get the relation separation challenges for sumcheck/combiner computation + std::array challenge_labels; + + for (size_t idx = 0; idx < Flavor::NUM_SUBRELATIONS - 1; ++idx) { + challenge_labels[idx] = domain_separator + "alpha_" + std::to_string(idx); } - alphas = transcript->template get_challenges(args); + // It is more efficient to generate an array of challenges than to generate them individually. + SubrelationSeparators alphas = transcript->template get_challenges(challenge_labels); + return alphas; } diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.hpp index 337541c2b187..25a2a34f8254 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.hpp @@ -52,7 +52,7 @@ template class OinkProver { ExecutionTraceUsageTracker trace_usage_tracker; typename Flavor::CommitmentLabels commitment_labels; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; OinkProver(std::shared_ptr proving_key, std::shared_ptr honk_vk, @@ -73,7 +73,7 @@ template class OinkProver { void execute_sorted_list_accumulator_round(); void execute_log_derivative_inverse_round(); void execute_grand_product_computation_round(); - RelationSeparator generate_alphas_round(); + SubrelationSeparators generate_alphas_round(); void commit_to_witness_polynomial(Polynomial& polynomial, const std::string& label, const CommitmentKey::CommitType type = CommitmentKey::CommitType::Default); diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.cpp index 9b10552158b4..c0bfb8588526 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.cpp @@ -151,15 +151,18 @@ template void OinkVerifier::execute_grand_pro witness_comms.z_perm = transcript->template receive_from_prover(domain_separator + comm_labels.z_perm); } -template typename Flavor::RelationSeparator OinkVerifier::generate_alphas_round() +template typename Flavor::SubrelationSeparators OinkVerifier::generate_alphas_round() { // Get the relation separation challenges for sumcheck/combiner computation - RelationSeparator alphas; - std::array args; - for (size_t idx = 0; idx < alphas.size(); ++idx) { - args[idx] = domain_separator + "alpha_" + std::to_string(idx); + std::array challenge_labels; + + for (size_t idx = 0; idx < Flavor::NUM_SUBRELATIONS - 1; ++idx) { + challenge_labels[idx] = domain_separator + "alpha_" + std::to_string(idx); } - return transcript->template get_challenges(args); + // It is more efficient to generate an array of challenges than to generate them individually. + SubrelationSeparators alphas = transcript->template get_challenges(challenge_labels); + + return alphas; } template class OinkVerifier; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.hpp index 2f28f91e97a0..b1ac0da72013 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.hpp @@ -25,7 +25,7 @@ template class OinkVerifier { using Transcript = typename Flavor::Transcript; using FF = typename Flavor::FF; using Commitment = typename Flavor::Commitment; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; public: std::shared_ptr transcript; @@ -56,6 +56,6 @@ template class OinkVerifier { void execute_grand_product_computation_round(); - RelationSeparator generate_alphas_round(); + SubrelationSeparators generate_alphas_round(); }; } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp index 0b8d4ef69a22..5fdc8632e024 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp @@ -33,7 +33,7 @@ TEST_F(SumcheckTestsRealCircuit, Ultra) using Flavor = UltraFlavor; using FF = typename Flavor::FF; using Transcript = typename Flavor::Transcript; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; // Create a composer and a dummy circuit with a few gates auto builder = UltraCircuitBuilder(); @@ -157,31 +157,34 @@ TEST_F(SumcheckTestsRealCircuit, Ultra) auto circuit_size = decider_pk->proving_key.circuit_size; auto log_circuit_size = numeric::get_msb(circuit_size); - RelationSeparator prover_alphas; + SubrelationSeparators prover_alphas; for (size_t idx = 0; idx < prover_alphas.size(); idx++) { prover_alphas[idx] = prover_transcript->template get_challenge("Sumcheck:alpha_" + std::to_string(idx)); } - decider_pk->alphas = prover_alphas; - auto sumcheck_prover = SumcheckProver(circuit_size, prover_transcript); std::vector prover_gate_challenges(log_circuit_size); for (size_t idx = 0; idx < log_circuit_size; idx++) { prover_gate_challenges[idx] = prover_transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } decider_pk->gate_challenges = prover_gate_challenges; - auto prover_output = sumcheck_prover.prove(decider_pk->proving_key.polynomials, - decider_pk->relation_parameters, - decider_pk->alphas, - decider_pk->gate_challenges); + + SumcheckProver sumcheck_prover(circuit_size, + decider_pk->proving_key.polynomials, + prover_transcript, + prover_alphas, + prover_gate_challenges, + decider_pk->relation_parameters); + + auto prover_output = sumcheck_prover.prove(); auto verifier_transcript = Transcript::verifier_init_empty(prover_transcript); - auto sumcheck_verifier = SumcheckVerifier(verifier_transcript); - RelationSeparator verifier_alphas; + SubrelationSeparators verifier_alphas; for (size_t idx = 0; idx < verifier_alphas.size(); idx++) { verifier_alphas[idx] = verifier_transcript->template get_challenge("Sumcheck:alpha_" + std::to_string(idx)); } + SumcheckVerifier sumcheck_verifier(verifier_transcript, verifier_alphas); std::vector verifier_gate_challenges(log_circuit_size); for (size_t idx = 0; idx < log_circuit_size; idx++) { @@ -192,8 +195,8 @@ TEST_F(SumcheckTestsRealCircuit, Ultra) for (size_t idx = 0; idx < padding_indicator_array.size(); idx++) { padding_indicator_array[idx] = (idx < log_circuit_size) ? FF{ 1 } : FF{ 0 }; } - auto verifier_output = sumcheck_verifier.verify( - decider_pk->relation_parameters, verifier_alphas, verifier_gate_challenges, padding_indicator_array); + auto verifier_output = + sumcheck_verifier.verify(decider_pk->relation_parameters, verifier_gate_challenges, padding_indicator_array); auto verified = verifier_output.verified; diff --git a/barretenberg/cpp/src/barretenberg/vm2/constraining/flavor.hpp b/barretenberg/cpp/src/barretenberg/vm2/constraining/flavor.hpp index c7293b4e181e..f6b2f3ed3a5c 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/constraining/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/constraining/flavor.hpp @@ -37,7 +37,6 @@ class AvmFlavor { using CommitmentHandle = AvmFlavorSettings::CommitmentHandle; using CommitmentKey = AvmFlavorSettings::CommitmentKey; using VerifierCommitmentKey = AvmFlavorSettings::VerifierCommitmentKey; - using RelationSeparator = AvmFlavorSettings::RelationSeparator; // indicates when evaluating sumcheck, edges must be extended to be MAX_TOTAL_RELATION_LENGTH static constexpr bool USE_SHORT_MONOMIALS = false; @@ -79,6 +78,10 @@ class AvmFlavor { template using Relations_ = tuple_cat_t, LookupRelations_>; using Relations = Relations_; + static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations(); + + using SubrelationSeparators = std::array; + static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length(); static_assert(MAX_PARTIAL_RELATION_LENGTH < 8, "MAX_PARTIAL_RELATION_LENGTH must be less than 8"); diff --git a/barretenberg/cpp/src/barretenberg/vm2/constraining/flavor_settings.hpp b/barretenberg/cpp/src/barretenberg/vm2/constraining/flavor_settings.hpp index 08e602c2b00f..7ec61764b69d 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/constraining/flavor_settings.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/constraining/flavor_settings.hpp @@ -24,7 +24,6 @@ class AvmFlavorSettings { using CommitmentHandle = G1::affine_element; using CommitmentKey = bb::CommitmentKey; using VerifierCommitmentKey = bb::VerifierCommitmentKey; - using RelationSeparator = FF; }; } // namespace bb::avm2 diff --git a/barretenberg/cpp/src/barretenberg/vm2/constraining/prover.cpp b/barretenberg/cpp/src/barretenberg/vm2/constraining/prover.cpp index 5fd2efc9feed..2147ca18d974 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/constraining/prover.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/constraining/prover.cpp @@ -97,15 +97,18 @@ void AvmProver::execute_relation_check_rounds() { using Sumcheck = SumcheckProver; - auto sumcheck = Sumcheck(key->circuit_size, transcript); + // Multiply each linearly independent subrelation contribution by `alpha^i` for i = 0, ..., NUM_SUBRELATIONS - 1. + const FF alpha = transcript->template get_challenge("Sumcheck:alpha"); - FF alpha = transcript->template get_challenge("Sumcheck:alpha"); std::vector gate_challenges(numeric::get_msb(key->circuit_size)); for (size_t idx = 0; idx < gate_challenges.size(); idx++) { gate_challenges[idx] = transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } - sumcheck_output = sumcheck.prove(prover_polynomials, relation_parameters, alpha, gate_challenges); + + Sumcheck sumcheck(key->circuit_size, prover_polynomials, transcript, alpha, gate_challenges, relation_parameters); + + sumcheck_output = sumcheck.prove(); } void AvmProver::execute_pcs_rounds() diff --git a/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_flavor.hpp index c6a41b31d470..14b39fea9565 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_flavor.hpp @@ -38,7 +38,8 @@ class AvmRecursiveFlavor { static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH = NativeFlavor::BATCHED_RELATION_PARTIAL_LENGTH; static constexpr size_t NUM_RELATIONS = std::tuple_size_v; - using RelationSeparator = FF; + static constexpr size_t NUM_SUBRELATIONS = NativeFlavor::NUM_SUBRELATIONS; + using SubrelationSeparators = std::array; // This flavor would not be used with ZK Sumcheck static constexpr bool HasZK = false; diff --git a/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_verifier.cpp index 4b5aafcc7a59..df740000c13b 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_verifier.cpp @@ -117,9 +117,11 @@ AvmRecursiveVerifier::PairingPoints AvmRecursiveVerifier::verify_proof( const size_t log_circuit_size = numeric::get_msb(static_cast(circuit_size.get_value())); const auto padding_indicator_array = stdlib::compute_padding_indicator_array(FF(log_circuit_size)); - auto sumcheck = SumcheckVerifier(transcript); - FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + // Multiply each linearly independent subrelation contribution by `alpha^i` for i = 0, ..., NUM_SUBRELATIONS - 1. + const FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + + SumcheckVerifier sumcheck(transcript, alpha); auto gate_challenges = std::vector(log_circuit_size); for (size_t idx = 0; idx < log_circuit_size; idx++) { @@ -128,8 +130,7 @@ AvmRecursiveVerifier::PairingPoints AvmRecursiveVerifier::verify_proof( // No need to constrain that sumcheck_verified is true as this is guaranteed by the implementation of // when called over a "circuit field" types. - SumcheckOutput output = - sumcheck.verify(relation_parameters, alpha, gate_challenges, padding_indicator_array); + SumcheckOutput output = sumcheck.verify(relation_parameters, gate_challenges, padding_indicator_array); vinfo("verified sumcheck: ", (output.verified)); // Public columns evaluation checks diff --git a/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_verifier.hpp index ab67d4fe9a92..25d396b60c90 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_verifier.hpp @@ -13,7 +13,7 @@ class AvmRecursiveVerifier { using BF = typename Flavor::BF; using Curve = typename Flavor::Curve; using Commitment = typename Flavor::Commitment; - using RelationSeparator = typename Flavor::RelationSeparator; + using SubrelationSeparators = typename Flavor::SubrelationSeparators; using VerificationKey = typename Flavor::VerificationKey; using NativeVerificationKey = typename Flavor::NativeVerificationKey; using Builder = typename Flavor::CircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/vm2/constraining/verifier.cpp b/barretenberg/cpp/src/barretenberg/vm2/constraining/verifier.cpp index f2ae9d2a1f96..21b1bc99ed7e 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/constraining/verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/constraining/verifier.cpp @@ -85,17 +85,18 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vector(transcript); - FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + // Multiply each linearly independent subrelation contribution by `alpha^i` for i = 0, ..., NUM_SUBRELATIONS - 1. + const FF alpha = transcript->template get_challenge("Sumcheck:alpha"); + + SumcheckVerifier sumcheck(transcript, alpha); auto gate_challenges = std::vector(log_circuit_size); for (size_t idx = 0; idx < log_circuit_size; idx++) { gate_challenges[idx] = transcript->template get_challenge("Sumcheck:gate_challenge_" + std::to_string(idx)); } - SumcheckOutput output = - sumcheck.verify(relation_parameters, alpha, gate_challenges, padding_indicator_array); + SumcheckOutput output = sumcheck.verify(relation_parameters, gate_challenges, padding_indicator_array); // If Sumcheck did not verify, return false if (!output.verified) { From f290d557a2f647bbb8349817d4eccd04ebeeadf0 Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Tue, 8 Jul 2025 23:32:30 +0200 Subject: [PATCH 2/3] feat(avm)!: EQ opcode (#15564) --- barretenberg/cpp/pil/vm2/alu.pil | 25 ++- .../vm2/common/instruction_spec.cpp | 9 +- .../vm2/constraining/relations/alu.test.cpp | 197 +++++++++++++++++- .../barretenberg/vm2/generated/columns.hpp | 6 +- .../vm2/generated/flavor_variables.hpp | 4 +- .../vm2/generated/relations/alu.hpp | 26 ++- .../src/barretenberg/vm2/simulation/alu.cpp | 31 ++- .../src/barretenberg/vm2/simulation/alu.hpp | 2 + .../barretenberg/vm2/simulation/alu.test.cpp | 59 ++++++ .../vm2/simulation/events/alu_event.hpp | 5 +- .../barretenberg/vm2/simulation/execution.cpp | 26 ++- .../barretenberg/vm2/simulation/execution.hpp | 1 + .../vm2/simulation/testing/mock_alu.hpp | 1 + .../barretenberg/vm2/tracegen/alu_trace.cpp | 8 + .../vm2/tracegen/alu_trace.test.cpp | 171 +++++++++++++++ .../src/public/avm/opcodes/comparators.ts | 2 +- 16 files changed, 548 insertions(+), 25 deletions(-) diff --git a/barretenberg/cpp/pil/vm2/alu.pil b/barretenberg/cpp/pil/vm2/alu.pil index 9f8cc97920af..1ce1e88c450f 100644 --- a/barretenberg/cpp/pil/vm2/alu.pil +++ b/barretenberg/cpp/pil/vm2/alu.pil @@ -1,4 +1,3 @@ - include "constants_gen.pil"; include "execution.pil"; include "ff_gt.pil"; @@ -10,6 +9,7 @@ pol commit sel; pol commit sel_op_add; pol commit sel_op_lt; +pol commit sel_op_eq; pol commit op_id; pol commit ia; @@ -26,6 +26,10 @@ sel = 0; // carry flag pol commit cf; +// Generic helper column +// Current use: EQ (inverse of a-b) +pol commit helper1; + // maximum bits the number can hold (i.e. 8 for a u8): pol commit max_bits; // maximum value the number can hold (i.e. 255 for a u8), we 'mod' by max_value + 1 @@ -42,7 +46,9 @@ sel_is_ff * (1 - sel_is_ff) = 0; // TODO(MW): Add other ops like: sel_op_add * AVM_EXEC_OP_ID_ALU_ADD + sel_op_sub * AVM_EXEC_OP_ID_ALU_SUB + sel_op_mul * AVM_EXEC_OP_ID_ALU_MUL - op_id = 0; // Note that the op_ids below represent a binary decomposition (see constants_gen.pil): #[OP_ID_CHECK] -sel_op_add * constants.AVM_EXEC_OP_ID_ALU_ADD + sel_op_lt * constants.AVM_EXEC_OP_ID_ALU_LT - op_id = 0; +op_id = sel_op_add * constants.AVM_EXEC_OP_ID_ALU_ADD + + sel_op_lt * constants.AVM_EXEC_OP_ID_ALU_LT + + sel_op_eq * constants.AVM_EXEC_OP_ID_ALU_EQ; #[REGISTER_TAG_VALUE] execution.sel_alu { @@ -68,7 +74,7 @@ CHECK_TAG_FF * (TAG_FF_DIFF * (sel_is_ff * (1 - tag_ff_diff_inv) + tag_ff_diff_i // TAG CHECKING // Will become e.g. sel_op_add * ia_tag + (comparison ops) * MEM_TAG_U1 + .... -pol EXPECTED_C_TAG = sel_op_add * ia_tag + sel_op_lt * constants.MEM_TAG_U1; +pol EXPECTED_C_TAG = sel_op_add * ia_tag + (sel_op_lt + sel_op_eq) * constants.MEM_TAG_U1; // No error handling here since, as a memory write, the type of c is handled by the VM: #[C_TAG_CHECK] @@ -114,3 +120,16 @@ pol commit lt_abs_diff; sel_op_lt * ( IS_NOT_FF * ( (A_LT_B - A_GTE_B) * ic + A_GTE_B ) - lt_abs_diff ) = 0; #[LT_RANGE] sel_op_lt { lt_abs_diff, max_bits } in range_check.sel { range_check.value, range_check.rng_chk_bits }; + + +// EQ + +pol DIFF = ia - ib; + +// Use helper1 to invert DIFF. +// ic is a boolean output and ic == 1 <==> a == b. +// Important: ic boolean constraint is enforced as part of write to memory due to ic_tag == U1 as enforced by #[C_TAG_CHECK]. + +// sel_op_eq == 1 => [ic == 1 <==> DIFF == 0] +#[EQ_OP_MAIN] +sel_op_eq * (DIFF * (ic * (1 - helper1) + helper1) - 1 + ic) = 0; diff --git a/barretenberg/cpp/src/barretenberg/vm2/common/instruction_spec.cpp b/barretenberg/cpp/src/barretenberg/vm2/common/instruction_spec.cpp index aba6d4b6c12e..f046af535fca 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/common/instruction_spec.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/common/instruction_spec.cpp @@ -430,6 +430,13 @@ const std::unordered_map EXEC_INSTRUCTION_ .add_inputs({ /*a*/ RegisterInfo::ANY_TAG, /*b*/ RegisterInfo::ANY_TAG }) .add_output(/*c*/) } }, + { ExecutionOpCode::EQ, + { .num_addresses = 3, + .gas_cost = { .opcode_gas = AVM_EQ_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 }, + .register_info = RegisterInfo() + .add_inputs({ /*a*/ RegisterInfo::ANY_TAG, + /*b*/ RegisterInfo::ANY_TAG }) + .add_output(/*c*/) } }, { ExecutionOpCode::LT, { .num_addresses = 3, .gas_cost = { .opcode_gas = AVM_LT_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 }, @@ -468,7 +475,7 @@ const std::unordered_map EXEC_INSTRUCTION_ .gas_cost = { .opcode_gas = AVM_JUMPI_BASE_L2_GAS, .base_da = 0, .dyn_l2 = 0, .dyn_da = 0 }, .register_info = RegisterInfo().add_input(/*cond*/ ValueTag::U1) } }, { ExecutionOpCode::CALLDATACOPY, - { .num_addresses = 2, + { .num_addresses = 3, .gas_cost = { .opcode_gas = AVM_CALLDATACOPY_BASE_L2_GAS, .base_da = 0, .dyn_l2 = AVM_CALLDATACOPY_DYN_L2_GAS, diff --git a/barretenberg/cpp/src/barretenberg/vm2/constraining/relations/alu.test.cpp b/barretenberg/cpp/src/barretenberg/vm2/constraining/relations/alu.test.cpp index 1ff917decd68..068c6fd6b5d1 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/constraining/relations/alu.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/constraining/relations/alu.test.cpp @@ -34,6 +34,8 @@ using tracegen::FieldGreaterThanTraceBuilder; using tracegen::PrecomputedTraceBuilder; using tracegen::RangeCheckTraceBuilder; +constexpr uint8_t NUM_OF_TAGS = static_cast(MemoryTag::MAX) + 1; + // The below test values do not carry: const std::unordered_map> TEST_VALUES = { { MemoryTag::FF, @@ -110,7 +112,7 @@ auto process_basic_add_trace(MemoryTag input_tag) }, }); // Build just enough clk rows for the lookup - precomputed_builder.process_misc(trace, static_cast(tag) + 1); + precomputed_builder.process_misc(trace, NUM_OF_TAGS); precomputed_builder.process_tag_parameters(trace); return trace; } @@ -148,7 +150,7 @@ auto process_carry_add_trace(MemoryTag input_tag) }, }); // Build just enough clk rows for the lookup - precomputed_builder.process_misc(trace, static_cast(tag) + 1); + precomputed_builder.process_misc(trace, NUM_OF_TAGS); precomputed_builder.process_tag_parameters(trace); return trace; } @@ -199,7 +201,7 @@ TestTraceContainer process_lt_trace(MemoryTag input_tag) range_check_builder.process( { { .value = static_cast(lt_abs_diff), .num_bits = static_cast(max_bits) } }, trace); // Build just enough clk rows for the lookup - precomputed_builder.process_misc(trace, static_cast(tag) + 1); + precomputed_builder.process_misc(trace, NUM_OF_TAGS); precomputed_builder.process_tag_parameters(trace); return trace; } @@ -575,6 +577,193 @@ TEST(AluConstrainingTest, NegativeLTWrongTagCMismatch) EXPECT_THROW_WITH_MESSAGE(check_relation(trace), "C_TAG_CHECK"); } -// ---------------- +// EQ TESTS + +// Generic structure for three-operand opcodes +struct ThreeOperandTestParams { + MemoryValue a; + MemoryValue b; + MemoryValue c; +}; + +auto process_eq_trace(const ThreeOperandTestParams& params, bool error = false) +{ + PrecomputedTraceBuilder precomputed_builder; + + TestTraceContainer trace; + AluTraceBuilder builder; + + builder.process( + { + { .operation = simulation::AluOperation::EQ, + .a = params.a, + .b = params.b, + .c = params.c, + .error = error ? std::make_optional(simulation::AluError::TAG_ERROR) : std::nullopt }, + }, + trace); + + precomputed_builder.process_misc(trace, NUM_OF_TAGS); + precomputed_builder.process_tag_parameters(trace); + return trace; +} + +// Parametrized test for EQ operations with same values and tags +class EQSameValuesAndTagsTest : public ::testing::TestWithParam {}; + +TEST_P(EQSameValuesAndTagsTest, Basic) +{ + const MemoryValue& param = GetParam(); + auto trace = process_eq_trace(ThreeOperandTestParams{ .a = param, .b = param, .c = MemoryValue::from(1) }); + check_all_interactions(trace); + check_relation(trace); +} + +// Test parameters: MemoryValue a +INSTANTIATE_TEST_SUITE_P(AluConstrainingTest, + EQSameValuesAndTagsTest, + ::testing::Values(MemoryValue::from(1), + MemoryValue::from(42), + MemoryValue::from(12345), + MemoryValue::from(123456789), + MemoryValue::from(1234567890123456789ULL), + MemoryValue::from((uint128_t(1) << 127) + 23423429816234ULL), + MemoryValue::from(FF(uint256_t(1) << 255) + 123423429816234ULL))); + +class EQInequalityTest : public ::testing::TestWithParam {}; + +TEST_P(EQInequalityTest, Basic) +{ + auto trace = process_eq_trace(GetParam()); + check_all_interactions(trace); + check_relation(trace); +} + +const std::vector EQ_INEQUALITY_TEST_PARAMS = { + { .a = MemoryValue::from(1), .b = MemoryValue::from(0), .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(42), .b = MemoryValue::from(24), .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(12345), + .b = MemoryValue::from(54321), + .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(123456789), + .b = MemoryValue::from(987654321), + .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(1234567890123456789ULL), + .b = MemoryValue::from(9876543210987654321ULL), + .c = MemoryValue::from(0) }, + { .a = MemoryValue::from((uint128_t(1) << 127) + 23423429816234ULL), + .b = MemoryValue::from((uint128_t(1) << 127) + 9876543210987654321ULL), + .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(FF::modulus - 3), + .b = MemoryValue::from(FF::modulus - 1), + .c = MemoryValue::from(0) } +}; + +// Test parameters for inequality: (MemoryValue a, MemoryValue b) - values are different +INSTANTIATE_TEST_SUITE_P(AluConstrainingTest, EQInequalityTest, ::testing::ValuesIn(EQ_INEQUALITY_TEST_PARAMS)); + +// Parametrized test for EQ operations with different value tags (tag error case) +class EQTagErrorTest : public ::testing::TestWithParam {}; + +TEST_P(EQTagErrorTest, Basic) +{ + auto trace = process_eq_trace(GetParam(), true); + check_all_interactions(trace); + check_relation(trace); +} + +const std::vector EQ_TAG_ERROR_TEST_PARAMS = { + // Equality case + { .a = MemoryValue::from(42), .b = MemoryValue::from(42), .c = MemoryValue::from(1) }, + { .a = MemoryValue::from(123456789), + .b = MemoryValue::from(123456789), + .c = MemoryValue::from(1) }, + { .a = MemoryValue::from(123456789), + .b = MemoryValue::from(123456789), + .c = MemoryValue::from(1) }, + { .a = MemoryValue::from(42), .b = MemoryValue::from(42), .c = MemoryValue::from(1) }, + { .a = MemoryValue::from(1), .b = MemoryValue::from(1), .c = MemoryValue::from(1) }, + { .a = MemoryValue::from(1234567890123456789ULL), + .b = MemoryValue::from(1234567890123456789ULL), + .c = MemoryValue::from(1) }, + // Inequality case + { .a = MemoryValue::from(42), + .b = MemoryValue::from(12345), + .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(123456789), + .b = MemoryValue::from(9876543210987654321ULL), + .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(123456789), + .b = MemoryValue::from(FF::modulus - 42), + .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(42), .b = MemoryValue::from(200), .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(1), .b = MemoryValue::from(255), .c = MemoryValue::from(0) }, + { .a = MemoryValue::from(1234567890123456789ULL), + .b = MemoryValue::from(9876543210987654321ULL), + .c = MemoryValue::from(0) } +}; + +// Test parameters for tag error: (MemoryValue a, MemoryValue b) - different tags +INSTANTIATE_TEST_SUITE_P(AluConstrainingTest, EQTagErrorTest, ::testing::ValuesIn(EQ_TAG_ERROR_TEST_PARAMS)); + +// Negative tests for EQ operations +TEST(AluConstrainingTest, NegativeEQWrongOpId) +{ + auto test_a = MemoryValue::from(42); + auto test_b = MemoryValue::from(42); + auto trace = + process_eq_trace(ThreeOperandTestParams{ .a = test_a, .b = test_b, .c = MemoryValue::from(1) }); + check_relation(trace); + trace.set(Column::alu_op_id, 0, AVM_EXEC_OP_ID_ALU_ADD); + EXPECT_THROW_WITH_MESSAGE(check_relation(trace), "OP_ID_CHECK"); +} + +TEST(AluConstrainingTest, NegativeEQWrongResult) +{ + auto test_a = MemoryValue::from(42); + auto test_b = MemoryValue::from(42); + auto trace = + process_eq_trace(ThreeOperandTestParams{ .a = test_a, .b = test_b, .c = MemoryValue::from(1) }); + check_relation(trace); + trace.set(Column::alu_ic, 0, 0); // Wrong result + EXPECT_THROW_WITH_MESSAGE(check_relation(trace), "EQ_OP_MAIN"); +} + +TEST(AluConstrainingTest, NegativeEQWrongHelper1) +{ + auto test_a = MemoryValue::from(42); + auto test_b = MemoryValue::from(24); + auto trace = + process_eq_trace(ThreeOperandTestParams{ .a = test_a, .b = test_b, .c = MemoryValue::from(0) }); + check_relation(trace); + trace.set(Column::alu_helper1, 0, 1111); // Wrong helper1 for inequality + EXPECT_THROW_WITH_MESSAGE(check_relation(trace), "EQ_OP_MAIN"); +} + +TEST(AluConstrainingTest, NegativeEQWrongTagCMismatch) +{ + auto test_a = MemoryValue::from(12345); + auto test_b = MemoryValue::from(12345); + auto trace = + process_eq_trace(ThreeOperandTestParams{ .a = test_a, .b = test_b, .c = MemoryValue::from(1) }); + check_relation(trace); + trace.set(Column::alu_ic_tag, 0, static_cast(bb::avm2::MemoryTag::U16) - 1); + EXPECT_THROW_WITH_MESSAGE(check_relation(trace), "C_TAG_CHECK"); +} + +TEST(AluConstrainingTest, NegativeEQWrongTagABMismatch) +{ + auto test_a = MemoryValue::from(12345); + auto test_b = MemoryValue::from(12345); + auto trace = + process_eq_trace(ThreeOperandTestParams{ .a = test_a, .b = test_b, .c = MemoryValue::from(1) }); + trace.set(Column::alu_sel_tag_err, 0, 0); // Remove tag error flag + EXPECT_THROW_WITH_MESSAGE(check_relation(trace), "AB_TAGS_CHECK"); + // Correctly using the error, but injecting the wrong inverse will fail: + trace.set(Column::alu_sel_tag_err, 0, 1); + trace.set(Column::alu_ab_tags_diff_inv, 0, 0); + EXPECT_THROW_WITH_MESSAGE(check_relation(trace), "AB_TAGS_CHECK"); +} + } // namespace } // namespace bb::avm2::constraining diff --git a/barretenberg/cpp/src/barretenberg/vm2/generated/columns.hpp b/barretenberg/cpp/src/barretenberg/vm2/generated/columns.hpp index cb3b832b81bd..806fc7695c8b 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/generated/columns.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/generated/columns.hpp @@ -9,7 +9,7 @@ namespace bb::avm2 { // clang-format off #define AVM2_PRECOMPUTED_ENTITIES_E(e) e precomputed_addressing_gas, e precomputed_bitwise_input_a, e precomputed_bitwise_input_b, e precomputed_bitwise_op_id, e precomputed_bitwise_output, e precomputed_clk, e precomputed_envvar_pi_row_idx, e precomputed_exec_opcode, e precomputed_exec_opcode_base_da_gas, e precomputed_exec_opcode_dynamic_da_gas, e precomputed_exec_opcode_dynamic_l2_gas, e precomputed_exec_opcode_opcode_gas, e precomputed_expected_tag_reg_0_, e precomputed_expected_tag_reg_1_, e precomputed_expected_tag_reg_2_, e precomputed_expected_tag_reg_3_, e precomputed_expected_tag_reg_4_, e precomputed_expected_tag_reg_5_, e precomputed_expected_tag_reg_6_, e precomputed_first_row, e precomputed_instr_size, e precomputed_invalid_envvar_enum, e precomputed_is_address, e precomputed_is_dagasleft, e precomputed_is_feeperl2gas, e precomputed_is_isstaticcall, e precomputed_is_l2_l1_message_phase, e precomputed_is_l2gasleft, e precomputed_is_public_call_request_phase, e precomputed_is_revertible, e precomputed_is_sender, e precomputed_is_transactionfee, e precomputed_keccak_round_constant, e precomputed_next_phase_on_revert, e precomputed_opcode_out_of_range, e precomputed_out_tag, e precomputed_p_decomposition_limb, e precomputed_p_decomposition_limb_index, e precomputed_p_decomposition_radix, e precomputed_phase_value, e precomputed_power_of_2, e precomputed_read_public_input_length_offset, e precomputed_read_public_input_offset, e precomputed_rw_reg_0_, e precomputed_rw_reg_1_, e precomputed_rw_reg_2_, e precomputed_rw_reg_3_, e precomputed_rw_reg_4_, e precomputed_rw_reg_5_, e precomputed_rw_reg_6_, e precomputed_sel_addressing_gas, e precomputed_sel_bitwise, e precomputed_sel_collect_fee, e precomputed_sel_dispatch_alu, e precomputed_sel_dispatch_bitwise, e precomputed_sel_dispatch_data_copy, e precomputed_sel_dispatch_ecc, e precomputed_sel_dispatch_execution, e precomputed_sel_dispatch_keccakf1600, e precomputed_sel_dispatch_poseidon_perm, e precomputed_sel_dispatch_to_radix, e precomputed_sel_envvar_pi_lookup_col0, e precomputed_sel_envvar_pi_lookup_col1, e precomputed_sel_exec_spec, e precomputed_sel_has_tag, e precomputed_sel_keccak, e precomputed_sel_mem_op_reg_0_, e precomputed_sel_mem_op_reg_1_, e precomputed_sel_mem_op_reg_2_, e precomputed_sel_mem_op_reg_3_, e precomputed_sel_mem_op_reg_4_, e precomputed_sel_mem_op_reg_5_, e precomputed_sel_mem_op_reg_6_, e precomputed_sel_mem_tag_out_of_range, e precomputed_sel_non_revertible_append_note_hash, e precomputed_sel_non_revertible_append_nullifier, e precomputed_sel_op_dc_0, e precomputed_sel_op_dc_1, e precomputed_sel_op_dc_10, e precomputed_sel_op_dc_11, e precomputed_sel_op_dc_12, e precomputed_sel_op_dc_13, e precomputed_sel_op_dc_14, e precomputed_sel_op_dc_15, e precomputed_sel_op_dc_16, e precomputed_sel_op_dc_17, e precomputed_sel_op_dc_2, e precomputed_sel_op_dc_3, e precomputed_sel_op_dc_4, e precomputed_sel_op_dc_5, e precomputed_sel_op_dc_6, e precomputed_sel_op_dc_7, e precomputed_sel_op_dc_8, e precomputed_sel_op_dc_9, e precomputed_sel_op_is_address_0_, e precomputed_sel_op_is_address_1_, e precomputed_sel_op_is_address_2_, e precomputed_sel_op_is_address_3_, e precomputed_sel_op_is_address_4_, e precomputed_sel_op_is_address_5_, e precomputed_sel_op_is_address_6_, e precomputed_sel_p_decomposition, e precomputed_sel_phase, e precomputed_sel_range_16, e precomputed_sel_range_8, e precomputed_sel_revertible_append_note_hash, e precomputed_sel_revertible_append_nullifier, e precomputed_sel_sha256_compression, e precomputed_sel_tag_check_reg_0_, e precomputed_sel_tag_check_reg_1_, e precomputed_sel_tag_check_reg_2_, e precomputed_sel_tag_check_reg_3_, e precomputed_sel_tag_check_reg_4_, e precomputed_sel_tag_check_reg_5_, e precomputed_sel_tag_check_reg_6_, e precomputed_sel_tag_is_op2, e precomputed_sel_tag_parameters, e precomputed_sel_to_radix_safe_limbs, e precomputed_sha256_compression_round_constant, e precomputed_subtrace_operation_id, e precomputed_tag_byte_length, e precomputed_tag_max_bits, e precomputed_tag_max_value, e precomputed_to_radix_safe_limbs, e precomputed_write_public_input_offset, e precomputed_zero, e public_inputs_sel -#define AVM2_WIRE_ENTITIES_E(e) e public_inputs_cols_0_, e public_inputs_cols_1_, e public_inputs_cols_2_, e public_inputs_cols_3_, e address_derivation_address, e address_derivation_address_y, e address_derivation_class_id, e address_derivation_deployer_addr, e address_derivation_g1_x, e address_derivation_g1_y, e address_derivation_incoming_viewing_key_x, e address_derivation_incoming_viewing_key_y, e address_derivation_init_hash, e address_derivation_nullifier_key_x, e address_derivation_nullifier_key_y, e address_derivation_outgoing_viewing_key_x, e address_derivation_outgoing_viewing_key_y, e address_derivation_partial_address, e address_derivation_partial_address_domain_separator, e address_derivation_preaddress, e address_derivation_preaddress_domain_separator, e address_derivation_preaddress_public_key_x, e address_derivation_preaddress_public_key_y, e address_derivation_public_keys_hash, e address_derivation_public_keys_hash_domain_separator, e address_derivation_salt, e address_derivation_salted_init_hash, e address_derivation_sel, e address_derivation_tagging_key_x, e address_derivation_tagging_key_y, e alu_ab_tags_diff_inv, e alu_cf, e alu_ia, e alu_ia_tag, e alu_ib, e alu_ib_tag, e alu_ic, e alu_ic_tag, e alu_lt_abs_diff, e alu_max_bits, e alu_max_value, e alu_op_id, e alu_sel, e alu_sel_ff_lt, e alu_sel_is_ff, e alu_sel_op_add, e alu_sel_op_lt, e alu_sel_tag_err, e alu_tag_ff_diff_inv, e bc_decomposition_abs_diff, e bc_decomposition_bytes, e bc_decomposition_bytes_pc_plus_1, e bc_decomposition_bytes_pc_plus_10, e bc_decomposition_bytes_pc_plus_11, e bc_decomposition_bytes_pc_plus_12, e bc_decomposition_bytes_pc_plus_13, e bc_decomposition_bytes_pc_plus_14, e bc_decomposition_bytes_pc_plus_15, e bc_decomposition_bytes_pc_plus_16, e bc_decomposition_bytes_pc_plus_17, e bc_decomposition_bytes_pc_plus_18, e bc_decomposition_bytes_pc_plus_19, e bc_decomposition_bytes_pc_plus_2, e bc_decomposition_bytes_pc_plus_20, e bc_decomposition_bytes_pc_plus_21, e bc_decomposition_bytes_pc_plus_22, e bc_decomposition_bytes_pc_plus_23, e bc_decomposition_bytes_pc_plus_24, e bc_decomposition_bytes_pc_plus_25, e bc_decomposition_bytes_pc_plus_26, e bc_decomposition_bytes_pc_plus_27, e bc_decomposition_bytes_pc_plus_28, e bc_decomposition_bytes_pc_plus_29, e bc_decomposition_bytes_pc_plus_3, e bc_decomposition_bytes_pc_plus_30, e bc_decomposition_bytes_pc_plus_31, e bc_decomposition_bytes_pc_plus_32, e bc_decomposition_bytes_pc_plus_33, e bc_decomposition_bytes_pc_plus_34, e bc_decomposition_bytes_pc_plus_35, e bc_decomposition_bytes_pc_plus_36, e bc_decomposition_bytes_pc_plus_4, e bc_decomposition_bytes_pc_plus_5, e bc_decomposition_bytes_pc_plus_6, e bc_decomposition_bytes_pc_plus_7, e bc_decomposition_bytes_pc_plus_8, e bc_decomposition_bytes_pc_plus_9, e bc_decomposition_bytes_rem_inv, e bc_decomposition_bytes_rem_min_one_inv, e bc_decomposition_bytes_remaining, e bc_decomposition_bytes_to_read, e bc_decomposition_id, e bc_decomposition_last_of_contract, e bc_decomposition_packed_field, e bc_decomposition_pc, e bc_decomposition_sel, e bc_decomposition_sel_overflow_correction_needed, e bc_decomposition_sel_packed, e bc_hashing_bytecode_id, e bc_hashing_incremental_hash, e bc_hashing_latch, e bc_hashing_output_hash, e bc_hashing_packed_field, e bc_hashing_pc_index, e bc_hashing_sel, e bc_hashing_start, e bc_retrieval_address, e bc_retrieval_artifact_hash, e bc_retrieval_bytecode_id, e bc_retrieval_current_class_id, e bc_retrieval_deployer_addr, e bc_retrieval_deployer_protocol_contract_address, e bc_retrieval_error, e bc_retrieval_incoming_viewing_key_x, e bc_retrieval_incoming_viewing_key_y, e bc_retrieval_init_hash, e bc_retrieval_nullifier_exists, e bc_retrieval_nullifier_key_x, e bc_retrieval_nullifier_key_y, e bc_retrieval_nullifier_tree_root, e bc_retrieval_original_class_id, e bc_retrieval_outgoing_viewing_key_x, e bc_retrieval_outgoing_viewing_key_y, e bc_retrieval_private_function_root, e bc_retrieval_public_bytecode_commitment, e bc_retrieval_public_data_tree_root, e bc_retrieval_salt, e bc_retrieval_sel, e bc_retrieval_tagging_key_x, e bc_retrieval_tagging_key_y, e bc_retrieval_timestamp, e bitwise_acc_ia, e bitwise_acc_ib, e bitwise_acc_ic, e bitwise_ctr, e bitwise_ctr_inv, e bitwise_ctr_min_one_inv, e bitwise_err, e bitwise_ia_byte, e bitwise_ib_byte, e bitwise_ic_byte, e bitwise_last, e bitwise_op_id, e bitwise_sel, e bitwise_sel_get_ctr, e bitwise_sel_tag_ff_err, e bitwise_sel_tag_mismatch_err, e bitwise_start, e bitwise_tag_a, e bitwise_tag_a_inv, e bitwise_tag_ab_diff_inv, e bitwise_tag_b, e bitwise_tag_c, e calldata_context_id, e calldata_index, e calldata_latch, e calldata_sel, e calldata_value, e cd_hashing_context_id, e cd_hashing_input_0_, e cd_hashing_input_1_, e cd_hashing_input_2_, e cd_hashing_latch, e cd_hashing_length_remaining, e cd_hashing_output_hash, e cd_hashing_sel, e class_id_derivation_artifact_hash, e class_id_derivation_class_id, e class_id_derivation_private_function_root, e class_id_derivation_public_bytecode_commitment, e class_id_derivation_sel, e class_id_derivation_temp_constant_for_lookup, e context_stack_context_id, e context_stack_context_id_inv, e context_stack_contract_address, e context_stack_entered_context_id, e context_stack_is_static, e context_stack_msg_sender, e context_stack_next_pc, e context_stack_parent_calldata_addr, e context_stack_parent_calldata_size, e context_stack_parent_da_gas_limit, e context_stack_parent_da_gas_used, e context_stack_parent_id, e context_stack_parent_l2_gas_limit, e context_stack_parent_l2_gas_used, e context_stack_sel, e data_copy_abs_diff_max_read_index, e data_copy_abs_max_read_offset, e data_copy_abs_read_diff, e data_copy_abs_write_diff, e data_copy_cd_copy_col_read, e data_copy_clk, e data_copy_copy_size, e data_copy_dst_addr, e data_copy_dst_context_id, e data_copy_dst_out_of_range_err, e data_copy_err, e data_copy_is_top_level, e data_copy_offset, e data_copy_operation_id, e data_copy_padding, e data_copy_parent_id_inv, e data_copy_read_addr, e data_copy_reads_left, e data_copy_reads_left_inv, e data_copy_sel_cd_copy, e data_copy_sel_end, e data_copy_sel_mem_read, e data_copy_sel_mem_write, e data_copy_sel_offset_gt_max_read, e data_copy_sel_rd_copy, e data_copy_sel_start, e data_copy_sel_start_no_err, e data_copy_src_addr, e data_copy_src_context_id, e data_copy_src_data_size, e data_copy_src_data_size_is_lt, e data_copy_src_out_of_range_err, e data_copy_thirty_two, e data_copy_value, e data_copy_write_count_minus_one_inv, e ecc_add_op, e ecc_double_op, e ecc_inv_2_p_y, e ecc_inv_x_diff, e ecc_inv_y_diff, e ecc_lambda, e ecc_p_is_inf, e ecc_p_x, e ecc_p_y, e ecc_q_is_inf, e ecc_q_x, e ecc_q_y, e ecc_r_is_inf, e ecc_r_x, e ecc_r_y, e ecc_result_infinity, e ecc_sel, e ecc_use_computed_result, e ecc_x_match, e ecc_y_match, e execution_addressing_error_collection_inv, e execution_addressing_gas, e execution_base_address_tag, e execution_base_address_tag_diff_inv, e execution_base_address_val, e execution_base_da_gas, e execution_batched_tags_diff_inv, e execution_batched_tags_diff_inv_reg, e execution_bytecode_id, e execution_call_allocated_left_da_cmp_diff, e execution_call_allocated_left_l2_cmp_diff, e execution_call_is_da_gas_allocated_lt_left, e execution_call_is_l2_gas_allocated_lt_left, e execution_constant_32, e execution_constant_64, e execution_context_id, e execution_contract_address, e execution_da_gas_limit, e execution_da_gas_used, e execution_discard, e execution_dying_context_diff_inv, e execution_dying_context_id, e execution_dying_context_id_inv, e execution_dynamic_da_gas, e execution_dynamic_da_gas_factor, e execution_dynamic_l2_gas, e execution_dynamic_l2_gas_factor, e execution_enqueued_call_end, e execution_enqueued_call_start, e execution_envvar_pi_row_idx, e execution_ex_opcode, e execution_expected_tag_reg_0_, e execution_expected_tag_reg_1_, e execution_expected_tag_reg_2_, e execution_expected_tag_reg_3_, e execution_expected_tag_reg_4_, e execution_expected_tag_reg_5_, e execution_expected_tag_reg_6_, e execution_has_parent_ctx, e execution_indirect, e execution_instr_length, e execution_internal_call_id, e execution_internal_call_return_id, e execution_internal_call_return_id_inv, e execution_is_address, e execution_is_dagasleft, e execution_is_dying_context, e execution_is_isstaticcall, e execution_is_l2gasleft, e execution_is_parent_id_inv, e execution_is_sender, e execution_is_static, e execution_is_transactionfee, e execution_l1_l2_tree_root, e execution_l1_l2_tree_size, e execution_l2_gas_limit, e execution_l2_gas_used, e execution_last, e execution_last_child_returndata_addr, e execution_last_child_returndata_size, e execution_last_child_success, e execution_limit_used_da_cmp_diff, e execution_limit_used_l2_cmp_diff, e execution_mem_tag_reg_0_, e execution_mem_tag_reg_1_, e execution_mem_tag_reg_2_, e execution_mem_tag_reg_3_, e execution_mem_tag_reg_4_, e execution_mem_tag_reg_5_, e execution_mem_tag_reg_6_, e execution_msg_sender, e execution_nested_call_from_undiscarded_context, e execution_nested_exit_call, e execution_nested_return, e execution_next_context_id, e execution_next_internal_call_id, e execution_next_pc, e execution_note_hash_tree_root, e execution_note_hash_tree_size, e execution_nullifier_tree_root, e execution_nullifier_tree_size, e execution_num_note_hashes_emitted, e execution_num_nullifiers_emitted, e execution_num_pub_data_writes_emitted, e execution_num_relative_operands_inv, e execution_op_0_, e execution_op_1_, e execution_op_2_, e execution_op_3_, e execution_op_4_, e execution_op_5_, e execution_op_6_, e execution_op_after_relative_0_, e execution_op_after_relative_1_, e execution_op_after_relative_2_, e execution_op_after_relative_3_, e execution_op_after_relative_4_, e execution_op_after_relative_5_, e execution_op_after_relative_6_, e execution_opcode_gas, e execution_out_of_gas_da, e execution_out_of_gas_l2, e execution_overflow_range_check_result_0_, e execution_overflow_range_check_result_1_, e execution_overflow_range_check_result_2_, e execution_overflow_range_check_result_3_, e execution_overflow_range_check_result_4_, e execution_overflow_range_check_result_5_, e execution_overflow_range_check_result_6_, e execution_parent_calldata_addr, e execution_parent_calldata_size, e execution_parent_da_gas_limit, e execution_parent_da_gas_used, e execution_parent_id, e execution_parent_l2_gas_limit, e execution_parent_l2_gas_used, e execution_pc, e execution_prev_da_gas_used, e execution_prev_l1_l2_tree_root, e execution_prev_l1_l2_tree_size, e execution_prev_l2_gas_used, e execution_prev_note_hash_tree_root, e execution_prev_note_hash_tree_size, e execution_prev_nullifier_tree_root, e execution_prev_nullifier_tree_size, e execution_prev_num_note_hashes_emitted, e execution_prev_num_nullifiers_emitted, e execution_prev_num_pub_data_writes_emitted, e execution_prev_public_data_tree_root, e execution_prev_public_data_tree_size, e execution_propagate_discard, e execution_public_data_tree_root, e execution_public_data_tree_size, e execution_register_0_, e execution_register_1_, e execution_register_2_, e execution_register_3_, e execution_register_4_, e execution_register_5_, e execution_register_6_, e execution_resolves_dying_context, e execution_rollback_context, e execution_rop_0_, e execution_rop_1_, e execution_rop_2_, e execution_rop_3_, e execution_rop_4_, e execution_rop_5_, e execution_rop_6_, e execution_rop_tag_0_, e execution_rop_tag_1_, e execution_rop_tag_2_, e execution_rop_tag_3_, e execution_rop_tag_4_, e execution_rop_tag_5_, e execution_rop_tag_6_, e execution_rw_reg_0_, e execution_rw_reg_1_, e execution_rw_reg_2_, e execution_rw_reg_3_, e execution_rw_reg_4_, e execution_rw_reg_5_, e execution_rw_reg_6_, e execution_sel, e execution_sel_addressing_error, e execution_sel_alu, e execution_sel_base_address_failure, e execution_sel_bitwise, e execution_sel_bytecode_retrieval_failure, e execution_sel_bytecode_retrieval_success, e execution_sel_call, e execution_sel_data_copy, e execution_sel_debug_log, e execution_sel_do_base_check, e execution_sel_ecc_add, e execution_sel_enter_call, e execution_sel_envvar_pi_lookup_col0, e execution_sel_envvar_pi_lookup_col1, e execution_sel_error, e execution_sel_execution, e execution_sel_exit_call, e execution_sel_failure, e execution_sel_get_env_var, e execution_sel_instruction_fetching_failure, e execution_sel_instruction_fetching_success, e execution_sel_internal_call, e execution_sel_internal_return, e execution_sel_jump, e execution_sel_jumpi, e execution_sel_keccakf1600, e execution_sel_mem_op_reg_0_, e execution_sel_mem_op_reg_1_, e execution_sel_mem_op_reg_2_, e execution_sel_mem_op_reg_3_, e execution_sel_mem_op_reg_4_, e execution_sel_mem_op_reg_5_, e execution_sel_mem_op_reg_6_, e execution_sel_mov, e execution_sel_op_is_address_0_, e execution_sel_op_is_address_1_, e execution_sel_op_is_address_2_, e execution_sel_op_is_address_3_, e execution_sel_op_is_address_4_, e execution_sel_op_is_address_5_, e execution_sel_op_is_address_6_, e execution_sel_op_is_indirect_wire_0_, e execution_sel_op_is_indirect_wire_1_, e execution_sel_op_is_indirect_wire_2_, e execution_sel_op_is_indirect_wire_3_, e execution_sel_op_is_indirect_wire_4_, e execution_sel_op_is_indirect_wire_5_, e execution_sel_op_is_indirect_wire_6_, e execution_sel_op_is_indirect_wire_7_, e execution_sel_op_is_relative_effective_0_, e execution_sel_op_is_relative_effective_1_, e execution_sel_op_is_relative_effective_2_, e execution_sel_op_is_relative_effective_3_, e execution_sel_op_is_relative_effective_4_, e execution_sel_op_is_relative_effective_5_, e execution_sel_op_is_relative_effective_6_, e execution_sel_op_is_relative_wire_0_, e execution_sel_op_is_relative_wire_1_, e execution_sel_op_is_relative_wire_2_, e execution_sel_op_is_relative_wire_3_, e execution_sel_op_is_relative_wire_4_, e execution_sel_op_is_relative_wire_5_, e execution_sel_op_is_relative_wire_6_, e execution_sel_op_is_relative_wire_7_, e execution_sel_op_reg_effective_0_, e execution_sel_op_reg_effective_1_, e execution_sel_op_reg_effective_2_, e execution_sel_op_reg_effective_3_, e execution_sel_op_reg_effective_4_, e execution_sel_op_reg_effective_5_, e execution_sel_op_reg_effective_6_, e execution_sel_opcode_error, e execution_sel_opcode_failure, e execution_sel_out_of_gas, e execution_sel_poseidon2_perm, e execution_sel_register_read_error, e execution_sel_relative_overflow_0_, e execution_sel_relative_overflow_1_, e execution_sel_relative_overflow_2_, e execution_sel_relative_overflow_3_, e execution_sel_relative_overflow_4_, e execution_sel_relative_overflow_5_, e execution_sel_relative_overflow_6_, e execution_sel_return, e execution_sel_returndata_size, e execution_sel_revert, e execution_sel_set, e execution_sel_should_apply_indirection_0_, e execution_sel_should_apply_indirection_1_, e execution_sel_should_apply_indirection_2_, e execution_sel_should_apply_indirection_3_, e execution_sel_should_apply_indirection_4_, e execution_sel_should_apply_indirection_5_, e execution_sel_should_apply_indirection_6_, e execution_sel_should_check_gas, e execution_sel_should_execute_opcode, e execution_sel_should_get_env_var, e execution_sel_should_read_registers, e execution_sel_should_write_registers, e execution_sel_some_final_check_failed, e execution_sel_static_call, e execution_sel_success_copy, e execution_sel_tag_check_reg_0_, e execution_sel_tag_check_reg_1_, e execution_sel_tag_check_reg_2_, e execution_sel_tag_check_reg_3_, e execution_sel_tag_check_reg_4_, e execution_sel_tag_check_reg_5_, e execution_sel_tag_check_reg_6_, e execution_sel_to_radix, e execution_subtrace_operation_id, e execution_transaction_fee, e execution_two_to_32, e execution_value_from_pi, e ff_gt_a, e ff_gt_a_hi, e ff_gt_a_lo, e ff_gt_b, e ff_gt_b_hi, e ff_gt_b_lo, e ff_gt_borrow, e ff_gt_cmp_rng_ctr, e ff_gt_cmp_rng_ctr_inv, e ff_gt_constant_128, e ff_gt_p_a_borrow, e ff_gt_p_b_borrow, e ff_gt_p_sub_a_hi, e ff_gt_p_sub_a_lo, e ff_gt_p_sub_b_hi, e ff_gt_p_sub_b_lo, e ff_gt_res_hi, e ff_gt_res_lo, e ff_gt_result, e ff_gt_sel, e ff_gt_sel_gt, e ff_gt_sel_shift_rng, e instr_fetching_bd0, e instr_fetching_bd1, e instr_fetching_bd10, e instr_fetching_bd11, e instr_fetching_bd12, e instr_fetching_bd13, e instr_fetching_bd14, e instr_fetching_bd15, e instr_fetching_bd16, e instr_fetching_bd17, e instr_fetching_bd18, e instr_fetching_bd19, e instr_fetching_bd2, e instr_fetching_bd20, e instr_fetching_bd21, e instr_fetching_bd22, e instr_fetching_bd23, e instr_fetching_bd24, e instr_fetching_bd25, e instr_fetching_bd26, e instr_fetching_bd27, e instr_fetching_bd28, e instr_fetching_bd29, e instr_fetching_bd3, e instr_fetching_bd30, e instr_fetching_bd31, e instr_fetching_bd32, e instr_fetching_bd33, e instr_fetching_bd34, e instr_fetching_bd35, e instr_fetching_bd36, e instr_fetching_bd4, e instr_fetching_bd5, e instr_fetching_bd6, e instr_fetching_bd7, e instr_fetching_bd8, e instr_fetching_bd9, e instr_fetching_bytecode_id, e instr_fetching_bytecode_size, e instr_fetching_bytes_to_read, e instr_fetching_exec_opcode, e instr_fetching_indirect, e instr_fetching_instr_abs_diff, e instr_fetching_instr_out_of_range, e instr_fetching_instr_size, e instr_fetching_op1, e instr_fetching_op2, e instr_fetching_op3, e instr_fetching_op4, e instr_fetching_op5, e instr_fetching_op6, e instr_fetching_op7, e instr_fetching_opcode_out_of_range, e instr_fetching_pc, e instr_fetching_pc_abs_diff, e instr_fetching_pc_out_of_range, e instr_fetching_pc_size_in_bits, e instr_fetching_sel, e instr_fetching_sel_has_tag, e instr_fetching_sel_op_dc_0, e instr_fetching_sel_op_dc_1, e instr_fetching_sel_op_dc_10, e instr_fetching_sel_op_dc_11, e instr_fetching_sel_op_dc_12, e instr_fetching_sel_op_dc_13, e instr_fetching_sel_op_dc_14, e instr_fetching_sel_op_dc_15, e instr_fetching_sel_op_dc_16, e instr_fetching_sel_op_dc_2, e instr_fetching_sel_op_dc_3, e instr_fetching_sel_op_dc_4, e instr_fetching_sel_op_dc_5, e instr_fetching_sel_op_dc_6, e instr_fetching_sel_op_dc_7, e instr_fetching_sel_op_dc_8, e instr_fetching_sel_op_dc_9, e instr_fetching_sel_parsing_err, e instr_fetching_sel_pc_in_range, e instr_fetching_sel_tag_is_op2, e instr_fetching_tag_out_of_range, e instr_fetching_tag_value, e internal_call_stack_context_id, e internal_call_stack_entered_call_id, e internal_call_stack_id, e internal_call_stack_return_id, e internal_call_stack_return_pc, e internal_call_stack_sel, e keccak_memory_addr, e keccak_memory_clk, e keccak_memory_ctr, e keccak_memory_ctr_end, e keccak_memory_ctr_inv, e keccak_memory_ctr_min_state_size_inv, e keccak_memory_last, e keccak_memory_num_rounds, e keccak_memory_rw, e keccak_memory_sel, e keccak_memory_single_tag_error, e keccak_memory_space_id, e keccak_memory_start_read, e keccak_memory_start_write, e keccak_memory_tag, e keccak_memory_tag_error, e keccak_memory_tag_min_u64_inv, e keccak_memory_val00, e keccak_memory_val01, e keccak_memory_val02, e keccak_memory_val03, e keccak_memory_val04, e keccak_memory_val10, e keccak_memory_val11, e keccak_memory_val12, e keccak_memory_val13, e keccak_memory_val14, e keccak_memory_val20, e keccak_memory_val21, e keccak_memory_val22, e keccak_memory_val23, e keccak_memory_val24, e keccak_memory_val30, e keccak_memory_val31, e keccak_memory_val32, e keccak_memory_val33, e keccak_memory_val34, e keccak_memory_val40, e keccak_memory_val41, e keccak_memory_val42, e keccak_memory_val43, e keccak_memory_val44, e keccakf1600_bitwise_and_op_id, e keccakf1600_bitwise_xor_op_id, e keccakf1600_clk, e keccakf1600_dst_abs_diff, e keccakf1600_dst_addr, e keccakf1600_dst_out_of_range_error, e keccakf1600_error, e keccakf1600_last, e keccakf1600_rot_64_min_len_01, e keccakf1600_rot_64_min_len_03, e keccakf1600_rot_64_min_len_11, e keccakf1600_rot_64_min_len_13, e keccakf1600_rot_64_min_len_20, e keccakf1600_rot_64_min_len_22, e keccakf1600_rot_64_min_len_24, e keccakf1600_rot_64_min_len_31, e keccakf1600_rot_64_min_len_34, e keccakf1600_rot_64_min_len_42, e keccakf1600_rot_len_02, e keccakf1600_rot_len_04, e keccakf1600_rot_len_10, e keccakf1600_rot_len_12, e keccakf1600_rot_len_14, e keccakf1600_rot_len_21, e keccakf1600_rot_len_23, e keccakf1600_rot_len_30, e keccakf1600_rot_len_32, e keccakf1600_rot_len_33, e keccakf1600_rot_len_40, e keccakf1600_rot_len_41, e keccakf1600_rot_len_43, e keccakf1600_rot_len_44, e keccakf1600_round, e keccakf1600_round_cst, e keccakf1600_round_inv, e keccakf1600_sel, e keccakf1600_sel_no_error, e keccakf1600_sel_slice_read, e keccakf1600_sel_slice_write, e keccakf1600_space_id, e keccakf1600_src_abs_diff, e keccakf1600_src_addr, e keccakf1600_src_out_of_range_error, e keccakf1600_start, e keccakf1600_state_chi_00, e keccakf1600_state_chi_01, e keccakf1600_state_chi_02, e keccakf1600_state_chi_03, e keccakf1600_state_chi_04, e keccakf1600_state_chi_10, e keccakf1600_state_chi_11, e keccakf1600_state_chi_12, e keccakf1600_state_chi_13, e keccakf1600_state_chi_14, e keccakf1600_state_chi_20, e keccakf1600_state_chi_21, e keccakf1600_state_chi_22, e keccakf1600_state_chi_23, e keccakf1600_state_chi_24, e keccakf1600_state_chi_30, e keccakf1600_state_chi_31, e keccakf1600_state_chi_32, e keccakf1600_state_chi_33, e keccakf1600_state_chi_34, e keccakf1600_state_chi_40, e keccakf1600_state_chi_41, e keccakf1600_state_chi_42, e keccakf1600_state_chi_43, e keccakf1600_state_chi_44, e keccakf1600_state_in_00, e keccakf1600_state_in_01, e keccakf1600_state_in_02, e keccakf1600_state_in_03, e keccakf1600_state_in_04, e keccakf1600_state_in_10, e keccakf1600_state_in_11, e keccakf1600_state_in_12, e keccakf1600_state_in_13, e keccakf1600_state_in_14, e keccakf1600_state_in_20, e keccakf1600_state_in_21, e keccakf1600_state_in_22, e keccakf1600_state_in_23, e keccakf1600_state_in_24, e keccakf1600_state_in_30, e keccakf1600_state_in_31, e keccakf1600_state_in_32, e keccakf1600_state_in_33, e keccakf1600_state_in_34, e keccakf1600_state_in_40, e keccakf1600_state_in_41, e keccakf1600_state_in_42, e keccakf1600_state_in_43, e keccakf1600_state_in_44, e keccakf1600_state_iota_00, e keccakf1600_state_pi_and_00, e keccakf1600_state_pi_and_01, e keccakf1600_state_pi_and_02, e keccakf1600_state_pi_and_03, e keccakf1600_state_pi_and_04, e keccakf1600_state_pi_and_10, e keccakf1600_state_pi_and_11, e keccakf1600_state_pi_and_12, e keccakf1600_state_pi_and_13, e keccakf1600_state_pi_and_14, e keccakf1600_state_pi_and_20, e keccakf1600_state_pi_and_21, e keccakf1600_state_pi_and_22, e keccakf1600_state_pi_and_23, e keccakf1600_state_pi_and_24, e keccakf1600_state_pi_and_30, e keccakf1600_state_pi_and_31, e keccakf1600_state_pi_and_32, e keccakf1600_state_pi_and_33, e keccakf1600_state_pi_and_34, e keccakf1600_state_pi_and_40, e keccakf1600_state_pi_and_41, e keccakf1600_state_pi_and_42, e keccakf1600_state_pi_and_43, e keccakf1600_state_pi_and_44, e keccakf1600_state_pi_not_00, e keccakf1600_state_pi_not_01, e keccakf1600_state_pi_not_02, e keccakf1600_state_pi_not_03, e keccakf1600_state_pi_not_04, e keccakf1600_state_pi_not_10, e keccakf1600_state_pi_not_11, e keccakf1600_state_pi_not_12, e keccakf1600_state_pi_not_13, e keccakf1600_state_pi_not_14, e keccakf1600_state_pi_not_20, e keccakf1600_state_pi_not_21, e keccakf1600_state_pi_not_22, e keccakf1600_state_pi_not_23, e keccakf1600_state_pi_not_24, e keccakf1600_state_pi_not_30, e keccakf1600_state_pi_not_31, e keccakf1600_state_pi_not_32, e keccakf1600_state_pi_not_33, e keccakf1600_state_pi_not_34, e keccakf1600_state_pi_not_40, e keccakf1600_state_pi_not_41, e keccakf1600_state_pi_not_42, e keccakf1600_state_pi_not_43, e keccakf1600_state_pi_not_44, e keccakf1600_state_rho_01, e keccakf1600_state_rho_02, e keccakf1600_state_rho_03, e keccakf1600_state_rho_04, e keccakf1600_state_rho_10, e keccakf1600_state_rho_11, e keccakf1600_state_rho_12, e keccakf1600_state_rho_13, e keccakf1600_state_rho_14, e keccakf1600_state_rho_20, e keccakf1600_state_rho_21, e keccakf1600_state_rho_22, e keccakf1600_state_rho_23, e keccakf1600_state_rho_24, e keccakf1600_state_rho_30, e keccakf1600_state_rho_31, e keccakf1600_state_rho_32, e keccakf1600_state_rho_33, e keccakf1600_state_rho_34, e keccakf1600_state_rho_40, e keccakf1600_state_rho_41, e keccakf1600_state_rho_42, e keccakf1600_state_rho_43, e keccakf1600_state_rho_44, e keccakf1600_state_theta_00, e keccakf1600_state_theta_01, e keccakf1600_state_theta_02, e keccakf1600_state_theta_03, e keccakf1600_state_theta_04, e keccakf1600_state_theta_10, e keccakf1600_state_theta_11, e keccakf1600_state_theta_12, e keccakf1600_state_theta_13, e keccakf1600_state_theta_14, e keccakf1600_state_theta_20, e keccakf1600_state_theta_21, e keccakf1600_state_theta_22, e keccakf1600_state_theta_23, e keccakf1600_state_theta_24, e keccakf1600_state_theta_30, e keccakf1600_state_theta_31, e keccakf1600_state_theta_32, e keccakf1600_state_theta_33, e keccakf1600_state_theta_34, e keccakf1600_state_theta_40, e keccakf1600_state_theta_41, e keccakf1600_state_theta_42, e keccakf1600_state_theta_43, e keccakf1600_state_theta_44, e keccakf1600_state_theta_hi_01, e keccakf1600_state_theta_hi_02, e keccakf1600_state_theta_hi_03, e keccakf1600_state_theta_hi_04, e keccakf1600_state_theta_hi_10, e keccakf1600_state_theta_hi_11, e keccakf1600_state_theta_hi_12, e keccakf1600_state_theta_hi_13, e keccakf1600_state_theta_hi_14, e keccakf1600_state_theta_hi_20, e keccakf1600_state_theta_hi_21, e keccakf1600_state_theta_hi_22, e keccakf1600_state_theta_hi_23, e keccakf1600_state_theta_hi_24, e keccakf1600_state_theta_hi_30, e keccakf1600_state_theta_hi_31, e keccakf1600_state_theta_hi_32, e keccakf1600_state_theta_hi_33, e keccakf1600_state_theta_hi_34, e keccakf1600_state_theta_hi_40, e keccakf1600_state_theta_hi_41, e keccakf1600_state_theta_hi_42, e keccakf1600_state_theta_hi_43, e keccakf1600_state_theta_hi_44, e keccakf1600_state_theta_low_01, e keccakf1600_state_theta_low_02, e keccakf1600_state_theta_low_03, e keccakf1600_state_theta_low_04, e keccakf1600_state_theta_low_10, e keccakf1600_state_theta_low_11, e keccakf1600_state_theta_low_12, e keccakf1600_state_theta_low_13, e keccakf1600_state_theta_low_14, e keccakf1600_state_theta_low_20, e keccakf1600_state_theta_low_21, e keccakf1600_state_theta_low_22, e keccakf1600_state_theta_low_23, e keccakf1600_state_theta_low_24, e keccakf1600_state_theta_low_30, e keccakf1600_state_theta_low_31, e keccakf1600_state_theta_low_32, e keccakf1600_state_theta_low_33, e keccakf1600_state_theta_low_34, e keccakf1600_state_theta_low_40, e keccakf1600_state_theta_low_41, e keccakf1600_state_theta_low_42, e keccakf1600_state_theta_low_43, e keccakf1600_state_theta_low_44, e keccakf1600_tag_error, e keccakf1600_theta_combined_xor_0, e keccakf1600_theta_combined_xor_1, e keccakf1600_theta_combined_xor_2, e keccakf1600_theta_combined_xor_3, e keccakf1600_theta_combined_xor_4, e keccakf1600_theta_xor_01, e keccakf1600_theta_xor_02, e keccakf1600_theta_xor_03, e keccakf1600_theta_xor_11, e keccakf1600_theta_xor_12, e keccakf1600_theta_xor_13, e keccakf1600_theta_xor_21, e keccakf1600_theta_xor_22, e keccakf1600_theta_xor_23, e keccakf1600_theta_xor_31, e keccakf1600_theta_xor_32, e keccakf1600_theta_xor_33, e keccakf1600_theta_xor_41, e keccakf1600_theta_xor_42, e keccakf1600_theta_xor_43, e keccakf1600_theta_xor_row_0, e keccakf1600_theta_xor_row_1, e keccakf1600_theta_xor_row_2, e keccakf1600_theta_xor_row_3, e keccakf1600_theta_xor_row_4, e keccakf1600_theta_xor_row_low63_0, e keccakf1600_theta_xor_row_low63_1, e keccakf1600_theta_xor_row_low63_2, e keccakf1600_theta_xor_row_low63_3, e keccakf1600_theta_xor_row_low63_4, e keccakf1600_theta_xor_row_msb_0, e keccakf1600_theta_xor_row_msb_1, e keccakf1600_theta_xor_row_msb_2, e keccakf1600_theta_xor_row_msb_3, e keccakf1600_theta_xor_row_msb_4, e keccakf1600_theta_xor_row_rotl1_0, e keccakf1600_theta_xor_row_rotl1_1, e keccakf1600_theta_xor_row_rotl1_2, e keccakf1600_theta_xor_row_rotl1_3, e keccakf1600_theta_xor_row_rotl1_4, e keccakf1600_thirty_two, e memory_address, e memory_clk, e memory_rw, e memory_sel, e memory_space_id, e memory_tag, e memory_value, e merkle_check_constant_2, e merkle_check_end, e merkle_check_index, e merkle_check_index_is_even, e merkle_check_path_len, e merkle_check_read_left_node, e merkle_check_read_node, e merkle_check_read_output_hash, e merkle_check_read_right_node, e merkle_check_read_root, e merkle_check_remaining_path_len_inv, e merkle_check_sel, e merkle_check_sibling, e merkle_check_start, e merkle_check_write, e merkle_check_write_left_node, e merkle_check_write_node, e merkle_check_write_output_hash, e merkle_check_write_right_node, e merkle_check_write_root, e note_hash_tree_check_address, e note_hash_tree_check_discard, e note_hash_tree_check_first_nullifier, e note_hash_tree_check_first_nullifier_pi_index, e note_hash_tree_check_leaf_index, e note_hash_tree_check_next_leaf_value, e note_hash_tree_check_next_root, e note_hash_tree_check_nonce, e note_hash_tree_check_nonce_separator, e note_hash_tree_check_note_hash, e note_hash_tree_check_note_hash_index, e note_hash_tree_check_note_hash_tree_height, e note_hash_tree_check_prev_leaf_value, e note_hash_tree_check_prev_root, e note_hash_tree_check_public_inputs_index, e note_hash_tree_check_sel, e note_hash_tree_check_should_silo, e note_hash_tree_check_should_unique, e note_hash_tree_check_should_write_to_public_inputs, e note_hash_tree_check_siloed_note_hash, e note_hash_tree_check_siloing_separator, e note_hash_tree_check_unique_note_hash, e note_hash_tree_check_unique_note_hash_separator, e note_hash_tree_check_write, e nullifier_check_address, e nullifier_check_discard, e nullifier_check_exists, e nullifier_check_intermediate_root, e nullifier_check_leaf_not_exists, e nullifier_check_low_leaf_hash, e nullifier_check_low_leaf_index, e nullifier_check_low_leaf_next_index, e nullifier_check_low_leaf_next_nullifier, e nullifier_check_low_leaf_nullifier, e nullifier_check_new_leaf_hash, e nullifier_check_next_nullifier_inv, e nullifier_check_next_nullifier_is_nonzero, e nullifier_check_nullifier, e nullifier_check_nullifier_index, e nullifier_check_nullifier_low_leaf_nullifier_diff_inv, e nullifier_check_public_inputs_index, e nullifier_check_root, e nullifier_check_sel, e nullifier_check_should_insert, e nullifier_check_should_silo, e nullifier_check_should_write_to_public_inputs, e nullifier_check_siloed_nullifier, e nullifier_check_siloing_separator, e nullifier_check_tree_height, e nullifier_check_tree_size_before_write, e nullifier_check_updated_low_leaf_hash, e nullifier_check_updated_low_leaf_next_index, e nullifier_check_updated_low_leaf_next_nullifier, e nullifier_check_write, e nullifier_check_write_root, e poseidon2_hash_a_0, e poseidon2_hash_a_1, e poseidon2_hash_a_2, e poseidon2_hash_a_3, e poseidon2_hash_b_0, e poseidon2_hash_b_1, e poseidon2_hash_b_2, e poseidon2_hash_b_3, e poseidon2_hash_end, e poseidon2_hash_input_0, e poseidon2_hash_input_1, e poseidon2_hash_input_2, e poseidon2_hash_input_len, e poseidon2_hash_num_perm_rounds_rem, e poseidon2_hash_num_perm_rounds_rem_inv, e poseidon2_hash_output, e poseidon2_hash_padding, e poseidon2_hash_sel, e poseidon2_hash_start, e poseidon2_perm_B_10_0, e poseidon2_perm_B_10_1, e poseidon2_perm_B_10_2, e poseidon2_perm_B_10_3, e poseidon2_perm_B_11_0, e poseidon2_perm_B_11_1, e poseidon2_perm_B_11_2, e poseidon2_perm_B_11_3, e poseidon2_perm_B_12_0, e poseidon2_perm_B_12_1, e poseidon2_perm_B_12_2, e poseidon2_perm_B_12_3, e poseidon2_perm_B_13_0, e poseidon2_perm_B_13_1, e poseidon2_perm_B_13_2, e poseidon2_perm_B_13_3, e poseidon2_perm_B_14_0, e poseidon2_perm_B_14_1, e poseidon2_perm_B_14_2, e poseidon2_perm_B_14_3, e poseidon2_perm_B_15_0, e poseidon2_perm_B_15_1, e poseidon2_perm_B_15_2, e poseidon2_perm_B_15_3, e poseidon2_perm_B_16_0, e poseidon2_perm_B_16_1, e poseidon2_perm_B_16_2, e poseidon2_perm_B_16_3, e poseidon2_perm_B_17_0, e poseidon2_perm_B_17_1, e poseidon2_perm_B_17_2, e poseidon2_perm_B_17_3, e poseidon2_perm_B_18_0, e poseidon2_perm_B_18_1, e poseidon2_perm_B_18_2, e poseidon2_perm_B_18_3, e poseidon2_perm_B_19_0, e poseidon2_perm_B_19_1, e poseidon2_perm_B_19_2, e poseidon2_perm_B_19_3, e poseidon2_perm_B_20_0, e poseidon2_perm_B_20_1, e poseidon2_perm_B_20_2, e poseidon2_perm_B_20_3, e poseidon2_perm_B_21_0, e poseidon2_perm_B_21_1, e poseidon2_perm_B_21_2, e poseidon2_perm_B_21_3, e poseidon2_perm_B_22_0, e poseidon2_perm_B_22_1, e poseidon2_perm_B_22_2, e poseidon2_perm_B_22_3, e poseidon2_perm_B_23_0, e poseidon2_perm_B_23_1, e poseidon2_perm_B_23_2, e poseidon2_perm_B_23_3, e poseidon2_perm_B_24_0, e poseidon2_perm_B_24_1, e poseidon2_perm_B_24_2, e poseidon2_perm_B_24_3, e poseidon2_perm_B_25_0, e poseidon2_perm_B_25_1, e poseidon2_perm_B_25_2, e poseidon2_perm_B_25_3, e poseidon2_perm_B_26_0, e poseidon2_perm_B_26_1, e poseidon2_perm_B_26_2, e poseidon2_perm_B_26_3, e poseidon2_perm_B_27_0, e poseidon2_perm_B_27_1, e poseidon2_perm_B_27_2, e poseidon2_perm_B_27_3, e poseidon2_perm_B_28_0, e poseidon2_perm_B_28_1, e poseidon2_perm_B_28_2, e poseidon2_perm_B_28_3, e poseidon2_perm_B_29_0, e poseidon2_perm_B_29_1, e poseidon2_perm_B_29_2, e poseidon2_perm_B_29_3, e poseidon2_perm_B_30_0, e poseidon2_perm_B_30_1, e poseidon2_perm_B_30_2, e poseidon2_perm_B_30_3, e poseidon2_perm_B_31_0, e poseidon2_perm_B_31_1, e poseidon2_perm_B_31_2, e poseidon2_perm_B_31_3, e poseidon2_perm_B_32_0, e poseidon2_perm_B_32_1, e poseidon2_perm_B_32_2, e poseidon2_perm_B_32_3, e poseidon2_perm_B_33_0, e poseidon2_perm_B_33_1, e poseidon2_perm_B_33_2, e poseidon2_perm_B_33_3, e poseidon2_perm_B_34_0, e poseidon2_perm_B_34_1, e poseidon2_perm_B_34_2, e poseidon2_perm_B_34_3, e poseidon2_perm_B_35_0, e poseidon2_perm_B_35_1, e poseidon2_perm_B_35_2, e poseidon2_perm_B_35_3, e poseidon2_perm_B_36_0, e poseidon2_perm_B_36_1, e poseidon2_perm_B_36_2, e poseidon2_perm_B_36_3, e poseidon2_perm_B_37_0, e poseidon2_perm_B_37_1, e poseidon2_perm_B_37_2, e poseidon2_perm_B_37_3, e poseidon2_perm_B_38_0, e poseidon2_perm_B_38_1, e poseidon2_perm_B_38_2, e poseidon2_perm_B_38_3, e poseidon2_perm_B_39_0, e poseidon2_perm_B_39_1, e poseidon2_perm_B_39_2, e poseidon2_perm_B_39_3, e poseidon2_perm_B_40_0, e poseidon2_perm_B_40_1, e poseidon2_perm_B_40_2, e poseidon2_perm_B_40_3, e poseidon2_perm_B_41_0, e poseidon2_perm_B_41_1, e poseidon2_perm_B_41_2, e poseidon2_perm_B_41_3, e poseidon2_perm_B_42_0, e poseidon2_perm_B_42_1, e poseidon2_perm_B_42_2, e poseidon2_perm_B_42_3, e poseidon2_perm_B_43_0, e poseidon2_perm_B_43_1, e poseidon2_perm_B_43_2, e poseidon2_perm_B_43_3, e poseidon2_perm_B_44_0, e poseidon2_perm_B_44_1, e poseidon2_perm_B_44_2, e poseidon2_perm_B_44_3, e poseidon2_perm_B_45_0, e poseidon2_perm_B_45_1, e poseidon2_perm_B_45_2, e poseidon2_perm_B_45_3, e poseidon2_perm_B_46_0, e poseidon2_perm_B_46_1, e poseidon2_perm_B_46_2, e poseidon2_perm_B_46_3, e poseidon2_perm_B_47_0, e poseidon2_perm_B_47_1, e poseidon2_perm_B_47_2, e poseidon2_perm_B_47_3, e poseidon2_perm_B_48_0, e poseidon2_perm_B_48_1, e poseidon2_perm_B_48_2, e poseidon2_perm_B_48_3, e poseidon2_perm_B_49_0, e poseidon2_perm_B_49_1, e poseidon2_perm_B_49_2, e poseidon2_perm_B_49_3, e poseidon2_perm_B_4_0, e poseidon2_perm_B_4_1, e poseidon2_perm_B_4_2, e poseidon2_perm_B_4_3, e poseidon2_perm_B_50_0, e poseidon2_perm_B_50_1, e poseidon2_perm_B_50_2, e poseidon2_perm_B_50_3, e poseidon2_perm_B_51_0, e poseidon2_perm_B_51_1, e poseidon2_perm_B_51_2, e poseidon2_perm_B_51_3, e poseidon2_perm_B_52_0, e poseidon2_perm_B_52_1, e poseidon2_perm_B_52_2, e poseidon2_perm_B_52_3, e poseidon2_perm_B_53_0, e poseidon2_perm_B_53_1, e poseidon2_perm_B_53_2, e poseidon2_perm_B_53_3, e poseidon2_perm_B_54_0, e poseidon2_perm_B_54_1, e poseidon2_perm_B_54_2, e poseidon2_perm_B_54_3, e poseidon2_perm_B_55_0, e poseidon2_perm_B_55_1, e poseidon2_perm_B_55_2, e poseidon2_perm_B_55_3, e poseidon2_perm_B_56_0, e poseidon2_perm_B_56_1, e poseidon2_perm_B_56_2, e poseidon2_perm_B_56_3, e poseidon2_perm_B_57_0, e poseidon2_perm_B_57_1, e poseidon2_perm_B_57_2, e poseidon2_perm_B_57_3, e poseidon2_perm_B_58_0, e poseidon2_perm_B_58_1, e poseidon2_perm_B_58_2, e poseidon2_perm_B_58_3, e poseidon2_perm_B_59_0, e poseidon2_perm_B_59_1, e poseidon2_perm_B_59_2, e poseidon2_perm_B_59_3, e poseidon2_perm_B_5_0, e poseidon2_perm_B_5_1, e poseidon2_perm_B_5_2, e poseidon2_perm_B_5_3, e poseidon2_perm_B_6_0, e poseidon2_perm_B_6_1, e poseidon2_perm_B_6_2, e poseidon2_perm_B_6_3, e poseidon2_perm_B_7_0, e poseidon2_perm_B_7_1, e poseidon2_perm_B_7_2, e poseidon2_perm_B_7_3, e poseidon2_perm_B_8_0, e poseidon2_perm_B_8_1, e poseidon2_perm_B_8_2, e poseidon2_perm_B_8_3, e poseidon2_perm_B_9_0, e poseidon2_perm_B_9_1, e poseidon2_perm_B_9_2, e poseidon2_perm_B_9_3, e poseidon2_perm_EXT_LAYER_4, e poseidon2_perm_EXT_LAYER_5, e poseidon2_perm_EXT_LAYER_6, e poseidon2_perm_EXT_LAYER_7, e poseidon2_perm_T_0_4, e poseidon2_perm_T_0_5, e poseidon2_perm_T_0_6, e poseidon2_perm_T_0_7, e poseidon2_perm_T_1_4, e poseidon2_perm_T_1_5, e poseidon2_perm_T_1_6, e poseidon2_perm_T_1_7, e poseidon2_perm_T_2_4, e poseidon2_perm_T_2_5, e poseidon2_perm_T_2_6, e poseidon2_perm_T_2_7, e poseidon2_perm_T_3_4, e poseidon2_perm_T_3_5, e poseidon2_perm_T_3_6, e poseidon2_perm_T_3_7, e poseidon2_perm_T_60_4, e poseidon2_perm_T_60_5, e poseidon2_perm_T_60_6, e poseidon2_perm_T_60_7, e poseidon2_perm_T_61_4, e poseidon2_perm_T_61_5, e poseidon2_perm_T_61_6, e poseidon2_perm_T_61_7, e poseidon2_perm_T_62_4, e poseidon2_perm_T_62_5, e poseidon2_perm_T_62_6, e poseidon2_perm_T_62_7, e poseidon2_perm_T_63_4, e poseidon2_perm_T_63_5, e poseidon2_perm_T_63_6, e poseidon2_perm_T_63_7, e poseidon2_perm_a_0, e poseidon2_perm_a_1, e poseidon2_perm_a_2, e poseidon2_perm_a_3, e poseidon2_perm_b_0, e poseidon2_perm_b_1, e poseidon2_perm_b_2, e poseidon2_perm_b_3, e poseidon2_perm_sel, e public_data_check_address, e public_data_check_clk, e public_data_check_clk_diff, e public_data_check_constant_32, e public_data_check_discard, e public_data_check_intermediate_root, e public_data_check_leaf_not_exists, e public_data_check_leaf_slot, e public_data_check_leaf_slot_low_leaf_slot_diff_inv, e public_data_check_low_leaf_hash, e public_data_check_low_leaf_index, e public_data_check_low_leaf_next_index, e public_data_check_low_leaf_next_slot, e public_data_check_low_leaf_slot, e public_data_check_low_leaf_value, e public_data_check_new_leaf_hash, e public_data_check_next_slot_inv, e public_data_check_next_slot_is_nonzero, e public_data_check_nondiscaded_write, e public_data_check_not_end, e public_data_check_root, e public_data_check_sel, e public_data_check_should_insert, e public_data_check_should_write_to_public_inputs, e public_data_check_siloing_separator, e public_data_check_slot, e public_data_check_tree_height, e public_data_check_tree_size_after_write, e public_data_check_tree_size_before_write, e public_data_check_updated_low_leaf_hash, e public_data_check_updated_low_leaf_next_index, e public_data_check_updated_low_leaf_next_slot, e public_data_check_updated_low_leaf_value, e public_data_check_value, e public_data_check_write, e public_data_check_write_idx, e public_data_check_write_root, e public_data_squash_check_clock, e public_data_squash_clk, e public_data_squash_clk_diff, e public_data_squash_constant_32, e public_data_squash_leaf_slot, e public_data_squash_leaf_slot_increase, e public_data_squash_sel, e public_data_squash_write_to_public_inputs, e range_check_dyn_diff, e range_check_dyn_rng_chk_bits, e range_check_dyn_rng_chk_pow_2, e range_check_is_lte_u112, e range_check_is_lte_u128, e range_check_is_lte_u16, e range_check_is_lte_u32, e range_check_is_lte_u48, e range_check_is_lte_u64, e range_check_is_lte_u80, e range_check_is_lte_u96, e range_check_rng_chk_bits, e range_check_sel, e range_check_sel_r0_16_bit_rng_lookup, e range_check_sel_r1_16_bit_rng_lookup, e range_check_sel_r2_16_bit_rng_lookup, e range_check_sel_r3_16_bit_rng_lookup, e range_check_sel_r4_16_bit_rng_lookup, e range_check_sel_r5_16_bit_rng_lookup, e range_check_sel_r6_16_bit_rng_lookup, e range_check_u16_r0, e range_check_u16_r1, e range_check_u16_r2, e range_check_u16_r3, e range_check_u16_r4, e range_check_u16_r5, e range_check_u16_r6, e range_check_u16_r7, e range_check_value, e scalar_mul_bit, e scalar_mul_bit_idx, e scalar_mul_bit_radix, e scalar_mul_end, e scalar_mul_not_end, e scalar_mul_point_inf, e scalar_mul_point_x, e scalar_mul_point_y, e scalar_mul_res_inf, e scalar_mul_res_x, e scalar_mul_res_y, e scalar_mul_scalar, e scalar_mul_sel, e scalar_mul_should_add, e scalar_mul_start, e scalar_mul_temp_inf, e scalar_mul_temp_x, e scalar_mul_temp_y, e sha256_a, e sha256_a_and_b, e sha256_a_and_b_xor_a_and_c, e sha256_a_and_c, e sha256_a_rotr_13, e sha256_a_rotr_2, e sha256_a_rotr_22, e sha256_a_rotr_2_xor_a_rotr_13, e sha256_and_sel, e sha256_b, e sha256_b_and_c, e sha256_c, e sha256_ch, e sha256_clk, e sha256_computed_w_lhs, e sha256_computed_w_rhs, e sha256_d, e sha256_e, e sha256_e_and_f, e sha256_e_rotr_11, e sha256_e_rotr_25, e sha256_e_rotr_6, e sha256_e_rotr_6_xor_e_rotr_11, e sha256_f, e sha256_g, e sha256_h, e sha256_helper_w0, e sha256_helper_w1, e sha256_helper_w10, e sha256_helper_w11, e sha256_helper_w12, e sha256_helper_w13, e sha256_helper_w14, e sha256_helper_w15, e sha256_helper_w2, e sha256_helper_w3, e sha256_helper_w4, e sha256_helper_w5, e sha256_helper_w6, e sha256_helper_w7, e sha256_helper_w8, e sha256_helper_w9, e sha256_init_a, e sha256_init_b, e sha256_init_c, e sha256_init_d, e sha256_init_e, e sha256_init_f, e sha256_init_g, e sha256_init_h, e sha256_input_offset, e sha256_is_input_round, e sha256_latch, e sha256_lhs_a_13, e sha256_lhs_a_2, e sha256_lhs_a_22, e sha256_lhs_e_11, e sha256_lhs_e_25, e sha256_lhs_e_6, e sha256_lhs_w_10, e sha256_lhs_w_17, e sha256_lhs_w_18, e sha256_lhs_w_19, e sha256_lhs_w_3, e sha256_lhs_w_7, e sha256_maj, e sha256_next_a_lhs, e sha256_next_a_rhs, e sha256_next_e_lhs, e sha256_next_e_rhs, e sha256_not_e, e sha256_not_e_and_g, e sha256_output_a_lhs, e sha256_output_a_rhs, e sha256_output_b_lhs, e sha256_output_b_rhs, e sha256_output_c_lhs, e sha256_output_c_rhs, e sha256_output_d_lhs, e sha256_output_d_rhs, e sha256_output_e_lhs, e sha256_output_e_rhs, e sha256_output_f_lhs, e sha256_output_f_rhs, e sha256_output_g_lhs, e sha256_output_g_rhs, e sha256_output_h_lhs, e sha256_output_h_rhs, e sha256_output_offset, e sha256_perform_round, e sha256_rhs_a_13, e sha256_rhs_a_2, e sha256_rhs_a_22, e sha256_rhs_e_11, e sha256_rhs_e_25, e sha256_rhs_e_6, e sha256_rhs_w_10, e sha256_rhs_w_17, e sha256_rhs_w_18, e sha256_rhs_w_19, e sha256_rhs_w_3, e sha256_rhs_w_7, e sha256_round_constant, e sha256_round_count, e sha256_rounds_remaining, e sha256_rounds_remaining_inv, e sha256_s_0, e sha256_s_1, e sha256_sel, e sha256_start, e sha256_state_offset, e sha256_w, e sha256_w_15_rotr_18, e sha256_w_15_rotr_7, e sha256_w_15_rotr_7_xor_w_15_rotr_18, e sha256_w_15_rshift_3, e sha256_w_2_rotr_17, e sha256_w_2_rotr_17_xor_w_2_rotr_19, e sha256_w_2_rotr_19, e sha256_w_2_rshift_10, e sha256_w_s_0, e sha256_w_s_1, e sha256_xor_sel, e to_radix_acc, e to_radix_acc_under_p, e to_radix_end, e to_radix_exponent, e to_radix_found, e to_radix_is_unsafe_limb, e to_radix_limb, e to_radix_limb_eq_p, e to_radix_limb_index, e to_radix_limb_lt_p, e to_radix_limb_p_diff, e to_radix_limb_radix_diff, e to_radix_not_end, e to_radix_not_padding_limb, e to_radix_p_limb, e to_radix_radix, e to_radix_rem_inverse, e to_radix_safe_limbs, e to_radix_safety_diff_inverse, e to_radix_sel, e to_radix_start, e to_radix_value, e tx_calldata_hash, e tx_context_id, e tx_contract_addr, e tx_da_gas_limit, e tx_discard, e tx_effective_fee_per_da_gas, e tx_effective_fee_per_l2_gas, e tx_end_gas_used_pi_offset, e tx_end_phase, e tx_fee, e tx_fee_juice_balance_slot, e tx_fee_juice_balances_slot, e tx_fee_juice_contract_address, e tx_fee_payer, e tx_fee_payer_balance, e tx_fee_payer_new_balance, e tx_fee_payer_pi_offset, e tx_is_collect_fee, e tx_is_l2_l1_msg_phase, e tx_is_padded, e tx_is_public_call_request, e tx_is_revertible, e tx_is_static, e tx_is_teardown_phase, e tx_is_tree_insert_phase, e tx_l2_gas_limit, e tx_l2_l1_msg_content, e tx_l2_l1_msg_contract_address, e tx_l2_l1_msg_recipient, e tx_leaf_value, e tx_msg_sender, e tx_next_context_id, e tx_next_da_gas_used, e tx_next_da_gas_used_sent_to_enqueued_call, e tx_next_l1_l2_tree_root, e tx_next_l1_l2_tree_size, e tx_next_l2_gas_used, e tx_next_l2_gas_used_sent_to_enqueued_call, e tx_next_note_hash_tree_root, e tx_next_note_hash_tree_size, e tx_next_nullifier_tree_root, e tx_next_nullifier_tree_size, e tx_next_num_note_hashes_emitted, e tx_next_num_nullifiers_emitted, e tx_next_num_pub_data_writes_emitted, e tx_next_public_data_tree_root, e tx_next_public_data_tree_size, e tx_num_l2_l1_msg_emitted, e tx_phase_value, e tx_prev_da_gas_used, e tx_prev_da_gas_used_sent_to_enqueued_call, e tx_prev_l1_l2_tree_root, e tx_prev_l1_l2_tree_size, e tx_prev_l2_gas_used, e tx_prev_l2_gas_used_sent_to_enqueued_call, e tx_prev_note_hash_tree_root, e tx_prev_note_hash_tree_size, e tx_prev_nullifier_tree_root, e tx_prev_nullifier_tree_size, e tx_prev_num_note_hashes_emitted, e tx_prev_num_nullifiers_emitted, e tx_prev_num_pub_data_writes_emitted, e tx_prev_public_data_tree_root, e tx_prev_public_data_tree_size, e tx_read_pi_length_offset, e tx_read_pi_offset, e tx_remaining_phase_counter, e tx_remaining_phase_inv, e tx_remaining_phase_minus_one_inv, e tx_reverted, e tx_sel, e tx_sel_non_revertible_append_note_hash, e tx_sel_non_revertible_append_nullifier, e tx_sel_read_phase_length, e tx_sel_revertible_append_note_hash, e tx_sel_revertible_append_nullifier, e tx_should_note_hash_append, e tx_should_nullifier_append, e tx_start_phase, e tx_successful_msg_emit, e tx_uint32_max, e tx_write_pi_offset, e update_check_address, e update_check_current_class_id, e update_check_deployer_protocol_contract_address, e update_check_hash_not_zero, e update_check_original_class_id, e update_check_public_data_tree_root, e update_check_public_leaf_index_domain_separator, e update_check_sel, e update_check_shared_mutable_hash_slot, e update_check_shared_mutable_slot, e update_check_timestamp, e update_check_timestamp_is_lt_timestamp_of_change, e update_check_timestamp_of_change, e update_check_timestamp_of_change_bit_size, e update_check_timestamp_of_change_subtraction, e update_check_update_hash, e update_check_update_hash_inv, e update_check_update_hi_metadata, e update_check_update_hi_metadata_bit_size, e update_check_update_post_class_id_is_zero, e update_check_update_post_class_inv, e update_check_update_pre_class_id_is_zero, e update_check_update_pre_class_inv, e update_check_update_preimage_metadata, e update_check_update_preimage_post_class_id, e update_check_update_preimage_pre_class_id, e update_check_updated_class_ids_slot, e lookup_range_check_dyn_rng_chk_pow_2_counts, e lookup_range_check_dyn_diff_is_u16_counts, e lookup_range_check_r0_is_u16_counts, e lookup_range_check_r1_is_u16_counts, e lookup_range_check_r2_is_u16_counts, e lookup_range_check_r3_is_u16_counts, e lookup_range_check_r4_is_u16_counts, e lookup_range_check_r5_is_u16_counts, e lookup_range_check_r6_is_u16_counts, e lookup_range_check_r7_is_u16_counts, e lookup_ff_gt_a_lo_range_counts, e lookup_ff_gt_a_hi_range_counts, e lookup_alu_register_tag_value_counts, e lookup_alu_tag_max_bits_value_counts, e lookup_alu_ff_lt_counts, e lookup_alu_lt_range_counts, e lookup_bitwise_integral_tag_length_counts, e lookup_bitwise_byte_operations_counts, e lookup_bitwise_dispatch_exec_bitwise_counts, e lookup_keccak_memory_slice_to_mem_counts, e lookup_keccakf1600_theta_xor_01_counts, e lookup_keccakf1600_theta_xor_02_counts, e lookup_keccakf1600_theta_xor_03_counts, e lookup_keccakf1600_theta_xor_row_0_counts, e lookup_keccakf1600_theta_xor_11_counts, e lookup_keccakf1600_theta_xor_12_counts, e lookup_keccakf1600_theta_xor_13_counts, e lookup_keccakf1600_theta_xor_row_1_counts, e lookup_keccakf1600_theta_xor_21_counts, e lookup_keccakf1600_theta_xor_22_counts, e lookup_keccakf1600_theta_xor_23_counts, e lookup_keccakf1600_theta_xor_row_2_counts, e lookup_keccakf1600_theta_xor_31_counts, e lookup_keccakf1600_theta_xor_32_counts, e lookup_keccakf1600_theta_xor_33_counts, e lookup_keccakf1600_theta_xor_row_3_counts, e lookup_keccakf1600_theta_xor_41_counts, e lookup_keccakf1600_theta_xor_42_counts, e lookup_keccakf1600_theta_xor_43_counts, e lookup_keccakf1600_theta_xor_row_4_counts, e lookup_keccakf1600_theta_combined_xor_0_counts, e lookup_keccakf1600_theta_combined_xor_1_counts, e lookup_keccakf1600_theta_combined_xor_2_counts, e lookup_keccakf1600_theta_combined_xor_3_counts, e lookup_keccakf1600_theta_combined_xor_4_counts, e lookup_keccakf1600_state_theta_00_counts, e lookup_keccakf1600_state_theta_01_counts, e lookup_keccakf1600_state_theta_02_counts, e lookup_keccakf1600_state_theta_03_counts, e lookup_keccakf1600_state_theta_04_counts, e lookup_keccakf1600_state_theta_10_counts, e lookup_keccakf1600_state_theta_11_counts, e lookup_keccakf1600_state_theta_12_counts, e lookup_keccakf1600_state_theta_13_counts, e lookup_keccakf1600_state_theta_14_counts, e lookup_keccakf1600_state_theta_20_counts, e lookup_keccakf1600_state_theta_21_counts, e lookup_keccakf1600_state_theta_22_counts, e lookup_keccakf1600_state_theta_23_counts, e lookup_keccakf1600_state_theta_24_counts, e lookup_keccakf1600_state_theta_30_counts, e lookup_keccakf1600_state_theta_31_counts, e lookup_keccakf1600_state_theta_32_counts, e lookup_keccakf1600_state_theta_33_counts, e lookup_keccakf1600_state_theta_34_counts, e lookup_keccakf1600_state_theta_40_counts, e lookup_keccakf1600_state_theta_41_counts, e lookup_keccakf1600_state_theta_42_counts, e lookup_keccakf1600_state_theta_43_counts, e lookup_keccakf1600_state_theta_44_counts, e lookup_keccakf1600_theta_limb_02_range_counts, e lookup_keccakf1600_theta_limb_04_range_counts, e lookup_keccakf1600_theta_limb_10_range_counts, e lookup_keccakf1600_theta_limb_12_range_counts, e lookup_keccakf1600_theta_limb_14_range_counts, e lookup_keccakf1600_theta_limb_21_range_counts, e lookup_keccakf1600_theta_limb_23_range_counts, e lookup_keccakf1600_theta_limb_30_range_counts, e lookup_keccakf1600_theta_limb_32_range_counts, e lookup_keccakf1600_theta_limb_33_range_counts, e lookup_keccakf1600_theta_limb_40_range_counts, e lookup_keccakf1600_theta_limb_41_range_counts, e lookup_keccakf1600_theta_limb_43_range_counts, e lookup_keccakf1600_theta_limb_44_range_counts, e lookup_keccakf1600_theta_limb_01_range_counts, e lookup_keccakf1600_theta_limb_03_range_counts, e lookup_keccakf1600_theta_limb_11_range_counts, e lookup_keccakf1600_theta_limb_13_range_counts, e lookup_keccakf1600_theta_limb_20_range_counts, e lookup_keccakf1600_theta_limb_22_range_counts, e lookup_keccakf1600_theta_limb_24_range_counts, e lookup_keccakf1600_theta_limb_31_range_counts, e lookup_keccakf1600_theta_limb_34_range_counts, e lookup_keccakf1600_theta_limb_42_range_counts, e lookup_keccakf1600_state_pi_and_00_counts, e lookup_keccakf1600_state_pi_and_01_counts, e lookup_keccakf1600_state_pi_and_02_counts, e lookup_keccakf1600_state_pi_and_03_counts, e lookup_keccakf1600_state_pi_and_04_counts, e lookup_keccakf1600_state_pi_and_10_counts, e lookup_keccakf1600_state_pi_and_11_counts, e lookup_keccakf1600_state_pi_and_12_counts, e lookup_keccakf1600_state_pi_and_13_counts, e lookup_keccakf1600_state_pi_and_14_counts, e lookup_keccakf1600_state_pi_and_20_counts, e lookup_keccakf1600_state_pi_and_21_counts, e lookup_keccakf1600_state_pi_and_22_counts, e lookup_keccakf1600_state_pi_and_23_counts, e lookup_keccakf1600_state_pi_and_24_counts, e lookup_keccakf1600_state_pi_and_30_counts, e lookup_keccakf1600_state_pi_and_31_counts, e lookup_keccakf1600_state_pi_and_32_counts, e lookup_keccakf1600_state_pi_and_33_counts, e lookup_keccakf1600_state_pi_and_34_counts, e lookup_keccakf1600_state_pi_and_40_counts, e lookup_keccakf1600_state_pi_and_41_counts, e lookup_keccakf1600_state_pi_and_42_counts, e lookup_keccakf1600_state_pi_and_43_counts, e lookup_keccakf1600_state_pi_and_44_counts, e lookup_keccakf1600_state_chi_00_counts, e lookup_keccakf1600_state_chi_01_counts, e lookup_keccakf1600_state_chi_02_counts, e lookup_keccakf1600_state_chi_03_counts, e lookup_keccakf1600_state_chi_04_counts, e lookup_keccakf1600_state_chi_10_counts, e lookup_keccakf1600_state_chi_11_counts, e lookup_keccakf1600_state_chi_12_counts, e lookup_keccakf1600_state_chi_13_counts, e lookup_keccakf1600_state_chi_14_counts, e lookup_keccakf1600_state_chi_20_counts, e lookup_keccakf1600_state_chi_21_counts, e lookup_keccakf1600_state_chi_22_counts, e lookup_keccakf1600_state_chi_23_counts, e lookup_keccakf1600_state_chi_24_counts, e lookup_keccakf1600_state_chi_30_counts, e lookup_keccakf1600_state_chi_31_counts, e lookup_keccakf1600_state_chi_32_counts, e lookup_keccakf1600_state_chi_33_counts, e lookup_keccakf1600_state_chi_34_counts, e lookup_keccakf1600_state_chi_40_counts, e lookup_keccakf1600_state_chi_41_counts, e lookup_keccakf1600_state_chi_42_counts, e lookup_keccakf1600_state_chi_43_counts, e lookup_keccakf1600_state_chi_44_counts, e lookup_keccakf1600_round_cst_counts, e lookup_keccakf1600_state_iota_00_counts, e lookup_keccakf1600_src_abs_diff_positive_counts, e lookup_keccakf1600_dst_abs_diff_positive_counts, e lookup_sha256_round_constant_counts, e lookup_poseidon2_hash_poseidon2_perm_counts, e lookup_to_radix_limb_range_counts, e lookup_to_radix_limb_less_than_radix_range_counts, e lookup_to_radix_fetch_safe_limbs_counts, e lookup_to_radix_fetch_p_limb_counts, e lookup_to_radix_limb_p_diff_range_counts, e lookup_scalar_mul_to_radix_counts, e lookup_scalar_mul_double_counts, e lookup_scalar_mul_add_counts, e lookup_context_ctx_stack_call_counts, e lookup_context_ctx_stack_rollback_counts, e lookup_context_ctx_stack_return_counts, e lookup_calldata_hashing_cd_hash_counts, e lookup_calldata_hashing_cd_hash_end_counts, e lookup_data_copy_range_max_read_size_diff_counts, e lookup_data_copy_range_read_counts, e lookup_data_copy_range_write_counts, e lookup_data_copy_range_reads_left_counts, e lookup_data_copy_mem_write_counts, e lookup_data_copy_mem_read_counts, e lookup_data_copy_col_read_counts, e lookup_addressing_base_address_from_memory_counts, e lookup_addressing_relative_overflow_range_0_counts, e lookup_addressing_relative_overflow_range_1_counts, e lookup_addressing_relative_overflow_range_2_counts, e lookup_addressing_relative_overflow_range_3_counts, e lookup_addressing_relative_overflow_range_4_counts, e lookup_addressing_relative_overflow_range_5_counts, e lookup_addressing_relative_overflow_range_6_counts, e lookup_addressing_indirect_from_memory_0_counts, e lookup_addressing_indirect_from_memory_1_counts, e lookup_addressing_indirect_from_memory_2_counts, e lookup_addressing_indirect_from_memory_3_counts, e lookup_addressing_indirect_from_memory_4_counts, e lookup_addressing_indirect_from_memory_5_counts, e lookup_addressing_indirect_from_memory_6_counts, e lookup_registers_mem_op_0_counts, e lookup_registers_mem_op_1_counts, e lookup_registers_mem_op_2_counts, e lookup_registers_mem_op_3_counts, e lookup_registers_mem_op_4_counts, e lookup_registers_mem_op_5_counts, e lookup_registers_mem_op_6_counts, e lookup_gas_addressing_gas_read_counts, e lookup_gas_limit_used_l2_range_counts, e lookup_gas_limit_used_da_range_counts, e lookup_merkle_check_merkle_poseidon2_read_counts, e lookup_merkle_check_merkle_poseidon2_write_counts, e lookup_nullifier_check_silo_poseidon2_counts, e lookup_nullifier_check_low_leaf_poseidon2_counts, e lookup_nullifier_check_updated_low_leaf_poseidon2_counts, e lookup_nullifier_check_low_leaf_merkle_check_counts, e lookup_nullifier_check_low_leaf_nullifier_validation_counts, e lookup_nullifier_check_low_leaf_next_nullifier_validation_counts, e lookup_nullifier_check_new_leaf_poseidon2_counts, e lookup_nullifier_check_new_leaf_merkle_check_counts, e lookup_nullifier_check_write_nullifier_to_public_inputs_counts, e lookup_public_data_check_silo_poseidon2_counts, e lookup_public_data_check_low_leaf_slot_validation_counts, e lookup_public_data_check_low_leaf_next_slot_validation_counts, e lookup_public_data_check_low_leaf_poseidon2_0_counts, e lookup_public_data_check_low_leaf_poseidon2_1_counts, e lookup_public_data_check_updated_low_leaf_poseidon2_0_counts, e lookup_public_data_check_updated_low_leaf_poseidon2_1_counts, e lookup_public_data_check_low_leaf_merkle_check_counts, e lookup_public_data_check_new_leaf_poseidon2_0_counts, e lookup_public_data_check_new_leaf_poseidon2_1_counts, e lookup_public_data_check_new_leaf_merkle_check_counts, e lookup_public_data_check_write_public_data_to_public_inputs_counts, e lookup_address_derivation_salted_initialization_hash_poseidon2_0_counts, e lookup_address_derivation_salted_initialization_hash_poseidon2_1_counts, e lookup_address_derivation_partial_address_poseidon2_counts, e lookup_address_derivation_public_keys_hash_poseidon2_0_counts, e lookup_address_derivation_public_keys_hash_poseidon2_1_counts, e lookup_address_derivation_public_keys_hash_poseidon2_2_counts, e lookup_address_derivation_public_keys_hash_poseidon2_3_counts, e lookup_address_derivation_public_keys_hash_poseidon2_4_counts, e lookup_address_derivation_preaddress_poseidon2_counts, e lookup_address_derivation_preaddress_scalar_mul_counts, e lookup_address_derivation_address_ecadd_counts, e lookup_bc_decomposition_bytes_are_bytes_counts, e lookup_bc_decomposition_abs_diff_is_u16_counts, e lookup_bc_hashing_get_packed_field_counts, e lookup_bc_hashing_iv_is_len_counts, e lookup_update_check_shared_mutable_slot_poseidon2_counts, e lookup_update_check_update_hash_public_data_read_counts, e lookup_update_check_update_hash_poseidon2_counts, e lookup_update_check_update_hi_metadata_range_counts, e lookup_update_check_update_lo_metadata_range_counts, e lookup_update_check_timestamp_of_change_cmp_range_counts, e lookup_bc_retrieval_deployment_nullifier_read_counts, e lookup_bc_retrieval_address_derivation_counts, e lookup_bc_retrieval_update_check_counts, e lookup_bc_retrieval_class_id_derivation_counts, e lookup_instr_fetching_pc_abs_diff_positive_counts, e lookup_instr_fetching_instr_abs_diff_positive_counts, e lookup_instr_fetching_tag_value_validation_counts, e lookup_instr_fetching_bytecode_size_from_bc_dec_counts, e lookup_instr_fetching_bytes_from_bc_dec_counts, e lookup_instr_fetching_wire_instruction_info_counts, e lookup_class_id_derivation_class_id_poseidon2_0_counts, e lookup_class_id_derivation_class_id_poseidon2_1_counts, e lookup_get_env_var_precomputed_info_counts, e lookup_get_env_var_read_from_public_inputs_col0_counts, e lookup_get_env_var_read_from_public_inputs_col1_counts, e lookup_internal_call_push_call_stack_counts, e lookup_internal_call_unwind_call_stack_counts, e lookup_external_call_call_allocated_left_l2_range_counts, e lookup_external_call_call_allocated_left_da_range_counts, e lookup_execution_bytecode_retrieval_result_counts, e lookup_execution_instruction_fetching_result_counts, e lookup_execution_instruction_fetching_body_counts, e lookup_execution_exec_spec_read_counts, e lookup_execution_dyn_l2_factor_bitwise_counts, e lookup_note_hash_tree_check_silo_poseidon2_counts, e lookup_note_hash_tree_check_read_first_nullifier_counts, e lookup_note_hash_tree_check_nonce_computation_poseidon2_counts, e lookup_note_hash_tree_check_unique_note_hash_poseidon2_counts, e lookup_note_hash_tree_check_merkle_check_counts, e lookup_note_hash_tree_check_write_note_hash_to_public_inputs_counts, e lookup_tx_read_phase_table_counts, e lookup_tx_phase_jump_on_revert_counts, e lookup_tx_read_phase_length_counts, e lookup_tx_read_public_call_request_phase_counts, e lookup_tx_read_tree_insert_value_counts, e lookup_tx_note_hash_append_counts, e lookup_tx_nullifier_append_counts, e lookup_tx_read_l2_l1_msg_counts, e lookup_tx_write_l2_l1_msg_counts, e lookup_tx_read_effective_fee_public_inputs_counts, e lookup_tx_read_fee_payer_public_inputs_counts, e lookup_tx_balance_slot_poseidon2_counts, e lookup_tx_balance_validation_counts +#define AVM2_WIRE_ENTITIES_E(e) e public_inputs_cols_0_, e public_inputs_cols_1_, e public_inputs_cols_2_, e public_inputs_cols_3_, e address_derivation_address, e address_derivation_address_y, e address_derivation_class_id, e address_derivation_deployer_addr, e address_derivation_g1_x, e address_derivation_g1_y, e address_derivation_incoming_viewing_key_x, e address_derivation_incoming_viewing_key_y, e address_derivation_init_hash, e address_derivation_nullifier_key_x, e address_derivation_nullifier_key_y, e address_derivation_outgoing_viewing_key_x, e address_derivation_outgoing_viewing_key_y, e address_derivation_partial_address, e address_derivation_partial_address_domain_separator, e address_derivation_preaddress, e address_derivation_preaddress_domain_separator, e address_derivation_preaddress_public_key_x, e address_derivation_preaddress_public_key_y, e address_derivation_public_keys_hash, e address_derivation_public_keys_hash_domain_separator, e address_derivation_salt, e address_derivation_salted_init_hash, e address_derivation_sel, e address_derivation_tagging_key_x, e address_derivation_tagging_key_y, e alu_ab_tags_diff_inv, e alu_cf, e alu_helper1, e alu_ia, e alu_ia_tag, e alu_ib, e alu_ib_tag, e alu_ic, e alu_ic_tag, e alu_lt_abs_diff, e alu_max_bits, e alu_max_value, e alu_op_id, e alu_sel, e alu_sel_ff_lt, e alu_sel_is_ff, e alu_sel_op_add, e alu_sel_op_eq, e alu_sel_op_lt, e alu_sel_tag_err, e alu_tag_ff_diff_inv, e bc_decomposition_abs_diff, e bc_decomposition_bytes, e bc_decomposition_bytes_pc_plus_1, e bc_decomposition_bytes_pc_plus_10, e bc_decomposition_bytes_pc_plus_11, e bc_decomposition_bytes_pc_plus_12, e bc_decomposition_bytes_pc_plus_13, e bc_decomposition_bytes_pc_plus_14, e bc_decomposition_bytes_pc_plus_15, e bc_decomposition_bytes_pc_plus_16, e bc_decomposition_bytes_pc_plus_17, e bc_decomposition_bytes_pc_plus_18, e bc_decomposition_bytes_pc_plus_19, e bc_decomposition_bytes_pc_plus_2, e bc_decomposition_bytes_pc_plus_20, e bc_decomposition_bytes_pc_plus_21, e bc_decomposition_bytes_pc_plus_22, e bc_decomposition_bytes_pc_plus_23, e bc_decomposition_bytes_pc_plus_24, e bc_decomposition_bytes_pc_plus_25, e bc_decomposition_bytes_pc_plus_26, e bc_decomposition_bytes_pc_plus_27, e bc_decomposition_bytes_pc_plus_28, e bc_decomposition_bytes_pc_plus_29, e bc_decomposition_bytes_pc_plus_3, e bc_decomposition_bytes_pc_plus_30, e bc_decomposition_bytes_pc_plus_31, e bc_decomposition_bytes_pc_plus_32, e bc_decomposition_bytes_pc_plus_33, e bc_decomposition_bytes_pc_plus_34, e bc_decomposition_bytes_pc_plus_35, e bc_decomposition_bytes_pc_plus_36, e bc_decomposition_bytes_pc_plus_4, e bc_decomposition_bytes_pc_plus_5, e bc_decomposition_bytes_pc_plus_6, e bc_decomposition_bytes_pc_plus_7, e bc_decomposition_bytes_pc_plus_8, e bc_decomposition_bytes_pc_plus_9, e bc_decomposition_bytes_rem_inv, e bc_decomposition_bytes_rem_min_one_inv, e bc_decomposition_bytes_remaining, e bc_decomposition_bytes_to_read, e bc_decomposition_id, e bc_decomposition_last_of_contract, e bc_decomposition_packed_field, e bc_decomposition_pc, e bc_decomposition_sel, e bc_decomposition_sel_overflow_correction_needed, e bc_decomposition_sel_packed, e bc_hashing_bytecode_id, e bc_hashing_incremental_hash, e bc_hashing_latch, e bc_hashing_output_hash, e bc_hashing_packed_field, e bc_hashing_pc_index, e bc_hashing_sel, e bc_hashing_start, e bc_retrieval_address, e bc_retrieval_artifact_hash, e bc_retrieval_bytecode_id, e bc_retrieval_current_class_id, e bc_retrieval_deployer_addr, e bc_retrieval_deployer_protocol_contract_address, e bc_retrieval_error, e bc_retrieval_incoming_viewing_key_x, e bc_retrieval_incoming_viewing_key_y, e bc_retrieval_init_hash, e bc_retrieval_nullifier_exists, e bc_retrieval_nullifier_key_x, e bc_retrieval_nullifier_key_y, e bc_retrieval_nullifier_tree_root, e bc_retrieval_original_class_id, e bc_retrieval_outgoing_viewing_key_x, e bc_retrieval_outgoing_viewing_key_y, e bc_retrieval_private_function_root, e bc_retrieval_public_bytecode_commitment, e bc_retrieval_public_data_tree_root, e bc_retrieval_salt, e bc_retrieval_sel, e bc_retrieval_tagging_key_x, e bc_retrieval_tagging_key_y, e bc_retrieval_timestamp, e bitwise_acc_ia, e bitwise_acc_ib, e bitwise_acc_ic, e bitwise_ctr, e bitwise_ctr_inv, e bitwise_ctr_min_one_inv, e bitwise_err, e bitwise_ia_byte, e bitwise_ib_byte, e bitwise_ic_byte, e bitwise_last, e bitwise_op_id, e bitwise_sel, e bitwise_sel_get_ctr, e bitwise_sel_tag_ff_err, e bitwise_sel_tag_mismatch_err, e bitwise_start, e bitwise_tag_a, e bitwise_tag_a_inv, e bitwise_tag_ab_diff_inv, e bitwise_tag_b, e bitwise_tag_c, e calldata_context_id, e calldata_index, e calldata_latch, e calldata_sel, e calldata_value, e cd_hashing_context_id, e cd_hashing_input_0_, e cd_hashing_input_1_, e cd_hashing_input_2_, e cd_hashing_latch, e cd_hashing_length_remaining, e cd_hashing_output_hash, e cd_hashing_sel, e class_id_derivation_artifact_hash, e class_id_derivation_class_id, e class_id_derivation_private_function_root, e class_id_derivation_public_bytecode_commitment, e class_id_derivation_sel, e class_id_derivation_temp_constant_for_lookup, e context_stack_context_id, e context_stack_context_id_inv, e context_stack_contract_address, e context_stack_entered_context_id, e context_stack_is_static, e context_stack_msg_sender, e context_stack_next_pc, e context_stack_parent_calldata_addr, e context_stack_parent_calldata_size, e context_stack_parent_da_gas_limit, e context_stack_parent_da_gas_used, e context_stack_parent_id, e context_stack_parent_l2_gas_limit, e context_stack_parent_l2_gas_used, e context_stack_sel, e data_copy_abs_diff_max_read_index, e data_copy_abs_max_read_offset, e data_copy_abs_read_diff, e data_copy_abs_write_diff, e data_copy_cd_copy_col_read, e data_copy_clk, e data_copy_copy_size, e data_copy_dst_addr, e data_copy_dst_context_id, e data_copy_dst_out_of_range_err, e data_copy_err, e data_copy_is_top_level, e data_copy_offset, e data_copy_operation_id, e data_copy_padding, e data_copy_parent_id_inv, e data_copy_read_addr, e data_copy_reads_left, e data_copy_reads_left_inv, e data_copy_sel_cd_copy, e data_copy_sel_end, e data_copy_sel_mem_read, e data_copy_sel_mem_write, e data_copy_sel_offset_gt_max_read, e data_copy_sel_rd_copy, e data_copy_sel_start, e data_copy_sel_start_no_err, e data_copy_src_addr, e data_copy_src_context_id, e data_copy_src_data_size, e data_copy_src_data_size_is_lt, e data_copy_src_out_of_range_err, e data_copy_thirty_two, e data_copy_value, e data_copy_write_count_minus_one_inv, e ecc_add_op, e ecc_double_op, e ecc_inv_2_p_y, e ecc_inv_x_diff, e ecc_inv_y_diff, e ecc_lambda, e ecc_p_is_inf, e ecc_p_x, e ecc_p_y, e ecc_q_is_inf, e ecc_q_x, e ecc_q_y, e ecc_r_is_inf, e ecc_r_x, e ecc_r_y, e ecc_result_infinity, e ecc_sel, e ecc_use_computed_result, e ecc_x_match, e ecc_y_match, e execution_addressing_error_collection_inv, e execution_addressing_gas, e execution_base_address_tag, e execution_base_address_tag_diff_inv, e execution_base_address_val, e execution_base_da_gas, e execution_batched_tags_diff_inv, e execution_batched_tags_diff_inv_reg, e execution_bytecode_id, e execution_call_allocated_left_da_cmp_diff, e execution_call_allocated_left_l2_cmp_diff, e execution_call_is_da_gas_allocated_lt_left, e execution_call_is_l2_gas_allocated_lt_left, e execution_constant_32, e execution_constant_64, e execution_context_id, e execution_contract_address, e execution_da_gas_limit, e execution_da_gas_used, e execution_discard, e execution_dying_context_diff_inv, e execution_dying_context_id, e execution_dying_context_id_inv, e execution_dynamic_da_gas, e execution_dynamic_da_gas_factor, e execution_dynamic_l2_gas, e execution_dynamic_l2_gas_factor, e execution_enqueued_call_end, e execution_enqueued_call_start, e execution_envvar_pi_row_idx, e execution_ex_opcode, e execution_expected_tag_reg_0_, e execution_expected_tag_reg_1_, e execution_expected_tag_reg_2_, e execution_expected_tag_reg_3_, e execution_expected_tag_reg_4_, e execution_expected_tag_reg_5_, e execution_expected_tag_reg_6_, e execution_has_parent_ctx, e execution_indirect, e execution_instr_length, e execution_internal_call_id, e execution_internal_call_return_id, e execution_internal_call_return_id_inv, e execution_is_address, e execution_is_dagasleft, e execution_is_dying_context, e execution_is_isstaticcall, e execution_is_l2gasleft, e execution_is_parent_id_inv, e execution_is_sender, e execution_is_static, e execution_is_transactionfee, e execution_l1_l2_tree_root, e execution_l1_l2_tree_size, e execution_l2_gas_limit, e execution_l2_gas_used, e execution_last, e execution_last_child_returndata_addr, e execution_last_child_returndata_size, e execution_last_child_success, e execution_limit_used_da_cmp_diff, e execution_limit_used_l2_cmp_diff, e execution_mem_tag_reg_0_, e execution_mem_tag_reg_1_, e execution_mem_tag_reg_2_, e execution_mem_tag_reg_3_, e execution_mem_tag_reg_4_, e execution_mem_tag_reg_5_, e execution_mem_tag_reg_6_, e execution_msg_sender, e execution_nested_call_from_undiscarded_context, e execution_nested_exit_call, e execution_nested_return, e execution_next_context_id, e execution_next_internal_call_id, e execution_next_pc, e execution_note_hash_tree_root, e execution_note_hash_tree_size, e execution_nullifier_tree_root, e execution_nullifier_tree_size, e execution_num_note_hashes_emitted, e execution_num_nullifiers_emitted, e execution_num_pub_data_writes_emitted, e execution_num_relative_operands_inv, e execution_op_0_, e execution_op_1_, e execution_op_2_, e execution_op_3_, e execution_op_4_, e execution_op_5_, e execution_op_6_, e execution_op_after_relative_0_, e execution_op_after_relative_1_, e execution_op_after_relative_2_, e execution_op_after_relative_3_, e execution_op_after_relative_4_, e execution_op_after_relative_5_, e execution_op_after_relative_6_, e execution_opcode_gas, e execution_out_of_gas_da, e execution_out_of_gas_l2, e execution_overflow_range_check_result_0_, e execution_overflow_range_check_result_1_, e execution_overflow_range_check_result_2_, e execution_overflow_range_check_result_3_, e execution_overflow_range_check_result_4_, e execution_overflow_range_check_result_5_, e execution_overflow_range_check_result_6_, e execution_parent_calldata_addr, e execution_parent_calldata_size, e execution_parent_da_gas_limit, e execution_parent_da_gas_used, e execution_parent_id, e execution_parent_l2_gas_limit, e execution_parent_l2_gas_used, e execution_pc, e execution_prev_da_gas_used, e execution_prev_l1_l2_tree_root, e execution_prev_l1_l2_tree_size, e execution_prev_l2_gas_used, e execution_prev_note_hash_tree_root, e execution_prev_note_hash_tree_size, e execution_prev_nullifier_tree_root, e execution_prev_nullifier_tree_size, e execution_prev_num_note_hashes_emitted, e execution_prev_num_nullifiers_emitted, e execution_prev_num_pub_data_writes_emitted, e execution_prev_public_data_tree_root, e execution_prev_public_data_tree_size, e execution_propagate_discard, e execution_public_data_tree_root, e execution_public_data_tree_size, e execution_register_0_, e execution_register_1_, e execution_register_2_, e execution_register_3_, e execution_register_4_, e execution_register_5_, e execution_register_6_, e execution_resolves_dying_context, e execution_rollback_context, e execution_rop_0_, e execution_rop_1_, e execution_rop_2_, e execution_rop_3_, e execution_rop_4_, e execution_rop_5_, e execution_rop_6_, e execution_rop_tag_0_, e execution_rop_tag_1_, e execution_rop_tag_2_, e execution_rop_tag_3_, e execution_rop_tag_4_, e execution_rop_tag_5_, e execution_rop_tag_6_, e execution_rw_reg_0_, e execution_rw_reg_1_, e execution_rw_reg_2_, e execution_rw_reg_3_, e execution_rw_reg_4_, e execution_rw_reg_5_, e execution_rw_reg_6_, e execution_sel, e execution_sel_addressing_error, e execution_sel_alu, e execution_sel_base_address_failure, e execution_sel_bitwise, e execution_sel_bytecode_retrieval_failure, e execution_sel_bytecode_retrieval_success, e execution_sel_call, e execution_sel_data_copy, e execution_sel_debug_log, e execution_sel_do_base_check, e execution_sel_ecc_add, e execution_sel_enter_call, e execution_sel_envvar_pi_lookup_col0, e execution_sel_envvar_pi_lookup_col1, e execution_sel_error, e execution_sel_execution, e execution_sel_exit_call, e execution_sel_failure, e execution_sel_get_env_var, e execution_sel_instruction_fetching_failure, e execution_sel_instruction_fetching_success, e execution_sel_internal_call, e execution_sel_internal_return, e execution_sel_jump, e execution_sel_jumpi, e execution_sel_keccakf1600, e execution_sel_mem_op_reg_0_, e execution_sel_mem_op_reg_1_, e execution_sel_mem_op_reg_2_, e execution_sel_mem_op_reg_3_, e execution_sel_mem_op_reg_4_, e execution_sel_mem_op_reg_5_, e execution_sel_mem_op_reg_6_, e execution_sel_mov, e execution_sel_op_is_address_0_, e execution_sel_op_is_address_1_, e execution_sel_op_is_address_2_, e execution_sel_op_is_address_3_, e execution_sel_op_is_address_4_, e execution_sel_op_is_address_5_, e execution_sel_op_is_address_6_, e execution_sel_op_is_indirect_wire_0_, e execution_sel_op_is_indirect_wire_1_, e execution_sel_op_is_indirect_wire_2_, e execution_sel_op_is_indirect_wire_3_, e execution_sel_op_is_indirect_wire_4_, e execution_sel_op_is_indirect_wire_5_, e execution_sel_op_is_indirect_wire_6_, e execution_sel_op_is_indirect_wire_7_, e execution_sel_op_is_relative_effective_0_, e execution_sel_op_is_relative_effective_1_, e execution_sel_op_is_relative_effective_2_, e execution_sel_op_is_relative_effective_3_, e execution_sel_op_is_relative_effective_4_, e execution_sel_op_is_relative_effective_5_, e execution_sel_op_is_relative_effective_6_, e execution_sel_op_is_relative_wire_0_, e execution_sel_op_is_relative_wire_1_, e execution_sel_op_is_relative_wire_2_, e execution_sel_op_is_relative_wire_3_, e execution_sel_op_is_relative_wire_4_, e execution_sel_op_is_relative_wire_5_, e execution_sel_op_is_relative_wire_6_, e execution_sel_op_is_relative_wire_7_, e execution_sel_op_reg_effective_0_, e execution_sel_op_reg_effective_1_, e execution_sel_op_reg_effective_2_, e execution_sel_op_reg_effective_3_, e execution_sel_op_reg_effective_4_, e execution_sel_op_reg_effective_5_, e execution_sel_op_reg_effective_6_, e execution_sel_opcode_error, e execution_sel_opcode_failure, e execution_sel_out_of_gas, e execution_sel_poseidon2_perm, e execution_sel_register_read_error, e execution_sel_relative_overflow_0_, e execution_sel_relative_overflow_1_, e execution_sel_relative_overflow_2_, e execution_sel_relative_overflow_3_, e execution_sel_relative_overflow_4_, e execution_sel_relative_overflow_5_, e execution_sel_relative_overflow_6_, e execution_sel_return, e execution_sel_returndata_size, e execution_sel_revert, e execution_sel_set, e execution_sel_should_apply_indirection_0_, e execution_sel_should_apply_indirection_1_, e execution_sel_should_apply_indirection_2_, e execution_sel_should_apply_indirection_3_, e execution_sel_should_apply_indirection_4_, e execution_sel_should_apply_indirection_5_, e execution_sel_should_apply_indirection_6_, e execution_sel_should_check_gas, e execution_sel_should_execute_opcode, e execution_sel_should_get_env_var, e execution_sel_should_read_registers, e execution_sel_should_write_registers, e execution_sel_some_final_check_failed, e execution_sel_static_call, e execution_sel_success_copy, e execution_sel_tag_check_reg_0_, e execution_sel_tag_check_reg_1_, e execution_sel_tag_check_reg_2_, e execution_sel_tag_check_reg_3_, e execution_sel_tag_check_reg_4_, e execution_sel_tag_check_reg_5_, e execution_sel_tag_check_reg_6_, e execution_sel_to_radix, e execution_subtrace_operation_id, e execution_transaction_fee, e execution_two_to_32, e execution_value_from_pi, e ff_gt_a, e ff_gt_a_hi, e ff_gt_a_lo, e ff_gt_b, e ff_gt_b_hi, e ff_gt_b_lo, e ff_gt_borrow, e ff_gt_cmp_rng_ctr, e ff_gt_cmp_rng_ctr_inv, e ff_gt_constant_128, e ff_gt_p_a_borrow, e ff_gt_p_b_borrow, e ff_gt_p_sub_a_hi, e ff_gt_p_sub_a_lo, e ff_gt_p_sub_b_hi, e ff_gt_p_sub_b_lo, e ff_gt_res_hi, e ff_gt_res_lo, e ff_gt_result, e ff_gt_sel, e ff_gt_sel_gt, e ff_gt_sel_shift_rng, e instr_fetching_bd0, e instr_fetching_bd1, e instr_fetching_bd10, e instr_fetching_bd11, e instr_fetching_bd12, e instr_fetching_bd13, e instr_fetching_bd14, e instr_fetching_bd15, e instr_fetching_bd16, e instr_fetching_bd17, e instr_fetching_bd18, e instr_fetching_bd19, e instr_fetching_bd2, e instr_fetching_bd20, e instr_fetching_bd21, e instr_fetching_bd22, e instr_fetching_bd23, e instr_fetching_bd24, e instr_fetching_bd25, e instr_fetching_bd26, e instr_fetching_bd27, e instr_fetching_bd28, e instr_fetching_bd29, e instr_fetching_bd3, e instr_fetching_bd30, e instr_fetching_bd31, e instr_fetching_bd32, e instr_fetching_bd33, e instr_fetching_bd34, e instr_fetching_bd35, e instr_fetching_bd36, e instr_fetching_bd4, e instr_fetching_bd5, e instr_fetching_bd6, e instr_fetching_bd7, e instr_fetching_bd8, e instr_fetching_bd9, e instr_fetching_bytecode_id, e instr_fetching_bytecode_size, e instr_fetching_bytes_to_read, e instr_fetching_exec_opcode, e instr_fetching_indirect, e instr_fetching_instr_abs_diff, e instr_fetching_instr_out_of_range, e instr_fetching_instr_size, e instr_fetching_op1, e instr_fetching_op2, e instr_fetching_op3, e instr_fetching_op4, e instr_fetching_op5, e instr_fetching_op6, e instr_fetching_op7, e instr_fetching_opcode_out_of_range, e instr_fetching_pc, e instr_fetching_pc_abs_diff, e instr_fetching_pc_out_of_range, e instr_fetching_pc_size_in_bits, e instr_fetching_sel, e instr_fetching_sel_has_tag, e instr_fetching_sel_op_dc_0, e instr_fetching_sel_op_dc_1, e instr_fetching_sel_op_dc_10, e instr_fetching_sel_op_dc_11, e instr_fetching_sel_op_dc_12, e instr_fetching_sel_op_dc_13, e instr_fetching_sel_op_dc_14, e instr_fetching_sel_op_dc_15, e instr_fetching_sel_op_dc_16, e instr_fetching_sel_op_dc_2, e instr_fetching_sel_op_dc_3, e instr_fetching_sel_op_dc_4, e instr_fetching_sel_op_dc_5, e instr_fetching_sel_op_dc_6, e instr_fetching_sel_op_dc_7, e instr_fetching_sel_op_dc_8, e instr_fetching_sel_op_dc_9, e instr_fetching_sel_parsing_err, e instr_fetching_sel_pc_in_range, e instr_fetching_sel_tag_is_op2, e instr_fetching_tag_out_of_range, e instr_fetching_tag_value, e internal_call_stack_context_id, e internal_call_stack_entered_call_id, e internal_call_stack_id, e internal_call_stack_return_id, e internal_call_stack_return_pc, e internal_call_stack_sel, e keccak_memory_addr, e keccak_memory_clk, e keccak_memory_ctr, e keccak_memory_ctr_end, e keccak_memory_ctr_inv, e keccak_memory_ctr_min_state_size_inv, e keccak_memory_last, e keccak_memory_num_rounds, e keccak_memory_rw, e keccak_memory_sel, e keccak_memory_single_tag_error, e keccak_memory_space_id, e keccak_memory_start_read, e keccak_memory_start_write, e keccak_memory_tag, e keccak_memory_tag_error, e keccak_memory_tag_min_u64_inv, e keccak_memory_val00, e keccak_memory_val01, e keccak_memory_val02, e keccak_memory_val03, e keccak_memory_val04, e keccak_memory_val10, e keccak_memory_val11, e keccak_memory_val12, e keccak_memory_val13, e keccak_memory_val14, e keccak_memory_val20, e keccak_memory_val21, e keccak_memory_val22, e keccak_memory_val23, e keccak_memory_val24, e keccak_memory_val30, e keccak_memory_val31, e keccak_memory_val32, e keccak_memory_val33, e keccak_memory_val34, e keccak_memory_val40, e keccak_memory_val41, e keccak_memory_val42, e keccak_memory_val43, e keccak_memory_val44, e keccakf1600_bitwise_and_op_id, e keccakf1600_bitwise_xor_op_id, e keccakf1600_clk, e keccakf1600_dst_abs_diff, e keccakf1600_dst_addr, e keccakf1600_dst_out_of_range_error, e keccakf1600_error, e keccakf1600_last, e keccakf1600_rot_64_min_len_01, e keccakf1600_rot_64_min_len_03, e keccakf1600_rot_64_min_len_11, e keccakf1600_rot_64_min_len_13, e keccakf1600_rot_64_min_len_20, e keccakf1600_rot_64_min_len_22, e keccakf1600_rot_64_min_len_24, e keccakf1600_rot_64_min_len_31, e keccakf1600_rot_64_min_len_34, e keccakf1600_rot_64_min_len_42, e keccakf1600_rot_len_02, e keccakf1600_rot_len_04, e keccakf1600_rot_len_10, e keccakf1600_rot_len_12, e keccakf1600_rot_len_14, e keccakf1600_rot_len_21, e keccakf1600_rot_len_23, e keccakf1600_rot_len_30, e keccakf1600_rot_len_32, e keccakf1600_rot_len_33, e keccakf1600_rot_len_40, e keccakf1600_rot_len_41, e keccakf1600_rot_len_43, e keccakf1600_rot_len_44, e keccakf1600_round, e keccakf1600_round_cst, e keccakf1600_round_inv, e keccakf1600_sel, e keccakf1600_sel_no_error, e keccakf1600_sel_slice_read, e keccakf1600_sel_slice_write, e keccakf1600_space_id, e keccakf1600_src_abs_diff, e keccakf1600_src_addr, e keccakf1600_src_out_of_range_error, e keccakf1600_start, e keccakf1600_state_chi_00, e keccakf1600_state_chi_01, e keccakf1600_state_chi_02, e keccakf1600_state_chi_03, e keccakf1600_state_chi_04, e keccakf1600_state_chi_10, e keccakf1600_state_chi_11, e keccakf1600_state_chi_12, e keccakf1600_state_chi_13, e keccakf1600_state_chi_14, e keccakf1600_state_chi_20, e keccakf1600_state_chi_21, e keccakf1600_state_chi_22, e keccakf1600_state_chi_23, e keccakf1600_state_chi_24, e keccakf1600_state_chi_30, e keccakf1600_state_chi_31, e keccakf1600_state_chi_32, e keccakf1600_state_chi_33, e keccakf1600_state_chi_34, e keccakf1600_state_chi_40, e keccakf1600_state_chi_41, e keccakf1600_state_chi_42, e keccakf1600_state_chi_43, e keccakf1600_state_chi_44, e keccakf1600_state_in_00, e keccakf1600_state_in_01, e keccakf1600_state_in_02, e keccakf1600_state_in_03, e keccakf1600_state_in_04, e keccakf1600_state_in_10, e keccakf1600_state_in_11, e keccakf1600_state_in_12, e keccakf1600_state_in_13, e keccakf1600_state_in_14, e keccakf1600_state_in_20, e keccakf1600_state_in_21, e keccakf1600_state_in_22, e keccakf1600_state_in_23, e keccakf1600_state_in_24, e keccakf1600_state_in_30, e keccakf1600_state_in_31, e keccakf1600_state_in_32, e keccakf1600_state_in_33, e keccakf1600_state_in_34, e keccakf1600_state_in_40, e keccakf1600_state_in_41, e keccakf1600_state_in_42, e keccakf1600_state_in_43, e keccakf1600_state_in_44, e keccakf1600_state_iota_00, e keccakf1600_state_pi_and_00, e keccakf1600_state_pi_and_01, e keccakf1600_state_pi_and_02, e keccakf1600_state_pi_and_03, e keccakf1600_state_pi_and_04, e keccakf1600_state_pi_and_10, e keccakf1600_state_pi_and_11, e keccakf1600_state_pi_and_12, e keccakf1600_state_pi_and_13, e keccakf1600_state_pi_and_14, e keccakf1600_state_pi_and_20, e keccakf1600_state_pi_and_21, e keccakf1600_state_pi_and_22, e keccakf1600_state_pi_and_23, e keccakf1600_state_pi_and_24, e keccakf1600_state_pi_and_30, e keccakf1600_state_pi_and_31, e keccakf1600_state_pi_and_32, e keccakf1600_state_pi_and_33, e keccakf1600_state_pi_and_34, e keccakf1600_state_pi_and_40, e keccakf1600_state_pi_and_41, e keccakf1600_state_pi_and_42, e keccakf1600_state_pi_and_43, e keccakf1600_state_pi_and_44, e keccakf1600_state_pi_not_00, e keccakf1600_state_pi_not_01, e keccakf1600_state_pi_not_02, e keccakf1600_state_pi_not_03, e keccakf1600_state_pi_not_04, e keccakf1600_state_pi_not_10, e keccakf1600_state_pi_not_11, e keccakf1600_state_pi_not_12, e keccakf1600_state_pi_not_13, e keccakf1600_state_pi_not_14, e keccakf1600_state_pi_not_20, e keccakf1600_state_pi_not_21, e keccakf1600_state_pi_not_22, e keccakf1600_state_pi_not_23, e keccakf1600_state_pi_not_24, e keccakf1600_state_pi_not_30, e keccakf1600_state_pi_not_31, e keccakf1600_state_pi_not_32, e keccakf1600_state_pi_not_33, e keccakf1600_state_pi_not_34, e keccakf1600_state_pi_not_40, e keccakf1600_state_pi_not_41, e keccakf1600_state_pi_not_42, e keccakf1600_state_pi_not_43, e keccakf1600_state_pi_not_44, e keccakf1600_state_rho_01, e keccakf1600_state_rho_02, e keccakf1600_state_rho_03, e keccakf1600_state_rho_04, e keccakf1600_state_rho_10, e keccakf1600_state_rho_11, e keccakf1600_state_rho_12, e keccakf1600_state_rho_13, e keccakf1600_state_rho_14, e keccakf1600_state_rho_20, e keccakf1600_state_rho_21, e keccakf1600_state_rho_22, e keccakf1600_state_rho_23, e keccakf1600_state_rho_24, e keccakf1600_state_rho_30, e keccakf1600_state_rho_31, e keccakf1600_state_rho_32, e keccakf1600_state_rho_33, e keccakf1600_state_rho_34, e keccakf1600_state_rho_40, e keccakf1600_state_rho_41, e keccakf1600_state_rho_42, e keccakf1600_state_rho_43, e keccakf1600_state_rho_44, e keccakf1600_state_theta_00, e keccakf1600_state_theta_01, e keccakf1600_state_theta_02, e keccakf1600_state_theta_03, e keccakf1600_state_theta_04, e keccakf1600_state_theta_10, e keccakf1600_state_theta_11, e keccakf1600_state_theta_12, e keccakf1600_state_theta_13, e keccakf1600_state_theta_14, e keccakf1600_state_theta_20, e keccakf1600_state_theta_21, e keccakf1600_state_theta_22, e keccakf1600_state_theta_23, e keccakf1600_state_theta_24, e keccakf1600_state_theta_30, e keccakf1600_state_theta_31, e keccakf1600_state_theta_32, e keccakf1600_state_theta_33, e keccakf1600_state_theta_34, e keccakf1600_state_theta_40, e keccakf1600_state_theta_41, e keccakf1600_state_theta_42, e keccakf1600_state_theta_43, e keccakf1600_state_theta_44, e keccakf1600_state_theta_hi_01, e keccakf1600_state_theta_hi_02, e keccakf1600_state_theta_hi_03, e keccakf1600_state_theta_hi_04, e keccakf1600_state_theta_hi_10, e keccakf1600_state_theta_hi_11, e keccakf1600_state_theta_hi_12, e keccakf1600_state_theta_hi_13, e keccakf1600_state_theta_hi_14, e keccakf1600_state_theta_hi_20, e keccakf1600_state_theta_hi_21, e keccakf1600_state_theta_hi_22, e keccakf1600_state_theta_hi_23, e keccakf1600_state_theta_hi_24, e keccakf1600_state_theta_hi_30, e keccakf1600_state_theta_hi_31, e keccakf1600_state_theta_hi_32, e keccakf1600_state_theta_hi_33, e keccakf1600_state_theta_hi_34, e keccakf1600_state_theta_hi_40, e keccakf1600_state_theta_hi_41, e keccakf1600_state_theta_hi_42, e keccakf1600_state_theta_hi_43, e keccakf1600_state_theta_hi_44, e keccakf1600_state_theta_low_01, e keccakf1600_state_theta_low_02, e keccakf1600_state_theta_low_03, e keccakf1600_state_theta_low_04, e keccakf1600_state_theta_low_10, e keccakf1600_state_theta_low_11, e keccakf1600_state_theta_low_12, e keccakf1600_state_theta_low_13, e keccakf1600_state_theta_low_14, e keccakf1600_state_theta_low_20, e keccakf1600_state_theta_low_21, e keccakf1600_state_theta_low_22, e keccakf1600_state_theta_low_23, e keccakf1600_state_theta_low_24, e keccakf1600_state_theta_low_30, e keccakf1600_state_theta_low_31, e keccakf1600_state_theta_low_32, e keccakf1600_state_theta_low_33, e keccakf1600_state_theta_low_34, e keccakf1600_state_theta_low_40, e keccakf1600_state_theta_low_41, e keccakf1600_state_theta_low_42, e keccakf1600_state_theta_low_43, e keccakf1600_state_theta_low_44, e keccakf1600_tag_error, e keccakf1600_theta_combined_xor_0, e keccakf1600_theta_combined_xor_1, e keccakf1600_theta_combined_xor_2, e keccakf1600_theta_combined_xor_3, e keccakf1600_theta_combined_xor_4, e keccakf1600_theta_xor_01, e keccakf1600_theta_xor_02, e keccakf1600_theta_xor_03, e keccakf1600_theta_xor_11, e keccakf1600_theta_xor_12, e keccakf1600_theta_xor_13, e keccakf1600_theta_xor_21, e keccakf1600_theta_xor_22, e keccakf1600_theta_xor_23, e keccakf1600_theta_xor_31, e keccakf1600_theta_xor_32, e keccakf1600_theta_xor_33, e keccakf1600_theta_xor_41, e keccakf1600_theta_xor_42, e keccakf1600_theta_xor_43, e keccakf1600_theta_xor_row_0, e keccakf1600_theta_xor_row_1, e keccakf1600_theta_xor_row_2, e keccakf1600_theta_xor_row_3, e keccakf1600_theta_xor_row_4, e keccakf1600_theta_xor_row_low63_0, e keccakf1600_theta_xor_row_low63_1, e keccakf1600_theta_xor_row_low63_2, e keccakf1600_theta_xor_row_low63_3, e keccakf1600_theta_xor_row_low63_4, e keccakf1600_theta_xor_row_msb_0, e keccakf1600_theta_xor_row_msb_1, e keccakf1600_theta_xor_row_msb_2, e keccakf1600_theta_xor_row_msb_3, e keccakf1600_theta_xor_row_msb_4, e keccakf1600_theta_xor_row_rotl1_0, e keccakf1600_theta_xor_row_rotl1_1, e keccakf1600_theta_xor_row_rotl1_2, e keccakf1600_theta_xor_row_rotl1_3, e keccakf1600_theta_xor_row_rotl1_4, e keccakf1600_thirty_two, e memory_address, e memory_clk, e memory_rw, e memory_sel, e memory_space_id, e memory_tag, e memory_value, e merkle_check_constant_2, e merkle_check_end, e merkle_check_index, e merkle_check_index_is_even, e merkle_check_path_len, e merkle_check_read_left_node, e merkle_check_read_node, e merkle_check_read_output_hash, e merkle_check_read_right_node, e merkle_check_read_root, e merkle_check_remaining_path_len_inv, e merkle_check_sel, e merkle_check_sibling, e merkle_check_start, e merkle_check_write, e merkle_check_write_left_node, e merkle_check_write_node, e merkle_check_write_output_hash, e merkle_check_write_right_node, e merkle_check_write_root, e note_hash_tree_check_address, e note_hash_tree_check_discard, e note_hash_tree_check_first_nullifier, e note_hash_tree_check_first_nullifier_pi_index, e note_hash_tree_check_leaf_index, e note_hash_tree_check_next_leaf_value, e note_hash_tree_check_next_root, e note_hash_tree_check_nonce, e note_hash_tree_check_nonce_separator, e note_hash_tree_check_note_hash, e note_hash_tree_check_note_hash_index, e note_hash_tree_check_note_hash_tree_height, e note_hash_tree_check_prev_leaf_value, e note_hash_tree_check_prev_root, e note_hash_tree_check_public_inputs_index, e note_hash_tree_check_sel, e note_hash_tree_check_should_silo, e note_hash_tree_check_should_unique, e note_hash_tree_check_should_write_to_public_inputs, e note_hash_tree_check_siloed_note_hash, e note_hash_tree_check_siloing_separator, e note_hash_tree_check_unique_note_hash, e note_hash_tree_check_unique_note_hash_separator, e note_hash_tree_check_write, e nullifier_check_address, e nullifier_check_discard, e nullifier_check_exists, e nullifier_check_intermediate_root, e nullifier_check_leaf_not_exists, e nullifier_check_low_leaf_hash, e nullifier_check_low_leaf_index, e nullifier_check_low_leaf_next_index, e nullifier_check_low_leaf_next_nullifier, e nullifier_check_low_leaf_nullifier, e nullifier_check_new_leaf_hash, e nullifier_check_next_nullifier_inv, e nullifier_check_next_nullifier_is_nonzero, e nullifier_check_nullifier, e nullifier_check_nullifier_index, e nullifier_check_nullifier_low_leaf_nullifier_diff_inv, e nullifier_check_public_inputs_index, e nullifier_check_root, e nullifier_check_sel, e nullifier_check_should_insert, e nullifier_check_should_silo, e nullifier_check_should_write_to_public_inputs, e nullifier_check_siloed_nullifier, e nullifier_check_siloing_separator, e nullifier_check_tree_height, e nullifier_check_tree_size_before_write, e nullifier_check_updated_low_leaf_hash, e nullifier_check_updated_low_leaf_next_index, e nullifier_check_updated_low_leaf_next_nullifier, e nullifier_check_write, e nullifier_check_write_root, e poseidon2_hash_a_0, e poseidon2_hash_a_1, e poseidon2_hash_a_2, e poseidon2_hash_a_3, e poseidon2_hash_b_0, e poseidon2_hash_b_1, e poseidon2_hash_b_2, e poseidon2_hash_b_3, e poseidon2_hash_end, e poseidon2_hash_input_0, e poseidon2_hash_input_1, e poseidon2_hash_input_2, e poseidon2_hash_input_len, e poseidon2_hash_num_perm_rounds_rem, e poseidon2_hash_num_perm_rounds_rem_inv, e poseidon2_hash_output, e poseidon2_hash_padding, e poseidon2_hash_sel, e poseidon2_hash_start, e poseidon2_perm_B_10_0, e poseidon2_perm_B_10_1, e poseidon2_perm_B_10_2, e poseidon2_perm_B_10_3, e poseidon2_perm_B_11_0, e poseidon2_perm_B_11_1, e poseidon2_perm_B_11_2, e poseidon2_perm_B_11_3, e poseidon2_perm_B_12_0, e poseidon2_perm_B_12_1, e poseidon2_perm_B_12_2, e poseidon2_perm_B_12_3, e poseidon2_perm_B_13_0, e poseidon2_perm_B_13_1, e poseidon2_perm_B_13_2, e poseidon2_perm_B_13_3, e poseidon2_perm_B_14_0, e poseidon2_perm_B_14_1, e poseidon2_perm_B_14_2, e poseidon2_perm_B_14_3, e poseidon2_perm_B_15_0, e poseidon2_perm_B_15_1, e poseidon2_perm_B_15_2, e poseidon2_perm_B_15_3, e poseidon2_perm_B_16_0, e poseidon2_perm_B_16_1, e poseidon2_perm_B_16_2, e poseidon2_perm_B_16_3, e poseidon2_perm_B_17_0, e poseidon2_perm_B_17_1, e poseidon2_perm_B_17_2, e poseidon2_perm_B_17_3, e poseidon2_perm_B_18_0, e poseidon2_perm_B_18_1, e poseidon2_perm_B_18_2, e poseidon2_perm_B_18_3, e poseidon2_perm_B_19_0, e poseidon2_perm_B_19_1, e poseidon2_perm_B_19_2, e poseidon2_perm_B_19_3, e poseidon2_perm_B_20_0, e poseidon2_perm_B_20_1, e poseidon2_perm_B_20_2, e poseidon2_perm_B_20_3, e poseidon2_perm_B_21_0, e poseidon2_perm_B_21_1, e poseidon2_perm_B_21_2, e poseidon2_perm_B_21_3, e poseidon2_perm_B_22_0, e poseidon2_perm_B_22_1, e poseidon2_perm_B_22_2, e poseidon2_perm_B_22_3, e poseidon2_perm_B_23_0, e poseidon2_perm_B_23_1, e poseidon2_perm_B_23_2, e poseidon2_perm_B_23_3, e poseidon2_perm_B_24_0, e poseidon2_perm_B_24_1, e poseidon2_perm_B_24_2, e poseidon2_perm_B_24_3, e poseidon2_perm_B_25_0, e poseidon2_perm_B_25_1, e poseidon2_perm_B_25_2, e poseidon2_perm_B_25_3, e poseidon2_perm_B_26_0, e poseidon2_perm_B_26_1, e poseidon2_perm_B_26_2, e poseidon2_perm_B_26_3, e poseidon2_perm_B_27_0, e poseidon2_perm_B_27_1, e poseidon2_perm_B_27_2, e poseidon2_perm_B_27_3, e poseidon2_perm_B_28_0, e poseidon2_perm_B_28_1, e poseidon2_perm_B_28_2, e poseidon2_perm_B_28_3, e poseidon2_perm_B_29_0, e poseidon2_perm_B_29_1, e poseidon2_perm_B_29_2, e poseidon2_perm_B_29_3, e poseidon2_perm_B_30_0, e poseidon2_perm_B_30_1, e poseidon2_perm_B_30_2, e poseidon2_perm_B_30_3, e poseidon2_perm_B_31_0, e poseidon2_perm_B_31_1, e poseidon2_perm_B_31_2, e poseidon2_perm_B_31_3, e poseidon2_perm_B_32_0, e poseidon2_perm_B_32_1, e poseidon2_perm_B_32_2, e poseidon2_perm_B_32_3, e poseidon2_perm_B_33_0, e poseidon2_perm_B_33_1, e poseidon2_perm_B_33_2, e poseidon2_perm_B_33_3, e poseidon2_perm_B_34_0, e poseidon2_perm_B_34_1, e poseidon2_perm_B_34_2, e poseidon2_perm_B_34_3, e poseidon2_perm_B_35_0, e poseidon2_perm_B_35_1, e poseidon2_perm_B_35_2, e poseidon2_perm_B_35_3, e poseidon2_perm_B_36_0, e poseidon2_perm_B_36_1, e poseidon2_perm_B_36_2, e poseidon2_perm_B_36_3, e poseidon2_perm_B_37_0, e poseidon2_perm_B_37_1, e poseidon2_perm_B_37_2, e poseidon2_perm_B_37_3, e poseidon2_perm_B_38_0, e poseidon2_perm_B_38_1, e poseidon2_perm_B_38_2, e poseidon2_perm_B_38_3, e poseidon2_perm_B_39_0, e poseidon2_perm_B_39_1, e poseidon2_perm_B_39_2, e poseidon2_perm_B_39_3, e poseidon2_perm_B_40_0, e poseidon2_perm_B_40_1, e poseidon2_perm_B_40_2, e poseidon2_perm_B_40_3, e poseidon2_perm_B_41_0, e poseidon2_perm_B_41_1, e poseidon2_perm_B_41_2, e poseidon2_perm_B_41_3, e poseidon2_perm_B_42_0, e poseidon2_perm_B_42_1, e poseidon2_perm_B_42_2, e poseidon2_perm_B_42_3, e poseidon2_perm_B_43_0, e poseidon2_perm_B_43_1, e poseidon2_perm_B_43_2, e poseidon2_perm_B_43_3, e poseidon2_perm_B_44_0, e poseidon2_perm_B_44_1, e poseidon2_perm_B_44_2, e poseidon2_perm_B_44_3, e poseidon2_perm_B_45_0, e poseidon2_perm_B_45_1, e poseidon2_perm_B_45_2, e poseidon2_perm_B_45_3, e poseidon2_perm_B_46_0, e poseidon2_perm_B_46_1, e poseidon2_perm_B_46_2, e poseidon2_perm_B_46_3, e poseidon2_perm_B_47_0, e poseidon2_perm_B_47_1, e poseidon2_perm_B_47_2, e poseidon2_perm_B_47_3, e poseidon2_perm_B_48_0, e poseidon2_perm_B_48_1, e poseidon2_perm_B_48_2, e poseidon2_perm_B_48_3, e poseidon2_perm_B_49_0, e poseidon2_perm_B_49_1, e poseidon2_perm_B_49_2, e poseidon2_perm_B_49_3, e poseidon2_perm_B_4_0, e poseidon2_perm_B_4_1, e poseidon2_perm_B_4_2, e poseidon2_perm_B_4_3, e poseidon2_perm_B_50_0, e poseidon2_perm_B_50_1, e poseidon2_perm_B_50_2, e poseidon2_perm_B_50_3, e poseidon2_perm_B_51_0, e poseidon2_perm_B_51_1, e poseidon2_perm_B_51_2, e poseidon2_perm_B_51_3, e poseidon2_perm_B_52_0, e poseidon2_perm_B_52_1, e poseidon2_perm_B_52_2, e poseidon2_perm_B_52_3, e poseidon2_perm_B_53_0, e poseidon2_perm_B_53_1, e poseidon2_perm_B_53_2, e poseidon2_perm_B_53_3, e poseidon2_perm_B_54_0, e poseidon2_perm_B_54_1, e poseidon2_perm_B_54_2, e poseidon2_perm_B_54_3, e poseidon2_perm_B_55_0, e poseidon2_perm_B_55_1, e poseidon2_perm_B_55_2, e poseidon2_perm_B_55_3, e poseidon2_perm_B_56_0, e poseidon2_perm_B_56_1, e poseidon2_perm_B_56_2, e poseidon2_perm_B_56_3, e poseidon2_perm_B_57_0, e poseidon2_perm_B_57_1, e poseidon2_perm_B_57_2, e poseidon2_perm_B_57_3, e poseidon2_perm_B_58_0, e poseidon2_perm_B_58_1, e poseidon2_perm_B_58_2, e poseidon2_perm_B_58_3, e poseidon2_perm_B_59_0, e poseidon2_perm_B_59_1, e poseidon2_perm_B_59_2, e poseidon2_perm_B_59_3, e poseidon2_perm_B_5_0, e poseidon2_perm_B_5_1, e poseidon2_perm_B_5_2, e poseidon2_perm_B_5_3, e poseidon2_perm_B_6_0, e poseidon2_perm_B_6_1, e poseidon2_perm_B_6_2, e poseidon2_perm_B_6_3, e poseidon2_perm_B_7_0, e poseidon2_perm_B_7_1, e poseidon2_perm_B_7_2, e poseidon2_perm_B_7_3, e poseidon2_perm_B_8_0, e poseidon2_perm_B_8_1, e poseidon2_perm_B_8_2, e poseidon2_perm_B_8_3, e poseidon2_perm_B_9_0, e poseidon2_perm_B_9_1, e poseidon2_perm_B_9_2, e poseidon2_perm_B_9_3, e poseidon2_perm_EXT_LAYER_4, e poseidon2_perm_EXT_LAYER_5, e poseidon2_perm_EXT_LAYER_6, e poseidon2_perm_EXT_LAYER_7, e poseidon2_perm_T_0_4, e poseidon2_perm_T_0_5, e poseidon2_perm_T_0_6, e poseidon2_perm_T_0_7, e poseidon2_perm_T_1_4, e poseidon2_perm_T_1_5, e poseidon2_perm_T_1_6, e poseidon2_perm_T_1_7, e poseidon2_perm_T_2_4, e poseidon2_perm_T_2_5, e poseidon2_perm_T_2_6, e poseidon2_perm_T_2_7, e poseidon2_perm_T_3_4, e poseidon2_perm_T_3_5, e poseidon2_perm_T_3_6, e poseidon2_perm_T_3_7, e poseidon2_perm_T_60_4, e poseidon2_perm_T_60_5, e poseidon2_perm_T_60_6, e poseidon2_perm_T_60_7, e poseidon2_perm_T_61_4, e poseidon2_perm_T_61_5, e poseidon2_perm_T_61_6, e poseidon2_perm_T_61_7, e poseidon2_perm_T_62_4, e poseidon2_perm_T_62_5, e poseidon2_perm_T_62_6, e poseidon2_perm_T_62_7, e poseidon2_perm_T_63_4, e poseidon2_perm_T_63_5, e poseidon2_perm_T_63_6, e poseidon2_perm_T_63_7, e poseidon2_perm_a_0, e poseidon2_perm_a_1, e poseidon2_perm_a_2, e poseidon2_perm_a_3, e poseidon2_perm_b_0, e poseidon2_perm_b_1, e poseidon2_perm_b_2, e poseidon2_perm_b_3, e poseidon2_perm_sel, e public_data_check_address, e public_data_check_clk, e public_data_check_clk_diff, e public_data_check_constant_32, e public_data_check_discard, e public_data_check_intermediate_root, e public_data_check_leaf_not_exists, e public_data_check_leaf_slot, e public_data_check_leaf_slot_low_leaf_slot_diff_inv, e public_data_check_low_leaf_hash, e public_data_check_low_leaf_index, e public_data_check_low_leaf_next_index, e public_data_check_low_leaf_next_slot, e public_data_check_low_leaf_slot, e public_data_check_low_leaf_value, e public_data_check_new_leaf_hash, e public_data_check_next_slot_inv, e public_data_check_next_slot_is_nonzero, e public_data_check_nondiscaded_write, e public_data_check_not_end, e public_data_check_root, e public_data_check_sel, e public_data_check_should_insert, e public_data_check_should_write_to_public_inputs, e public_data_check_siloing_separator, e public_data_check_slot, e public_data_check_tree_height, e public_data_check_tree_size_after_write, e public_data_check_tree_size_before_write, e public_data_check_updated_low_leaf_hash, e public_data_check_updated_low_leaf_next_index, e public_data_check_updated_low_leaf_next_slot, e public_data_check_updated_low_leaf_value, e public_data_check_value, e public_data_check_write, e public_data_check_write_idx, e public_data_check_write_root, e public_data_squash_check_clock, e public_data_squash_clk, e public_data_squash_clk_diff, e public_data_squash_constant_32, e public_data_squash_leaf_slot, e public_data_squash_leaf_slot_increase, e public_data_squash_sel, e public_data_squash_write_to_public_inputs, e range_check_dyn_diff, e range_check_dyn_rng_chk_bits, e range_check_dyn_rng_chk_pow_2, e range_check_is_lte_u112, e range_check_is_lte_u128, e range_check_is_lte_u16, e range_check_is_lte_u32, e range_check_is_lte_u48, e range_check_is_lte_u64, e range_check_is_lte_u80, e range_check_is_lte_u96, e range_check_rng_chk_bits, e range_check_sel, e range_check_sel_r0_16_bit_rng_lookup, e range_check_sel_r1_16_bit_rng_lookup, e range_check_sel_r2_16_bit_rng_lookup, e range_check_sel_r3_16_bit_rng_lookup, e range_check_sel_r4_16_bit_rng_lookup, e range_check_sel_r5_16_bit_rng_lookup, e range_check_sel_r6_16_bit_rng_lookup, e range_check_u16_r0, e range_check_u16_r1, e range_check_u16_r2, e range_check_u16_r3, e range_check_u16_r4, e range_check_u16_r5, e range_check_u16_r6, e range_check_u16_r7, e range_check_value, e scalar_mul_bit, e scalar_mul_bit_idx, e scalar_mul_bit_radix, e scalar_mul_end, e scalar_mul_not_end, e scalar_mul_point_inf, e scalar_mul_point_x, e scalar_mul_point_y, e scalar_mul_res_inf, e scalar_mul_res_x, e scalar_mul_res_y, e scalar_mul_scalar, e scalar_mul_sel, e scalar_mul_should_add, e scalar_mul_start, e scalar_mul_temp_inf, e scalar_mul_temp_x, e scalar_mul_temp_y, e sha256_a, e sha256_a_and_b, e sha256_a_and_b_xor_a_and_c, e sha256_a_and_c, e sha256_a_rotr_13, e sha256_a_rotr_2, e sha256_a_rotr_22, e sha256_a_rotr_2_xor_a_rotr_13, e sha256_and_sel, e sha256_b, e sha256_b_and_c, e sha256_c, e sha256_ch, e sha256_clk, e sha256_computed_w_lhs, e sha256_computed_w_rhs, e sha256_d, e sha256_e, e sha256_e_and_f, e sha256_e_rotr_11, e sha256_e_rotr_25, e sha256_e_rotr_6, e sha256_e_rotr_6_xor_e_rotr_11, e sha256_f, e sha256_g, e sha256_h, e sha256_helper_w0, e sha256_helper_w1, e sha256_helper_w10, e sha256_helper_w11, e sha256_helper_w12, e sha256_helper_w13, e sha256_helper_w14, e sha256_helper_w15, e sha256_helper_w2, e sha256_helper_w3, e sha256_helper_w4, e sha256_helper_w5, e sha256_helper_w6, e sha256_helper_w7, e sha256_helper_w8, e sha256_helper_w9, e sha256_init_a, e sha256_init_b, e sha256_init_c, e sha256_init_d, e sha256_init_e, e sha256_init_f, e sha256_init_g, e sha256_init_h, e sha256_input_offset, e sha256_is_input_round, e sha256_latch, e sha256_lhs_a_13, e sha256_lhs_a_2, e sha256_lhs_a_22, e sha256_lhs_e_11, e sha256_lhs_e_25, e sha256_lhs_e_6, e sha256_lhs_w_10, e sha256_lhs_w_17, e sha256_lhs_w_18, e sha256_lhs_w_19, e sha256_lhs_w_3, e sha256_lhs_w_7, e sha256_maj, e sha256_next_a_lhs, e sha256_next_a_rhs, e sha256_next_e_lhs, e sha256_next_e_rhs, e sha256_not_e, e sha256_not_e_and_g, e sha256_output_a_lhs, e sha256_output_a_rhs, e sha256_output_b_lhs, e sha256_output_b_rhs, e sha256_output_c_lhs, e sha256_output_c_rhs, e sha256_output_d_lhs, e sha256_output_d_rhs, e sha256_output_e_lhs, e sha256_output_e_rhs, e sha256_output_f_lhs, e sha256_output_f_rhs, e sha256_output_g_lhs, e sha256_output_g_rhs, e sha256_output_h_lhs, e sha256_output_h_rhs, e sha256_output_offset, e sha256_perform_round, e sha256_rhs_a_13, e sha256_rhs_a_2, e sha256_rhs_a_22, e sha256_rhs_e_11, e sha256_rhs_e_25, e sha256_rhs_e_6, e sha256_rhs_w_10, e sha256_rhs_w_17, e sha256_rhs_w_18, e sha256_rhs_w_19, e sha256_rhs_w_3, e sha256_rhs_w_7, e sha256_round_constant, e sha256_round_count, e sha256_rounds_remaining, e sha256_rounds_remaining_inv, e sha256_s_0, e sha256_s_1, e sha256_sel, e sha256_start, e sha256_state_offset, e sha256_w, e sha256_w_15_rotr_18, e sha256_w_15_rotr_7, e sha256_w_15_rotr_7_xor_w_15_rotr_18, e sha256_w_15_rshift_3, e sha256_w_2_rotr_17, e sha256_w_2_rotr_17_xor_w_2_rotr_19, e sha256_w_2_rotr_19, e sha256_w_2_rshift_10, e sha256_w_s_0, e sha256_w_s_1, e sha256_xor_sel, e to_radix_acc, e to_radix_acc_under_p, e to_radix_end, e to_radix_exponent, e to_radix_found, e to_radix_is_unsafe_limb, e to_radix_limb, e to_radix_limb_eq_p, e to_radix_limb_index, e to_radix_limb_lt_p, e to_radix_limb_p_diff, e to_radix_limb_radix_diff, e to_radix_not_end, e to_radix_not_padding_limb, e to_radix_p_limb, e to_radix_radix, e to_radix_rem_inverse, e to_radix_safe_limbs, e to_radix_safety_diff_inverse, e to_radix_sel, e to_radix_start, e to_radix_value, e tx_calldata_hash, e tx_context_id, e tx_contract_addr, e tx_da_gas_limit, e tx_discard, e tx_effective_fee_per_da_gas, e tx_effective_fee_per_l2_gas, e tx_end_gas_used_pi_offset, e tx_end_phase, e tx_fee, e tx_fee_juice_balance_slot, e tx_fee_juice_balances_slot, e tx_fee_juice_contract_address, e tx_fee_payer, e tx_fee_payer_balance, e tx_fee_payer_new_balance, e tx_fee_payer_pi_offset, e tx_is_collect_fee, e tx_is_l2_l1_msg_phase, e tx_is_padded, e tx_is_public_call_request, e tx_is_revertible, e tx_is_static, e tx_is_teardown_phase, e tx_is_tree_insert_phase, e tx_l2_gas_limit, e tx_l2_l1_msg_content, e tx_l2_l1_msg_contract_address, e tx_l2_l1_msg_recipient, e tx_leaf_value, e tx_msg_sender, e tx_next_context_id, e tx_next_da_gas_used, e tx_next_da_gas_used_sent_to_enqueued_call, e tx_next_l1_l2_tree_root, e tx_next_l1_l2_tree_size, e tx_next_l2_gas_used, e tx_next_l2_gas_used_sent_to_enqueued_call, e tx_next_note_hash_tree_root, e tx_next_note_hash_tree_size, e tx_next_nullifier_tree_root, e tx_next_nullifier_tree_size, e tx_next_num_note_hashes_emitted, e tx_next_num_nullifiers_emitted, e tx_next_num_pub_data_writes_emitted, e tx_next_public_data_tree_root, e tx_next_public_data_tree_size, e tx_num_l2_l1_msg_emitted, e tx_phase_value, e tx_prev_da_gas_used, e tx_prev_da_gas_used_sent_to_enqueued_call, e tx_prev_l1_l2_tree_root, e tx_prev_l1_l2_tree_size, e tx_prev_l2_gas_used, e tx_prev_l2_gas_used_sent_to_enqueued_call, e tx_prev_note_hash_tree_root, e tx_prev_note_hash_tree_size, e tx_prev_nullifier_tree_root, e tx_prev_nullifier_tree_size, e tx_prev_num_note_hashes_emitted, e tx_prev_num_nullifiers_emitted, e tx_prev_num_pub_data_writes_emitted, e tx_prev_public_data_tree_root, e tx_prev_public_data_tree_size, e tx_read_pi_length_offset, e tx_read_pi_offset, e tx_remaining_phase_counter, e tx_remaining_phase_inv, e tx_remaining_phase_minus_one_inv, e tx_reverted, e tx_sel, e tx_sel_non_revertible_append_note_hash, e tx_sel_non_revertible_append_nullifier, e tx_sel_read_phase_length, e tx_sel_revertible_append_note_hash, e tx_sel_revertible_append_nullifier, e tx_should_note_hash_append, e tx_should_nullifier_append, e tx_start_phase, e tx_successful_msg_emit, e tx_uint32_max, e tx_write_pi_offset, e update_check_address, e update_check_current_class_id, e update_check_deployer_protocol_contract_address, e update_check_hash_not_zero, e update_check_original_class_id, e update_check_public_data_tree_root, e update_check_public_leaf_index_domain_separator, e update_check_sel, e update_check_shared_mutable_hash_slot, e update_check_shared_mutable_slot, e update_check_timestamp, e update_check_timestamp_is_lt_timestamp_of_change, e update_check_timestamp_of_change, e update_check_timestamp_of_change_bit_size, e update_check_timestamp_of_change_subtraction, e update_check_update_hash, e update_check_update_hash_inv, e update_check_update_hi_metadata, e update_check_update_hi_metadata_bit_size, e update_check_update_post_class_id_is_zero, e update_check_update_post_class_inv, e update_check_update_pre_class_id_is_zero, e update_check_update_pre_class_inv, e update_check_update_preimage_metadata, e update_check_update_preimage_post_class_id, e update_check_update_preimage_pre_class_id, e update_check_updated_class_ids_slot, e lookup_range_check_dyn_rng_chk_pow_2_counts, e lookup_range_check_dyn_diff_is_u16_counts, e lookup_range_check_r0_is_u16_counts, e lookup_range_check_r1_is_u16_counts, e lookup_range_check_r2_is_u16_counts, e lookup_range_check_r3_is_u16_counts, e lookup_range_check_r4_is_u16_counts, e lookup_range_check_r5_is_u16_counts, e lookup_range_check_r6_is_u16_counts, e lookup_range_check_r7_is_u16_counts, e lookup_ff_gt_a_lo_range_counts, e lookup_ff_gt_a_hi_range_counts, e lookup_alu_register_tag_value_counts, e lookup_alu_tag_max_bits_value_counts, e lookup_alu_ff_lt_counts, e lookup_alu_lt_range_counts, e lookup_bitwise_integral_tag_length_counts, e lookup_bitwise_byte_operations_counts, e lookup_bitwise_dispatch_exec_bitwise_counts, e lookup_keccak_memory_slice_to_mem_counts, e lookup_keccakf1600_theta_xor_01_counts, e lookup_keccakf1600_theta_xor_02_counts, e lookup_keccakf1600_theta_xor_03_counts, e lookup_keccakf1600_theta_xor_row_0_counts, e lookup_keccakf1600_theta_xor_11_counts, e lookup_keccakf1600_theta_xor_12_counts, e lookup_keccakf1600_theta_xor_13_counts, e lookup_keccakf1600_theta_xor_row_1_counts, e lookup_keccakf1600_theta_xor_21_counts, e lookup_keccakf1600_theta_xor_22_counts, e lookup_keccakf1600_theta_xor_23_counts, e lookup_keccakf1600_theta_xor_row_2_counts, e lookup_keccakf1600_theta_xor_31_counts, e lookup_keccakf1600_theta_xor_32_counts, e lookup_keccakf1600_theta_xor_33_counts, e lookup_keccakf1600_theta_xor_row_3_counts, e lookup_keccakf1600_theta_xor_41_counts, e lookup_keccakf1600_theta_xor_42_counts, e lookup_keccakf1600_theta_xor_43_counts, e lookup_keccakf1600_theta_xor_row_4_counts, e lookup_keccakf1600_theta_combined_xor_0_counts, e lookup_keccakf1600_theta_combined_xor_1_counts, e lookup_keccakf1600_theta_combined_xor_2_counts, e lookup_keccakf1600_theta_combined_xor_3_counts, e lookup_keccakf1600_theta_combined_xor_4_counts, e lookup_keccakf1600_state_theta_00_counts, e lookup_keccakf1600_state_theta_01_counts, e lookup_keccakf1600_state_theta_02_counts, e lookup_keccakf1600_state_theta_03_counts, e lookup_keccakf1600_state_theta_04_counts, e lookup_keccakf1600_state_theta_10_counts, e lookup_keccakf1600_state_theta_11_counts, e lookup_keccakf1600_state_theta_12_counts, e lookup_keccakf1600_state_theta_13_counts, e lookup_keccakf1600_state_theta_14_counts, e lookup_keccakf1600_state_theta_20_counts, e lookup_keccakf1600_state_theta_21_counts, e lookup_keccakf1600_state_theta_22_counts, e lookup_keccakf1600_state_theta_23_counts, e lookup_keccakf1600_state_theta_24_counts, e lookup_keccakf1600_state_theta_30_counts, e lookup_keccakf1600_state_theta_31_counts, e lookup_keccakf1600_state_theta_32_counts, e lookup_keccakf1600_state_theta_33_counts, e lookup_keccakf1600_state_theta_34_counts, e lookup_keccakf1600_state_theta_40_counts, e lookup_keccakf1600_state_theta_41_counts, e lookup_keccakf1600_state_theta_42_counts, e lookup_keccakf1600_state_theta_43_counts, e lookup_keccakf1600_state_theta_44_counts, e lookup_keccakf1600_theta_limb_02_range_counts, e lookup_keccakf1600_theta_limb_04_range_counts, e lookup_keccakf1600_theta_limb_10_range_counts, e lookup_keccakf1600_theta_limb_12_range_counts, e lookup_keccakf1600_theta_limb_14_range_counts, e lookup_keccakf1600_theta_limb_21_range_counts, e lookup_keccakf1600_theta_limb_23_range_counts, e lookup_keccakf1600_theta_limb_30_range_counts, e lookup_keccakf1600_theta_limb_32_range_counts, e lookup_keccakf1600_theta_limb_33_range_counts, e lookup_keccakf1600_theta_limb_40_range_counts, e lookup_keccakf1600_theta_limb_41_range_counts, e lookup_keccakf1600_theta_limb_43_range_counts, e lookup_keccakf1600_theta_limb_44_range_counts, e lookup_keccakf1600_theta_limb_01_range_counts, e lookup_keccakf1600_theta_limb_03_range_counts, e lookup_keccakf1600_theta_limb_11_range_counts, e lookup_keccakf1600_theta_limb_13_range_counts, e lookup_keccakf1600_theta_limb_20_range_counts, e lookup_keccakf1600_theta_limb_22_range_counts, e lookup_keccakf1600_theta_limb_24_range_counts, e lookup_keccakf1600_theta_limb_31_range_counts, e lookup_keccakf1600_theta_limb_34_range_counts, e lookup_keccakf1600_theta_limb_42_range_counts, e lookup_keccakf1600_state_pi_and_00_counts, e lookup_keccakf1600_state_pi_and_01_counts, e lookup_keccakf1600_state_pi_and_02_counts, e lookup_keccakf1600_state_pi_and_03_counts, e lookup_keccakf1600_state_pi_and_04_counts, e lookup_keccakf1600_state_pi_and_10_counts, e lookup_keccakf1600_state_pi_and_11_counts, e lookup_keccakf1600_state_pi_and_12_counts, e lookup_keccakf1600_state_pi_and_13_counts, e lookup_keccakf1600_state_pi_and_14_counts, e lookup_keccakf1600_state_pi_and_20_counts, e lookup_keccakf1600_state_pi_and_21_counts, e lookup_keccakf1600_state_pi_and_22_counts, e lookup_keccakf1600_state_pi_and_23_counts, e lookup_keccakf1600_state_pi_and_24_counts, e lookup_keccakf1600_state_pi_and_30_counts, e lookup_keccakf1600_state_pi_and_31_counts, e lookup_keccakf1600_state_pi_and_32_counts, e lookup_keccakf1600_state_pi_and_33_counts, e lookup_keccakf1600_state_pi_and_34_counts, e lookup_keccakf1600_state_pi_and_40_counts, e lookup_keccakf1600_state_pi_and_41_counts, e lookup_keccakf1600_state_pi_and_42_counts, e lookup_keccakf1600_state_pi_and_43_counts, e lookup_keccakf1600_state_pi_and_44_counts, e lookup_keccakf1600_state_chi_00_counts, e lookup_keccakf1600_state_chi_01_counts, e lookup_keccakf1600_state_chi_02_counts, e lookup_keccakf1600_state_chi_03_counts, e lookup_keccakf1600_state_chi_04_counts, e lookup_keccakf1600_state_chi_10_counts, e lookup_keccakf1600_state_chi_11_counts, e lookup_keccakf1600_state_chi_12_counts, e lookup_keccakf1600_state_chi_13_counts, e lookup_keccakf1600_state_chi_14_counts, e lookup_keccakf1600_state_chi_20_counts, e lookup_keccakf1600_state_chi_21_counts, e lookup_keccakf1600_state_chi_22_counts, e lookup_keccakf1600_state_chi_23_counts, e lookup_keccakf1600_state_chi_24_counts, e lookup_keccakf1600_state_chi_30_counts, e lookup_keccakf1600_state_chi_31_counts, e lookup_keccakf1600_state_chi_32_counts, e lookup_keccakf1600_state_chi_33_counts, e lookup_keccakf1600_state_chi_34_counts, e lookup_keccakf1600_state_chi_40_counts, e lookup_keccakf1600_state_chi_41_counts, e lookup_keccakf1600_state_chi_42_counts, e lookup_keccakf1600_state_chi_43_counts, e lookup_keccakf1600_state_chi_44_counts, e lookup_keccakf1600_round_cst_counts, e lookup_keccakf1600_state_iota_00_counts, e lookup_keccakf1600_src_abs_diff_positive_counts, e lookup_keccakf1600_dst_abs_diff_positive_counts, e lookup_sha256_round_constant_counts, e lookup_poseidon2_hash_poseidon2_perm_counts, e lookup_to_radix_limb_range_counts, e lookup_to_radix_limb_less_than_radix_range_counts, e lookup_to_radix_fetch_safe_limbs_counts, e lookup_to_radix_fetch_p_limb_counts, e lookup_to_radix_limb_p_diff_range_counts, e lookup_scalar_mul_to_radix_counts, e lookup_scalar_mul_double_counts, e lookup_scalar_mul_add_counts, e lookup_context_ctx_stack_call_counts, e lookup_context_ctx_stack_rollback_counts, e lookup_context_ctx_stack_return_counts, e lookup_calldata_hashing_cd_hash_counts, e lookup_calldata_hashing_cd_hash_end_counts, e lookup_data_copy_range_max_read_size_diff_counts, e lookup_data_copy_range_read_counts, e lookup_data_copy_range_write_counts, e lookup_data_copy_range_reads_left_counts, e lookup_data_copy_mem_write_counts, e lookup_data_copy_mem_read_counts, e lookup_data_copy_col_read_counts, e lookup_addressing_base_address_from_memory_counts, e lookup_addressing_relative_overflow_range_0_counts, e lookup_addressing_relative_overflow_range_1_counts, e lookup_addressing_relative_overflow_range_2_counts, e lookup_addressing_relative_overflow_range_3_counts, e lookup_addressing_relative_overflow_range_4_counts, e lookup_addressing_relative_overflow_range_5_counts, e lookup_addressing_relative_overflow_range_6_counts, e lookup_addressing_indirect_from_memory_0_counts, e lookup_addressing_indirect_from_memory_1_counts, e lookup_addressing_indirect_from_memory_2_counts, e lookup_addressing_indirect_from_memory_3_counts, e lookup_addressing_indirect_from_memory_4_counts, e lookup_addressing_indirect_from_memory_5_counts, e lookup_addressing_indirect_from_memory_6_counts, e lookup_registers_mem_op_0_counts, e lookup_registers_mem_op_1_counts, e lookup_registers_mem_op_2_counts, e lookup_registers_mem_op_3_counts, e lookup_registers_mem_op_4_counts, e lookup_registers_mem_op_5_counts, e lookup_registers_mem_op_6_counts, e lookup_gas_addressing_gas_read_counts, e lookup_gas_limit_used_l2_range_counts, e lookup_gas_limit_used_da_range_counts, e lookup_merkle_check_merkle_poseidon2_read_counts, e lookup_merkle_check_merkle_poseidon2_write_counts, e lookup_nullifier_check_silo_poseidon2_counts, e lookup_nullifier_check_low_leaf_poseidon2_counts, e lookup_nullifier_check_updated_low_leaf_poseidon2_counts, e lookup_nullifier_check_low_leaf_merkle_check_counts, e lookup_nullifier_check_low_leaf_nullifier_validation_counts, e lookup_nullifier_check_low_leaf_next_nullifier_validation_counts, e lookup_nullifier_check_new_leaf_poseidon2_counts, e lookup_nullifier_check_new_leaf_merkle_check_counts, e lookup_nullifier_check_write_nullifier_to_public_inputs_counts, e lookup_public_data_check_silo_poseidon2_counts, e lookup_public_data_check_low_leaf_slot_validation_counts, e lookup_public_data_check_low_leaf_next_slot_validation_counts, e lookup_public_data_check_low_leaf_poseidon2_0_counts, e lookup_public_data_check_low_leaf_poseidon2_1_counts, e lookup_public_data_check_updated_low_leaf_poseidon2_0_counts, e lookup_public_data_check_updated_low_leaf_poseidon2_1_counts, e lookup_public_data_check_low_leaf_merkle_check_counts, e lookup_public_data_check_new_leaf_poseidon2_0_counts, e lookup_public_data_check_new_leaf_poseidon2_1_counts, e lookup_public_data_check_new_leaf_merkle_check_counts, e lookup_public_data_check_write_public_data_to_public_inputs_counts, e lookup_address_derivation_salted_initialization_hash_poseidon2_0_counts, e lookup_address_derivation_salted_initialization_hash_poseidon2_1_counts, e lookup_address_derivation_partial_address_poseidon2_counts, e lookup_address_derivation_public_keys_hash_poseidon2_0_counts, e lookup_address_derivation_public_keys_hash_poseidon2_1_counts, e lookup_address_derivation_public_keys_hash_poseidon2_2_counts, e lookup_address_derivation_public_keys_hash_poseidon2_3_counts, e lookup_address_derivation_public_keys_hash_poseidon2_4_counts, e lookup_address_derivation_preaddress_poseidon2_counts, e lookup_address_derivation_preaddress_scalar_mul_counts, e lookup_address_derivation_address_ecadd_counts, e lookup_bc_decomposition_bytes_are_bytes_counts, e lookup_bc_decomposition_abs_diff_is_u16_counts, e lookup_bc_hashing_get_packed_field_counts, e lookup_bc_hashing_iv_is_len_counts, e lookup_update_check_shared_mutable_slot_poseidon2_counts, e lookup_update_check_update_hash_public_data_read_counts, e lookup_update_check_update_hash_poseidon2_counts, e lookup_update_check_update_hi_metadata_range_counts, e lookup_update_check_update_lo_metadata_range_counts, e lookup_update_check_timestamp_of_change_cmp_range_counts, e lookup_bc_retrieval_deployment_nullifier_read_counts, e lookup_bc_retrieval_address_derivation_counts, e lookup_bc_retrieval_update_check_counts, e lookup_bc_retrieval_class_id_derivation_counts, e lookup_instr_fetching_pc_abs_diff_positive_counts, e lookup_instr_fetching_instr_abs_diff_positive_counts, e lookup_instr_fetching_tag_value_validation_counts, e lookup_instr_fetching_bytecode_size_from_bc_dec_counts, e lookup_instr_fetching_bytes_from_bc_dec_counts, e lookup_instr_fetching_wire_instruction_info_counts, e lookup_class_id_derivation_class_id_poseidon2_0_counts, e lookup_class_id_derivation_class_id_poseidon2_1_counts, e lookup_get_env_var_precomputed_info_counts, e lookup_get_env_var_read_from_public_inputs_col0_counts, e lookup_get_env_var_read_from_public_inputs_col1_counts, e lookup_internal_call_push_call_stack_counts, e lookup_internal_call_unwind_call_stack_counts, e lookup_external_call_call_allocated_left_l2_range_counts, e lookup_external_call_call_allocated_left_da_range_counts, e lookup_execution_bytecode_retrieval_result_counts, e lookup_execution_instruction_fetching_result_counts, e lookup_execution_instruction_fetching_body_counts, e lookup_execution_exec_spec_read_counts, e lookup_execution_dyn_l2_factor_bitwise_counts, e lookup_note_hash_tree_check_silo_poseidon2_counts, e lookup_note_hash_tree_check_read_first_nullifier_counts, e lookup_note_hash_tree_check_nonce_computation_poseidon2_counts, e lookup_note_hash_tree_check_unique_note_hash_poseidon2_counts, e lookup_note_hash_tree_check_merkle_check_counts, e lookup_note_hash_tree_check_write_note_hash_to_public_inputs_counts, e lookup_tx_read_phase_table_counts, e lookup_tx_phase_jump_on_revert_counts, e lookup_tx_read_phase_length_counts, e lookup_tx_read_public_call_request_phase_counts, e lookup_tx_read_tree_insert_value_counts, e lookup_tx_note_hash_append_counts, e lookup_tx_nullifier_append_counts, e lookup_tx_read_l2_l1_msg_counts, e lookup_tx_write_l2_l1_msg_counts, e lookup_tx_read_effective_fee_public_inputs_counts, e lookup_tx_read_fee_payer_public_inputs_counts, e lookup_tx_balance_slot_poseidon2_counts, e lookup_tx_balance_validation_counts #define AVM2_DERIVED_WITNESS_ENTITIES_E(e) e perm_keccakf1600_read_to_slice_inv, e perm_keccakf1600_write_to_slice_inv, e perm_public_data_check_squashing_inv, e perm_execution_dispatch_keccakf1600_inv, e lookup_range_check_dyn_rng_chk_pow_2_inv, e lookup_range_check_dyn_diff_is_u16_inv, e lookup_range_check_r0_is_u16_inv, e lookup_range_check_r1_is_u16_inv, e lookup_range_check_r2_is_u16_inv, e lookup_range_check_r3_is_u16_inv, e lookup_range_check_r4_is_u16_inv, e lookup_range_check_r5_is_u16_inv, e lookup_range_check_r6_is_u16_inv, e lookup_range_check_r7_is_u16_inv, e lookup_ff_gt_a_lo_range_inv, e lookup_ff_gt_a_hi_range_inv, e lookup_alu_register_tag_value_inv, e lookup_alu_tag_max_bits_value_inv, e lookup_alu_ff_lt_inv, e lookup_alu_lt_range_inv, e lookup_bitwise_integral_tag_length_inv, e lookup_bitwise_byte_operations_inv, e lookup_bitwise_dispatch_exec_bitwise_inv, e lookup_keccak_memory_slice_to_mem_inv, e lookup_keccakf1600_theta_xor_01_inv, e lookup_keccakf1600_theta_xor_02_inv, e lookup_keccakf1600_theta_xor_03_inv, e lookup_keccakf1600_theta_xor_row_0_inv, e lookup_keccakf1600_theta_xor_11_inv, e lookup_keccakf1600_theta_xor_12_inv, e lookup_keccakf1600_theta_xor_13_inv, e lookup_keccakf1600_theta_xor_row_1_inv, e lookup_keccakf1600_theta_xor_21_inv, e lookup_keccakf1600_theta_xor_22_inv, e lookup_keccakf1600_theta_xor_23_inv, e lookup_keccakf1600_theta_xor_row_2_inv, e lookup_keccakf1600_theta_xor_31_inv, e lookup_keccakf1600_theta_xor_32_inv, e lookup_keccakf1600_theta_xor_33_inv, e lookup_keccakf1600_theta_xor_row_3_inv, e lookup_keccakf1600_theta_xor_41_inv, e lookup_keccakf1600_theta_xor_42_inv, e lookup_keccakf1600_theta_xor_43_inv, e lookup_keccakf1600_theta_xor_row_4_inv, e lookup_keccakf1600_theta_combined_xor_0_inv, e lookup_keccakf1600_theta_combined_xor_1_inv, e lookup_keccakf1600_theta_combined_xor_2_inv, e lookup_keccakf1600_theta_combined_xor_3_inv, e lookup_keccakf1600_theta_combined_xor_4_inv, e lookup_keccakf1600_state_theta_00_inv, e lookup_keccakf1600_state_theta_01_inv, e lookup_keccakf1600_state_theta_02_inv, e lookup_keccakf1600_state_theta_03_inv, e lookup_keccakf1600_state_theta_04_inv, e lookup_keccakf1600_state_theta_10_inv, e lookup_keccakf1600_state_theta_11_inv, e lookup_keccakf1600_state_theta_12_inv, e lookup_keccakf1600_state_theta_13_inv, e lookup_keccakf1600_state_theta_14_inv, e lookup_keccakf1600_state_theta_20_inv, e lookup_keccakf1600_state_theta_21_inv, e lookup_keccakf1600_state_theta_22_inv, e lookup_keccakf1600_state_theta_23_inv, e lookup_keccakf1600_state_theta_24_inv, e lookup_keccakf1600_state_theta_30_inv, e lookup_keccakf1600_state_theta_31_inv, e lookup_keccakf1600_state_theta_32_inv, e lookup_keccakf1600_state_theta_33_inv, e lookup_keccakf1600_state_theta_34_inv, e lookup_keccakf1600_state_theta_40_inv, e lookup_keccakf1600_state_theta_41_inv, e lookup_keccakf1600_state_theta_42_inv, e lookup_keccakf1600_state_theta_43_inv, e lookup_keccakf1600_state_theta_44_inv, e lookup_keccakf1600_theta_limb_02_range_inv, e lookup_keccakf1600_theta_limb_04_range_inv, e lookup_keccakf1600_theta_limb_10_range_inv, e lookup_keccakf1600_theta_limb_12_range_inv, e lookup_keccakf1600_theta_limb_14_range_inv, e lookup_keccakf1600_theta_limb_21_range_inv, e lookup_keccakf1600_theta_limb_23_range_inv, e lookup_keccakf1600_theta_limb_30_range_inv, e lookup_keccakf1600_theta_limb_32_range_inv, e lookup_keccakf1600_theta_limb_33_range_inv, e lookup_keccakf1600_theta_limb_40_range_inv, e lookup_keccakf1600_theta_limb_41_range_inv, e lookup_keccakf1600_theta_limb_43_range_inv, e lookup_keccakf1600_theta_limb_44_range_inv, e lookup_keccakf1600_theta_limb_01_range_inv, e lookup_keccakf1600_theta_limb_03_range_inv, e lookup_keccakf1600_theta_limb_11_range_inv, e lookup_keccakf1600_theta_limb_13_range_inv, e lookup_keccakf1600_theta_limb_20_range_inv, e lookup_keccakf1600_theta_limb_22_range_inv, e lookup_keccakf1600_theta_limb_24_range_inv, e lookup_keccakf1600_theta_limb_31_range_inv, e lookup_keccakf1600_theta_limb_34_range_inv, e lookup_keccakf1600_theta_limb_42_range_inv, e lookup_keccakf1600_state_pi_and_00_inv, e lookup_keccakf1600_state_pi_and_01_inv, e lookup_keccakf1600_state_pi_and_02_inv, e lookup_keccakf1600_state_pi_and_03_inv, e lookup_keccakf1600_state_pi_and_04_inv, e lookup_keccakf1600_state_pi_and_10_inv, e lookup_keccakf1600_state_pi_and_11_inv, e lookup_keccakf1600_state_pi_and_12_inv, e lookup_keccakf1600_state_pi_and_13_inv, e lookup_keccakf1600_state_pi_and_14_inv, e lookup_keccakf1600_state_pi_and_20_inv, e lookup_keccakf1600_state_pi_and_21_inv, e lookup_keccakf1600_state_pi_and_22_inv, e lookup_keccakf1600_state_pi_and_23_inv, e lookup_keccakf1600_state_pi_and_24_inv, e lookup_keccakf1600_state_pi_and_30_inv, e lookup_keccakf1600_state_pi_and_31_inv, e lookup_keccakf1600_state_pi_and_32_inv, e lookup_keccakf1600_state_pi_and_33_inv, e lookup_keccakf1600_state_pi_and_34_inv, e lookup_keccakf1600_state_pi_and_40_inv, e lookup_keccakf1600_state_pi_and_41_inv, e lookup_keccakf1600_state_pi_and_42_inv, e lookup_keccakf1600_state_pi_and_43_inv, e lookup_keccakf1600_state_pi_and_44_inv, e lookup_keccakf1600_state_chi_00_inv, e lookup_keccakf1600_state_chi_01_inv, e lookup_keccakf1600_state_chi_02_inv, e lookup_keccakf1600_state_chi_03_inv, e lookup_keccakf1600_state_chi_04_inv, e lookup_keccakf1600_state_chi_10_inv, e lookup_keccakf1600_state_chi_11_inv, e lookup_keccakf1600_state_chi_12_inv, e lookup_keccakf1600_state_chi_13_inv, e lookup_keccakf1600_state_chi_14_inv, e lookup_keccakf1600_state_chi_20_inv, e lookup_keccakf1600_state_chi_21_inv, e lookup_keccakf1600_state_chi_22_inv, e lookup_keccakf1600_state_chi_23_inv, e lookup_keccakf1600_state_chi_24_inv, e lookup_keccakf1600_state_chi_30_inv, e lookup_keccakf1600_state_chi_31_inv, e lookup_keccakf1600_state_chi_32_inv, e lookup_keccakf1600_state_chi_33_inv, e lookup_keccakf1600_state_chi_34_inv, e lookup_keccakf1600_state_chi_40_inv, e lookup_keccakf1600_state_chi_41_inv, e lookup_keccakf1600_state_chi_42_inv, e lookup_keccakf1600_state_chi_43_inv, e lookup_keccakf1600_state_chi_44_inv, e lookup_keccakf1600_round_cst_inv, e lookup_keccakf1600_state_iota_00_inv, e lookup_keccakf1600_src_abs_diff_positive_inv, e lookup_keccakf1600_dst_abs_diff_positive_inv, e lookup_sha256_round_constant_inv, e lookup_poseidon2_hash_poseidon2_perm_inv, e lookup_to_radix_limb_range_inv, e lookup_to_radix_limb_less_than_radix_range_inv, e lookup_to_radix_fetch_safe_limbs_inv, e lookup_to_radix_fetch_p_limb_inv, e lookup_to_radix_limb_p_diff_range_inv, e lookup_scalar_mul_to_radix_inv, e lookup_scalar_mul_double_inv, e lookup_scalar_mul_add_inv, e lookup_context_ctx_stack_call_inv, e lookup_context_ctx_stack_rollback_inv, e lookup_context_ctx_stack_return_inv, e lookup_calldata_hashing_cd_hash_inv, e lookup_calldata_hashing_cd_hash_end_inv, e lookup_data_copy_range_max_read_size_diff_inv, e lookup_data_copy_range_read_inv, e lookup_data_copy_range_write_inv, e lookup_data_copy_range_reads_left_inv, e lookup_data_copy_mem_write_inv, e lookup_data_copy_mem_read_inv, e lookup_data_copy_col_read_inv, e lookup_addressing_base_address_from_memory_inv, e lookup_addressing_relative_overflow_range_0_inv, e lookup_addressing_relative_overflow_range_1_inv, e lookup_addressing_relative_overflow_range_2_inv, e lookup_addressing_relative_overflow_range_3_inv, e lookup_addressing_relative_overflow_range_4_inv, e lookup_addressing_relative_overflow_range_5_inv, e lookup_addressing_relative_overflow_range_6_inv, e lookup_addressing_indirect_from_memory_0_inv, e lookup_addressing_indirect_from_memory_1_inv, e lookup_addressing_indirect_from_memory_2_inv, e lookup_addressing_indirect_from_memory_3_inv, e lookup_addressing_indirect_from_memory_4_inv, e lookup_addressing_indirect_from_memory_5_inv, e lookup_addressing_indirect_from_memory_6_inv, e lookup_registers_mem_op_0_inv, e lookup_registers_mem_op_1_inv, e lookup_registers_mem_op_2_inv, e lookup_registers_mem_op_3_inv, e lookup_registers_mem_op_4_inv, e lookup_registers_mem_op_5_inv, e lookup_registers_mem_op_6_inv, e lookup_gas_addressing_gas_read_inv, e lookup_gas_limit_used_l2_range_inv, e lookup_gas_limit_used_da_range_inv, e lookup_merkle_check_merkle_poseidon2_read_inv, e lookup_merkle_check_merkle_poseidon2_write_inv, e lookup_nullifier_check_silo_poseidon2_inv, e lookup_nullifier_check_low_leaf_poseidon2_inv, e lookup_nullifier_check_updated_low_leaf_poseidon2_inv, e lookup_nullifier_check_low_leaf_merkle_check_inv, e lookup_nullifier_check_low_leaf_nullifier_validation_inv, e lookup_nullifier_check_low_leaf_next_nullifier_validation_inv, e lookup_nullifier_check_new_leaf_poseidon2_inv, e lookup_nullifier_check_new_leaf_merkle_check_inv, e lookup_nullifier_check_write_nullifier_to_public_inputs_inv, e lookup_public_data_check_silo_poseidon2_inv, e lookup_public_data_check_low_leaf_slot_validation_inv, e lookup_public_data_check_low_leaf_next_slot_validation_inv, e lookup_public_data_check_low_leaf_poseidon2_0_inv, e lookup_public_data_check_low_leaf_poseidon2_1_inv, e lookup_public_data_check_updated_low_leaf_poseidon2_0_inv, e lookup_public_data_check_updated_low_leaf_poseidon2_1_inv, e lookup_public_data_check_low_leaf_merkle_check_inv, e lookup_public_data_check_new_leaf_poseidon2_0_inv, e lookup_public_data_check_new_leaf_poseidon2_1_inv, e lookup_public_data_check_new_leaf_merkle_check_inv, e lookup_public_data_check_write_public_data_to_public_inputs_inv, e lookup_address_derivation_salted_initialization_hash_poseidon2_0_inv, e lookup_address_derivation_salted_initialization_hash_poseidon2_1_inv, e lookup_address_derivation_partial_address_poseidon2_inv, e lookup_address_derivation_public_keys_hash_poseidon2_0_inv, e lookup_address_derivation_public_keys_hash_poseidon2_1_inv, e lookup_address_derivation_public_keys_hash_poseidon2_2_inv, e lookup_address_derivation_public_keys_hash_poseidon2_3_inv, e lookup_address_derivation_public_keys_hash_poseidon2_4_inv, e lookup_address_derivation_preaddress_poseidon2_inv, e lookup_address_derivation_preaddress_scalar_mul_inv, e lookup_address_derivation_address_ecadd_inv, e lookup_bc_decomposition_bytes_are_bytes_inv, e lookup_bc_decomposition_abs_diff_is_u16_inv, e lookup_bc_hashing_get_packed_field_inv, e lookup_bc_hashing_iv_is_len_inv, e lookup_update_check_shared_mutable_slot_poseidon2_inv, e lookup_update_check_update_hash_public_data_read_inv, e lookup_update_check_update_hash_poseidon2_inv, e lookup_update_check_update_hi_metadata_range_inv, e lookup_update_check_update_lo_metadata_range_inv, e lookup_update_check_timestamp_of_change_cmp_range_inv, e lookup_bc_retrieval_deployment_nullifier_read_inv, e lookup_bc_retrieval_address_derivation_inv, e lookup_bc_retrieval_update_check_inv, e lookup_bc_retrieval_class_id_derivation_inv, e lookup_instr_fetching_pc_abs_diff_positive_inv, e lookup_instr_fetching_instr_abs_diff_positive_inv, e lookup_instr_fetching_tag_value_validation_inv, e lookup_instr_fetching_bytecode_size_from_bc_dec_inv, e lookup_instr_fetching_bytes_from_bc_dec_inv, e lookup_instr_fetching_wire_instruction_info_inv, e lookup_class_id_derivation_class_id_poseidon2_0_inv, e lookup_class_id_derivation_class_id_poseidon2_1_inv, e lookup_get_env_var_precomputed_info_inv, e lookup_get_env_var_read_from_public_inputs_col0_inv, e lookup_get_env_var_read_from_public_inputs_col1_inv, e lookup_internal_call_push_call_stack_inv, e lookup_internal_call_unwind_call_stack_inv, e lookup_external_call_call_allocated_left_l2_range_inv, e lookup_external_call_call_allocated_left_da_range_inv, e lookup_execution_bytecode_retrieval_result_inv, e lookup_execution_instruction_fetching_result_inv, e lookup_execution_instruction_fetching_body_inv, e lookup_execution_exec_spec_read_inv, e lookup_execution_dyn_l2_factor_bitwise_inv, e lookup_note_hash_tree_check_silo_poseidon2_inv, e lookup_note_hash_tree_check_read_first_nullifier_inv, e lookup_note_hash_tree_check_nonce_computation_poseidon2_inv, e lookup_note_hash_tree_check_unique_note_hash_poseidon2_inv, e lookup_note_hash_tree_check_merkle_check_inv, e lookup_note_hash_tree_check_write_note_hash_to_public_inputs_inv, e lookup_tx_read_phase_table_inv, e lookup_tx_phase_jump_on_revert_inv, e lookup_tx_read_phase_length_inv, e lookup_tx_read_public_call_request_phase_inv, e lookup_tx_read_tree_insert_value_inv, e lookup_tx_note_hash_append_inv, e lookup_tx_nullifier_append_inv, e lookup_tx_read_l2_l1_msg_inv, e lookup_tx_write_l2_l1_msg_inv, e lookup_tx_read_effective_fee_public_inputs_inv, e lookup_tx_read_fee_payer_public_inputs_inv, e lookup_tx_balance_slot_poseidon2_inv, e lookup_tx_balance_validation_inv #define AVM2_SHIFTED_ENTITIES_E(e) e bc_decomposition_bytes_shift, e bc_decomposition_bytes_pc_plus_1_shift, e bc_decomposition_bytes_pc_plus_10_shift, e bc_decomposition_bytes_pc_plus_11_shift, e bc_decomposition_bytes_pc_plus_12_shift, e bc_decomposition_bytes_pc_plus_13_shift, e bc_decomposition_bytes_pc_plus_14_shift, e bc_decomposition_bytes_pc_plus_15_shift, e bc_decomposition_bytes_pc_plus_16_shift, e bc_decomposition_bytes_pc_plus_17_shift, e bc_decomposition_bytes_pc_plus_18_shift, e bc_decomposition_bytes_pc_plus_19_shift, e bc_decomposition_bytes_pc_plus_2_shift, e bc_decomposition_bytes_pc_plus_20_shift, e bc_decomposition_bytes_pc_plus_21_shift, e bc_decomposition_bytes_pc_plus_22_shift, e bc_decomposition_bytes_pc_plus_23_shift, e bc_decomposition_bytes_pc_plus_24_shift, e bc_decomposition_bytes_pc_plus_25_shift, e bc_decomposition_bytes_pc_plus_26_shift, e bc_decomposition_bytes_pc_plus_27_shift, e bc_decomposition_bytes_pc_plus_28_shift, e bc_decomposition_bytes_pc_plus_29_shift, e bc_decomposition_bytes_pc_plus_3_shift, e bc_decomposition_bytes_pc_plus_30_shift, e bc_decomposition_bytes_pc_plus_31_shift, e bc_decomposition_bytes_pc_plus_32_shift, e bc_decomposition_bytes_pc_plus_33_shift, e bc_decomposition_bytes_pc_plus_34_shift, e bc_decomposition_bytes_pc_plus_35_shift, e bc_decomposition_bytes_pc_plus_4_shift, e bc_decomposition_bytes_pc_plus_5_shift, e bc_decomposition_bytes_pc_plus_6_shift, e bc_decomposition_bytes_pc_plus_7_shift, e bc_decomposition_bytes_pc_plus_8_shift, e bc_decomposition_bytes_pc_plus_9_shift, e bc_decomposition_bytes_remaining_shift, e bc_decomposition_id_shift, e bc_decomposition_pc_shift, e bc_decomposition_sel_shift, e bc_hashing_bytecode_id_shift, e bc_hashing_incremental_hash_shift, e bc_hashing_pc_index_shift, e bc_hashing_sel_shift, e bc_hashing_start_shift, e bc_retrieval_bytecode_id_shift, e bc_retrieval_sel_shift, e bitwise_acc_ia_shift, e bitwise_acc_ib_shift, e bitwise_acc_ic_shift, e bitwise_ctr_shift, e bitwise_op_id_shift, e calldata_context_id_shift, e calldata_index_shift, e calldata_sel_shift, e cd_hashing_sel_shift, e data_copy_copy_size_shift, e data_copy_dst_addr_shift, e data_copy_read_addr_shift, e data_copy_reads_left_shift, e data_copy_sel_cd_copy_shift, e data_copy_sel_rd_copy_shift, e data_copy_sel_start_shift, e execution_context_id_shift, e execution_contract_address_shift, e execution_da_gas_limit_shift, e execution_discard_shift, e execution_dying_context_id_shift, e execution_enqueued_call_start_shift, e execution_internal_call_id_shift, e execution_internal_call_return_id_shift, e execution_is_static_shift, e execution_l2_gas_limit_shift, e execution_last_child_returndata_addr_shift, e execution_last_child_returndata_size_shift, e execution_msg_sender_shift, e execution_next_context_id_shift, e execution_next_internal_call_id_shift, e execution_parent_calldata_addr_shift, e execution_parent_calldata_size_shift, e execution_parent_da_gas_limit_shift, e execution_parent_da_gas_used_shift, e execution_parent_id_shift, e execution_parent_l2_gas_limit_shift, e execution_parent_l2_gas_used_shift, e execution_pc_shift, e execution_prev_da_gas_used_shift, e execution_prev_l2_gas_used_shift, e execution_sel_shift, e execution_transaction_fee_shift, e ff_gt_a_hi_shift, e ff_gt_a_lo_shift, e ff_gt_b_hi_shift, e ff_gt_b_lo_shift, e ff_gt_cmp_rng_ctr_shift, e ff_gt_p_sub_a_hi_shift, e ff_gt_p_sub_a_lo_shift, e ff_gt_p_sub_b_hi_shift, e ff_gt_p_sub_b_lo_shift, e ff_gt_sel_shift, e ff_gt_sel_gt_shift, e keccak_memory_addr_shift, e keccak_memory_clk_shift, e keccak_memory_ctr_shift, e keccak_memory_rw_shift, e keccak_memory_space_id_shift, e keccak_memory_tag_error_shift, e keccak_memory_val00_shift, e keccak_memory_val01_shift, e keccak_memory_val02_shift, e keccak_memory_val03_shift, e keccak_memory_val04_shift, e keccak_memory_val10_shift, e keccak_memory_val11_shift, e keccak_memory_val12_shift, e keccak_memory_val13_shift, e keccak_memory_val14_shift, e keccak_memory_val20_shift, e keccak_memory_val21_shift, e keccak_memory_val22_shift, e keccak_memory_val23_shift, e keccak_memory_val24_shift, e keccak_memory_val30_shift, e keccak_memory_val31_shift, e keccak_memory_val32_shift, e keccak_memory_val33_shift, e keccak_memory_val34_shift, e keccak_memory_val40_shift, e keccak_memory_val41_shift, e keccak_memory_val42_shift, e keccak_memory_val43_shift, e keccakf1600_clk_shift, e keccakf1600_dst_addr_shift, e keccakf1600_round_shift, e keccakf1600_sel_no_error_shift, e keccakf1600_space_id_shift, e keccakf1600_state_in_00_shift, e keccakf1600_state_in_01_shift, e keccakf1600_state_in_02_shift, e keccakf1600_state_in_03_shift, e keccakf1600_state_in_04_shift, e keccakf1600_state_in_10_shift, e keccakf1600_state_in_11_shift, e keccakf1600_state_in_12_shift, e keccakf1600_state_in_13_shift, e keccakf1600_state_in_14_shift, e keccakf1600_state_in_20_shift, e keccakf1600_state_in_21_shift, e keccakf1600_state_in_22_shift, e keccakf1600_state_in_23_shift, e keccakf1600_state_in_24_shift, e keccakf1600_state_in_30_shift, e keccakf1600_state_in_31_shift, e keccakf1600_state_in_32_shift, e keccakf1600_state_in_33_shift, e keccakf1600_state_in_34_shift, e keccakf1600_state_in_40_shift, e keccakf1600_state_in_41_shift, e keccakf1600_state_in_42_shift, e keccakf1600_state_in_43_shift, e keccakf1600_state_in_44_shift, e merkle_check_index_shift, e merkle_check_path_len_shift, e merkle_check_read_node_shift, e merkle_check_read_root_shift, e merkle_check_sel_shift, e merkle_check_start_shift, e merkle_check_write_shift, e merkle_check_write_node_shift, e merkle_check_write_root_shift, e poseidon2_hash_a_0_shift, e poseidon2_hash_a_1_shift, e poseidon2_hash_a_2_shift, e poseidon2_hash_a_3_shift, e poseidon2_hash_input_0_shift, e poseidon2_hash_input_1_shift, e poseidon2_hash_input_2_shift, e poseidon2_hash_num_perm_rounds_rem_shift, e poseidon2_hash_output_shift, e poseidon2_hash_sel_shift, e poseidon2_hash_start_shift, e public_data_check_clk_shift, e public_data_check_sel_shift, e public_data_check_write_idx_shift, e public_data_squash_clk_shift, e public_data_squash_leaf_slot_shift, e public_data_squash_sel_shift, e scalar_mul_bit_idx_shift, e scalar_mul_point_inf_shift, e scalar_mul_point_x_shift, e scalar_mul_point_y_shift, e scalar_mul_res_inf_shift, e scalar_mul_res_x_shift, e scalar_mul_res_y_shift, e scalar_mul_scalar_shift, e scalar_mul_sel_shift, e scalar_mul_start_shift, e scalar_mul_temp_inf_shift, e scalar_mul_temp_x_shift, e scalar_mul_temp_y_shift, e sha256_a_shift, e sha256_b_shift, e sha256_c_shift, e sha256_d_shift, e sha256_e_shift, e sha256_f_shift, e sha256_g_shift, e sha256_h_shift, e sha256_helper_w0_shift, e sha256_helper_w1_shift, e sha256_helper_w10_shift, e sha256_helper_w11_shift, e sha256_helper_w12_shift, e sha256_helper_w13_shift, e sha256_helper_w14_shift, e sha256_helper_w15_shift, e sha256_helper_w2_shift, e sha256_helper_w3_shift, e sha256_helper_w4_shift, e sha256_helper_w5_shift, e sha256_helper_w6_shift, e sha256_helper_w7_shift, e sha256_helper_w8_shift, e sha256_helper_w9_shift, e sha256_rounds_remaining_shift, e sha256_sel_shift, e sha256_start_shift, e to_radix_acc_shift, e to_radix_acc_under_p_shift, e to_radix_exponent_shift, e to_radix_limb_shift, e to_radix_limb_eq_p_shift, e to_radix_limb_index_shift, e to_radix_limb_lt_p_shift, e to_radix_not_padding_limb_shift, e to_radix_radix_shift, e to_radix_safe_limbs_shift, e to_radix_sel_shift, e to_radix_start_shift, e to_radix_value_shift, e tx_fee_shift, e tx_phase_value_shift, e tx_prev_da_gas_used_shift, e tx_prev_l2_gas_used_shift, e tx_read_pi_offset_shift, e tx_remaining_phase_counter_shift, e tx_sel_shift, e tx_start_phase_shift #define AVM2_TO_BE_SHIFTED_E(e) e bc_decomposition_bytes, e bc_decomposition_bytes_pc_plus_1, e bc_decomposition_bytes_pc_plus_10, e bc_decomposition_bytes_pc_plus_11, e bc_decomposition_bytes_pc_plus_12, e bc_decomposition_bytes_pc_plus_13, e bc_decomposition_bytes_pc_plus_14, e bc_decomposition_bytes_pc_plus_15, e bc_decomposition_bytes_pc_plus_16, e bc_decomposition_bytes_pc_plus_17, e bc_decomposition_bytes_pc_plus_18, e bc_decomposition_bytes_pc_plus_19, e bc_decomposition_bytes_pc_plus_2, e bc_decomposition_bytes_pc_plus_20, e bc_decomposition_bytes_pc_plus_21, e bc_decomposition_bytes_pc_plus_22, e bc_decomposition_bytes_pc_plus_23, e bc_decomposition_bytes_pc_plus_24, e bc_decomposition_bytes_pc_plus_25, e bc_decomposition_bytes_pc_plus_26, e bc_decomposition_bytes_pc_plus_27, e bc_decomposition_bytes_pc_plus_28, e bc_decomposition_bytes_pc_plus_29, e bc_decomposition_bytes_pc_plus_3, e bc_decomposition_bytes_pc_plus_30, e bc_decomposition_bytes_pc_plus_31, e bc_decomposition_bytes_pc_plus_32, e bc_decomposition_bytes_pc_plus_33, e bc_decomposition_bytes_pc_plus_34, e bc_decomposition_bytes_pc_plus_35, e bc_decomposition_bytes_pc_plus_4, e bc_decomposition_bytes_pc_plus_5, e bc_decomposition_bytes_pc_plus_6, e bc_decomposition_bytes_pc_plus_7, e bc_decomposition_bytes_pc_plus_8, e bc_decomposition_bytes_pc_plus_9, e bc_decomposition_bytes_remaining, e bc_decomposition_id, e bc_decomposition_pc, e bc_decomposition_sel, e bc_hashing_bytecode_id, e bc_hashing_incremental_hash, e bc_hashing_pc_index, e bc_hashing_sel, e bc_hashing_start, e bc_retrieval_bytecode_id, e bc_retrieval_sel, e bitwise_acc_ia, e bitwise_acc_ib, e bitwise_acc_ic, e bitwise_ctr, e bitwise_op_id, e calldata_context_id, e calldata_index, e calldata_sel, e cd_hashing_sel, e data_copy_copy_size, e data_copy_dst_addr, e data_copy_read_addr, e data_copy_reads_left, e data_copy_sel_cd_copy, e data_copy_sel_rd_copy, e data_copy_sel_start, e execution_context_id, e execution_contract_address, e execution_da_gas_limit, e execution_discard, e execution_dying_context_id, e execution_enqueued_call_start, e execution_internal_call_id, e execution_internal_call_return_id, e execution_is_static, e execution_l2_gas_limit, e execution_last_child_returndata_addr, e execution_last_child_returndata_size, e execution_msg_sender, e execution_next_context_id, e execution_next_internal_call_id, e execution_parent_calldata_addr, e execution_parent_calldata_size, e execution_parent_da_gas_limit, e execution_parent_da_gas_used, e execution_parent_id, e execution_parent_l2_gas_limit, e execution_parent_l2_gas_used, e execution_pc, e execution_prev_da_gas_used, e execution_prev_l2_gas_used, e execution_sel, e execution_transaction_fee, e ff_gt_a_hi, e ff_gt_a_lo, e ff_gt_b_hi, e ff_gt_b_lo, e ff_gt_cmp_rng_ctr, e ff_gt_p_sub_a_hi, e ff_gt_p_sub_a_lo, e ff_gt_p_sub_b_hi, e ff_gt_p_sub_b_lo, e ff_gt_sel, e ff_gt_sel_gt, e keccak_memory_addr, e keccak_memory_clk, e keccak_memory_ctr, e keccak_memory_rw, e keccak_memory_space_id, e keccak_memory_tag_error, e keccak_memory_val00, e keccak_memory_val01, e keccak_memory_val02, e keccak_memory_val03, e keccak_memory_val04, e keccak_memory_val10, e keccak_memory_val11, e keccak_memory_val12, e keccak_memory_val13, e keccak_memory_val14, e keccak_memory_val20, e keccak_memory_val21, e keccak_memory_val22, e keccak_memory_val23, e keccak_memory_val24, e keccak_memory_val30, e keccak_memory_val31, e keccak_memory_val32, e keccak_memory_val33, e keccak_memory_val34, e keccak_memory_val40, e keccak_memory_val41, e keccak_memory_val42, e keccak_memory_val43, e keccakf1600_clk, e keccakf1600_dst_addr, e keccakf1600_round, e keccakf1600_sel_no_error, e keccakf1600_space_id, e keccakf1600_state_in_00, e keccakf1600_state_in_01, e keccakf1600_state_in_02, e keccakf1600_state_in_03, e keccakf1600_state_in_04, e keccakf1600_state_in_10, e keccakf1600_state_in_11, e keccakf1600_state_in_12, e keccakf1600_state_in_13, e keccakf1600_state_in_14, e keccakf1600_state_in_20, e keccakf1600_state_in_21, e keccakf1600_state_in_22, e keccakf1600_state_in_23, e keccakf1600_state_in_24, e keccakf1600_state_in_30, e keccakf1600_state_in_31, e keccakf1600_state_in_32, e keccakf1600_state_in_33, e keccakf1600_state_in_34, e keccakf1600_state_in_40, e keccakf1600_state_in_41, e keccakf1600_state_in_42, e keccakf1600_state_in_43, e keccakf1600_state_in_44, e merkle_check_index, e merkle_check_path_len, e merkle_check_read_node, e merkle_check_read_root, e merkle_check_sel, e merkle_check_start, e merkle_check_write, e merkle_check_write_node, e merkle_check_write_root, e poseidon2_hash_a_0, e poseidon2_hash_a_1, e poseidon2_hash_a_2, e poseidon2_hash_a_3, e poseidon2_hash_input_0, e poseidon2_hash_input_1, e poseidon2_hash_input_2, e poseidon2_hash_num_perm_rounds_rem, e poseidon2_hash_output, e poseidon2_hash_sel, e poseidon2_hash_start, e public_data_check_clk, e public_data_check_sel, e public_data_check_write_idx, e public_data_squash_clk, e public_data_squash_leaf_slot, e public_data_squash_sel, e scalar_mul_bit_idx, e scalar_mul_point_inf, e scalar_mul_point_x, e scalar_mul_point_y, e scalar_mul_res_inf, e scalar_mul_res_x, e scalar_mul_res_y, e scalar_mul_scalar, e scalar_mul_sel, e scalar_mul_start, e scalar_mul_temp_inf, e scalar_mul_temp_x, e scalar_mul_temp_y, e sha256_a, e sha256_b, e sha256_c, e sha256_d, e sha256_e, e sha256_f, e sha256_g, e sha256_h, e sha256_helper_w0, e sha256_helper_w1, e sha256_helper_w10, e sha256_helper_w11, e sha256_helper_w12, e sha256_helper_w13, e sha256_helper_w14, e sha256_helper_w15, e sha256_helper_w2, e sha256_helper_w3, e sha256_helper_w4, e sha256_helper_w5, e sha256_helper_w6, e sha256_helper_w7, e sha256_helper_w8, e sha256_helper_w9, e sha256_rounds_remaining, e sha256_sel, e sha256_start, e to_radix_acc, e to_radix_acc_under_p, e to_radix_exponent, e to_radix_limb, e to_radix_limb_eq_p, e to_radix_limb_index, e to_radix_limb_lt_p, e to_radix_not_padding_limb, e to_radix_radix, e to_radix_safe_limbs, e to_radix_sel, e to_radix_start, e to_radix_value, e tx_fee, e tx_phase_value, e tx_prev_da_gas_used, e tx_prev_l2_gas_used, e tx_read_pi_offset, e tx_remaining_phase_counter, e tx_sel, e tx_start_phase @@ -37,8 +37,8 @@ enum class ColumnAndShifts { SENTINEL_DO_NOT_USE, }; -constexpr auto NUM_COLUMNS_WITH_SHIFTS = 2614; -constexpr auto NUM_COLUMNS_WITHOUT_SHIFTS = 2366; +constexpr auto NUM_COLUMNS_WITH_SHIFTS = 2616; +constexpr auto NUM_COLUMNS_WITHOUT_SHIFTS = 2368; constexpr auto TO_BE_SHIFTED_COLUMNS_ARRAY = []() { return std::array{ AVM2_TO_BE_SHIFTED_COLUMNS }; }(); constexpr auto SHIFTED_COLUMNS_ARRAY = []() { return std::array{ AVM2_SHIFTED_COLUMNS }; }(); static_assert(TO_BE_SHIFTED_COLUMNS_ARRAY.size() == SHIFTED_COLUMNS_ARRAY.size()); diff --git a/barretenberg/cpp/src/barretenberg/vm2/generated/flavor_variables.hpp b/barretenberg/cpp/src/barretenberg/vm2/generated/flavor_variables.hpp index 9b5f8fc3aaac..30cf366e94a6 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/generated/flavor_variables.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/generated/flavor_variables.hpp @@ -84,10 +84,10 @@ namespace bb::avm2 { struct AvmFlavorVariables { static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 127; - static constexpr size_t NUM_WITNESS_ENTITIES = 2239; + static constexpr size_t NUM_WITNESS_ENTITIES = 2241; static constexpr size_t NUM_SHIFTED_ENTITIES = 248; static constexpr size_t NUM_WIRES = NUM_WITNESS_ENTITIES + NUM_PRECOMPUTED_ENTITIES; - static constexpr size_t NUM_ALL_ENTITIES = 2614; + static constexpr size_t NUM_ALL_ENTITIES = 2616; // Need to be templated for recursive verifier template diff --git a/barretenberg/cpp/src/barretenberg/vm2/generated/relations/alu.hpp b/barretenberg/cpp/src/barretenberg/vm2/generated/relations/alu.hpp index 9ecb7f1d75bc..bb3db61c7b45 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/generated/relations/alu.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/generated/relations/alu.hpp @@ -13,7 +13,7 @@ template class aluImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 2, 5, 3, 4, 3, 4, 3, 3, 5 }; + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 3, 3, 3, 2, 5, 3, 4, 3, 4, 3, 3, 5, 5 }; template inline static bool skip(const AllEntities& in) { @@ -33,15 +33,17 @@ template class aluImpl { const auto constants_MEM_TAG_FF = FF(0); const auto constants_MEM_TAG_U1 = FF(1); const auto constants_AVM_EXEC_OP_ID_ALU_ADD = FF(1); + const auto constants_AVM_EXEC_OP_ID_ALU_EQ = FF(32); const auto constants_AVM_EXEC_OP_ID_ALU_LT = FF(64); const auto alu_IS_NOT_FF = (FF(1) - in.get(C::alu_sel_is_ff)); const auto alu_CHECK_TAG_FF = in.get(C::alu_sel_op_lt); const auto alu_TAG_FF_DIFF = (in.get(C::alu_ia_tag) - constants_MEM_TAG_FF); - const auto alu_EXPECTED_C_TAG = - in.get(C::alu_sel_op_add) * in.get(C::alu_ia_tag) + in.get(C::alu_sel_op_lt) * constants_MEM_TAG_U1; + const auto alu_EXPECTED_C_TAG = in.get(C::alu_sel_op_add) * in.get(C::alu_ia_tag) + + (in.get(C::alu_sel_op_lt) + in.get(C::alu_sel_op_eq)) * constants_MEM_TAG_U1; const auto alu_AB_TAGS_EQ = (FF(1) - in.get(C::alu_sel_tag_err)); const auto alu_A_GTE_B = (in.get(C::alu_ia) - in.get(C::alu_ib)); const auto alu_A_LT_B = ((in.get(C::alu_ib) - in.get(C::alu_ia)) - FF(1)); + const auto alu_DIFF = (in.get(C::alu_ia) - in.get(C::alu_ib)); { using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>; @@ -63,9 +65,9 @@ template class aluImpl { } { // OP_ID_CHECK using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>; - auto tmp = ((in.get(C::alu_sel_op_add) * constants_AVM_EXEC_OP_ID_ALU_ADD + - in.get(C::alu_sel_op_lt) * constants_AVM_EXEC_OP_ID_ALU_LT) - - in.get(C::alu_op_id)); + auto tmp = (in.get(C::alu_op_id) - (in.get(C::alu_sel_op_add) * constants_AVM_EXEC_OP_ID_ALU_ADD + + in.get(C::alu_sel_op_lt) * constants_AVM_EXEC_OP_ID_ALU_LT + + in.get(C::alu_sel_op_eq) * constants_AVM_EXEC_OP_ID_ALU_EQ)); tmp *= scaling_factor; std::get<3>(evals) += typename Accumulator::View(tmp); } @@ -128,6 +130,15 @@ template class aluImpl { tmp *= scaling_factor; std::get<11>(evals) += typename Accumulator::View(tmp); } + { // EQ_OP_MAIN + using Accumulator = typename std::tuple_element_t<12, ContainerOverSubrelations>; + auto tmp = + in.get(C::alu_sel_op_eq) * + ((alu_DIFF * (in.get(C::alu_ic) * (FF(1) - in.get(C::alu_helper1)) + in.get(C::alu_helper1)) - FF(1)) + + in.get(C::alu_ic)); + tmp *= scaling_factor; + std::get<12>(evals) += typename Accumulator::View(tmp); + } } }; @@ -150,6 +161,8 @@ template class alu : public Relation> { return "ALU_ADD"; case 11: return "ALU_LT_RESULT"; + case 12: + return "EQ_OP_MAIN"; } return std::to_string(index); } @@ -161,6 +174,7 @@ template class alu : public Relation> { static constexpr size_t SR_AB_TAGS_CHECK = 6; static constexpr size_t SR_ALU_ADD = 8; static constexpr size_t SR_ALU_LT_RESULT = 11; + static constexpr size_t SR_EQ_OP_MAIN = 12; }; } // namespace bb::avm2 diff --git a/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.cpp b/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.cpp index cc955809be23..4db7424589af 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.cpp @@ -2,6 +2,7 @@ #include "barretenberg/numeric/uint128/uint128.hpp" #include "barretenberg/vm2/common/memory_types.hpp" #include "barretenberg/vm2/common/tagged_value.hpp" +#include "barretenberg/vm2/simulation/events/gas_event.hpp" #include #include @@ -11,7 +12,12 @@ namespace bb::avm2::simulation { MemoryValue Alu::add(const MemoryValue& a, const MemoryValue& b) { if (a.get_tag() != b.get_tag()) { - debug("ALU operation failed: ", to_string(AluError::TAG_ERROR), " a: ", a.to_string(), ", b: ", b.to_string()); + debug("ALU (ADD opcode) operation failed: ", + to_string(AluError::TAG_ERROR), + " a: ", + a.to_string(), + ", b: ", + b.to_string()); events.emit({ .operation = AluOperation::ADD, .a = a, .b = b, @@ -25,10 +31,31 @@ MemoryValue Alu::add(const MemoryValue& a, const MemoryValue& b) return c; } +MemoryValue Alu::eq(const MemoryValue& a, const MemoryValue& b) +{ + MemoryValue c = MemoryValue::from(a.as_ff() == b.as_ff() ? 1 : 0); + + // Brillig semantic enforces that tags match for EQ. + if (a.get_tag() != b.get_tag()) { + events.emit({ .operation = AluOperation::EQ, .a = a, .b = b, .c = c, .error = AluError::TAG_ERROR }); + debug("ALU (EQ opcode) operation failed: ", + to_string(AluError::TAG_ERROR), + " a: ", + a.to_string(), + ", b: ", + b.to_string()); + throw AluException(); + } + + events.emit({ .operation = AluOperation::EQ, .a = a, .b = b, .c = c }); + return c; +} + MemoryValue Alu::lt(const MemoryValue& a, const MemoryValue& b) { + // Brillig semantic enforces that tags match for LT. if (a.get_tag() != b.get_tag()) { - debug("ALU operation failed: ", to_string(AluError::TAG_ERROR)); + debug("ALU (LT opcode) operation failed: ", to_string(AluError::TAG_ERROR)); events.emit({ .operation = AluOperation::LT, .a = a, .b = b, diff --git a/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.hpp b/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.hpp index 0f2070c34c5d..e41851ef1787 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.hpp @@ -17,6 +17,7 @@ class AluInterface { public: virtual ~AluInterface() = default; virtual MemoryValue add(const MemoryValue& a, const MemoryValue& b) = 0; + virtual MemoryValue eq(const MemoryValue& a, const MemoryValue& b) = 0; virtual MemoryValue lt(const MemoryValue& a, const MemoryValue& b) = 0; }; @@ -31,6 +32,7 @@ class Alu : public AluInterface { {} MemoryValue add(const MemoryValue& a, const MemoryValue& b) override; + MemoryValue eq(const MemoryValue& a, const MemoryValue& b) override; MemoryValue lt(const MemoryValue& a, const MemoryValue& b) override; private: diff --git a/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.test.cpp b/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.test.cpp index fc12882d5fbd..4044cce20212 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/simulation/alu.test.cpp @@ -138,5 +138,64 @@ TEST(AvmSimulationAluTest, NegativeLTTag) .error = AluError::TAG_ERROR })); } +TEST(AvmSimulationAluTest, EQEquality) +{ + EventEmitter alu_event_emitter; + StrictMock range_check; + StrictMock field_gt; + Alu alu(range_check, field_gt, alu_event_emitter); + + auto a = MemoryValue::from(123456789); + auto b = MemoryValue::from(123456789); + + auto c = alu.eq(a, b); + + EXPECT_EQ(c, MemoryValue::from(1)); + + auto events = alu_event_emitter.dump_events(); + EXPECT_THAT(events, + ElementsAre(AluEvent{ .operation = AluOperation::EQ, .a = a, .b = b, .c = c, .error = std::nullopt })); +} + +TEST(AvmSimulationAluTest, EQInequality) +{ + EventEmitter alu_event_emitter; + StrictMock range_check; + StrictMock field_gt; + Alu alu(range_check, field_gt, alu_event_emitter); + + auto a = MemoryValue::from(123456789); + auto b = MemoryValue::from(123456788); + + auto c = alu.eq(a, b); + + EXPECT_EQ(c, MemoryValue::from(0)); + + auto events = alu_event_emitter.dump_events(); + EXPECT_THAT(events, + ElementsAre(AluEvent{ .operation = AluOperation::EQ, .a = a, .b = b, .c = c, .error = std::nullopt })); +} + +TEST(AvmSimulationAluTest, EQTagError) +{ + EventEmitter alu_event_emitter; + StrictMock range_check; + StrictMock field_gt; + Alu alu(range_check, field_gt, alu_event_emitter); + + auto a = MemoryValue::from(1); + auto b = MemoryValue::from(1); + + EXPECT_THROW(alu.eq(a, b), AluException); + + auto events = alu_event_emitter.dump_events(); + EXPECT_THAT(events, + ElementsAre(AluEvent{ .operation = AluOperation::EQ, + .a = a, + .b = b, + .c = MemoryValue::from(1), + .error = AluError::TAG_ERROR })); +} + } // namespace } // namespace bb::avm2::simulation diff --git a/barretenberg/cpp/src/barretenberg/vm2/simulation/events/alu_event.hpp b/barretenberg/cpp/src/barretenberg/vm2/simulation/events/alu_event.hpp index 73fec5dc800e..aa1b6ee99d65 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/simulation/events/alu_event.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/simulation/events/alu_event.hpp @@ -5,12 +5,14 @@ #include "barretenberg/vm2/common/memory_types.hpp" #include "barretenberg/vm2/common/opcodes.hpp" +#include "barretenberg/vm2/common/uint1.hpp" namespace bb::avm2::simulation { enum class AluOperation { ADD, LT, + EQ, }; // TODO(MW): Expand when adding new ops (e.g. when using max_bits for mul, we would cover bits related errors) @@ -40,7 +42,8 @@ class AluException : public std::runtime_error { struct AluEvent { AluOperation operation; MemoryValue a; - MemoryValue b; + MemoryValue b = MemoryValue::from(0); // Avoid unitialized values for ALU ops with one input such as NOT, + // TRUNCATE. Otherwise, deduplication is not guaranteed. MemoryValue c; std::optional error; // To be used with deduplicating event emitters. diff --git a/barretenberg/cpp/src/barretenberg/vm2/simulation/execution.cpp b/barretenberg/cpp/src/barretenberg/vm2/simulation/execution.cpp index 0d290bd93090..4c41dea84aa1 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/simulation/execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/simulation/execution.cpp @@ -53,11 +53,30 @@ void Execution::add(ContextInterface& context, MemoryAddress a_addr, MemoryAddre MemoryValue c = alu.add(a, b); memory.set(dst_addr, c); set_output(opcode, c); - } catch (AluError& e) { + } catch (AluException& e) { throw OpcodeExecutionException("Alu add operation failed"); } } +void Execution::eq(ContextInterface& context, MemoryAddress a_addr, MemoryAddress b_addr, MemoryAddress dst_addr) +{ + constexpr auto opcode = ExecutionOpCode::EQ; + auto& memory = context.get_memory(); + MemoryValue a = memory.get(a_addr); + MemoryValue b = memory.get(b_addr); + set_and_validate_inputs(opcode, { a, b }); + + get_gas_tracker().consume_gas(); + + try { + MemoryValue c = alu.eq(a, b); + memory.set(dst_addr, c); + set_output(opcode, c); + } catch (AluException& e) { + throw OpcodeExecutionException("Alu eq operation failed"); + } +} + void Execution::lt(ContextInterface& context, MemoryAddress a_addr, MemoryAddress b_addr, MemoryAddress dst_addr) { constexpr auto opcode = ExecutionOpCode::LT; @@ -72,7 +91,7 @@ void Execution::lt(ContextInterface& context, MemoryAddress a_addr, MemoryAddres MemoryValue c = alu.lt(a, b); memory.set(dst_addr, c); set_output(opcode, c); - } catch (AluError& e) { + } catch (AluException& e) { throw OpcodeExecutionException("Alu lt operation failed"); } } @@ -616,6 +635,9 @@ void Execution::dispatch_opcode(ExecutionOpCode opcode, case ExecutionOpCode::ADD: call_with_operands(&Execution::add, context, resolved_operands); break; + case ExecutionOpCode::EQ: + call_with_operands(&Execution::eq, context, resolved_operands); + break; case ExecutionOpCode::LT: call_with_operands(&Execution::lt, context, resolved_operands); break; diff --git a/barretenberg/cpp/src/barretenberg/vm2/simulation/execution.hpp b/barretenberg/cpp/src/barretenberg/vm2/simulation/execution.hpp index fb030e58f68b..c5a804c264b0 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/simulation/execution.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/simulation/execution.hpp @@ -73,6 +73,7 @@ class Execution : public ExecutionInterface { // Opcode handlers. The order of the operands matters and should be the same as the wire format. void add(ContextInterface& context, MemoryAddress a_addr, MemoryAddress b_addr, MemoryAddress dst_addr); + void eq(ContextInterface& context, MemoryAddress a_addr, MemoryAddress b_addr, MemoryAddress dst_addr); void lt(ContextInterface& context, MemoryAddress a_addr, MemoryAddress b_addr, MemoryAddress dst_addr); void get_env_var(ContextInterface& context, MemoryAddress dst_addr, uint8_t var_enum); void set(ContextInterface& context, MemoryAddress dst_addr, uint8_t tag, FF value); diff --git a/barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_alu.hpp b/barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_alu.hpp index 6acfcd1f592b..16e134e1df39 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_alu.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_alu.hpp @@ -15,6 +15,7 @@ class MockAlu : public AluInterface { ~MockAlu() override; MOCK_METHOD(MemoryValue, add, (const MemoryValue& a, const MemoryValue& b), (override)); + MOCK_METHOD(MemoryValue, eq, (const MemoryValue& a, const MemoryValue& b), (override)); MOCK_METHOD(MemoryValue, lt, (const MemoryValue& a, const MemoryValue& b), (override)); }; diff --git a/barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.cpp b/barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.cpp index d8f267347fdb..307f723642c3 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.cpp @@ -5,6 +5,7 @@ #include #include +#include "barretenberg/numeric/uint256/uint256.hpp" #include "barretenberg/vm2/common/tagged_value.hpp" #include "barretenberg/vm2/generated/relations/lookups_alu.hpp" #include "barretenberg/vm2/simulation/events/alu_event.hpp" @@ -27,6 +28,13 @@ std::vector> get_operation_columns(const simulation::AluEv // I think the only situation in which a + b != c as fields is when c overflows the bit size // if this in unclear, I can use > or actually check bit sizes: { Column::alu_cf, event.a.as_ff() + event.b.as_ff() != event.c.as_ff() } }; + case simulation::AluOperation::EQ: { + const FF diff = event.a.as_ff() - event.b.as_ff(); + return { { Column::alu_sel_op_eq, 1 }, + { Column::alu_op_id, + static_cast(SUBTRACE_INFO_MAP.at(ExecutionOpCode::EQ).subtrace_operation_id) }, + { Column::alu_helper1, diff == 0 ? 0 : diff.invert() } }; + } case simulation::AluOperation::LT: { bool is_ff = event.a.get_tag() == ValueTag::FF; FF abs_diff = static_cast(event.c.as_ff()) == 1 ? event.b.as_ff() - event.a.as_ff() - 1 diff --git a/barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.test.cpp b/barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.test.cpp index ca066ff4506a..d9d7e15ec4e2 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.test.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "barretenberg/numeric/uint128/uint128.hpp" #include "barretenberg/vm2/constraining/flavor_settings.hpp" @@ -332,5 +333,175 @@ TEST(AluTraceGenTest, TraceGenerationLTFF) ROW_FIELD_EQ(alu_sel_tag_err, 0), ROW_FIELD_EQ(alu_ab_tags_diff_inv, 0)))); } + +// Base class for EQ tests with common setup +class AluTraceGenEQTestBase { + protected: + MemoryValue test_a; + MemoryValue test_b; +}; + +// Parametrized test for EQ operations with same value tags +class AluTraceGenEQTest : public ::testing::TestWithParam, public AluTraceGenEQTestBase { + protected: + void SetUp() override + { + test_a = GetParam(); + test_b = test_a; + } +}; + +TEST_P(AluTraceGenEQTest, SameTags) +{ + TestTraceContainer trace; + AluTraceBuilder builder; + + builder.process( + { + { .operation = AluOperation::EQ, .a = test_a, .b = test_b, .c = MemoryValue::from(1) }, + }, + trace); + + EXPECT_THAT(trace.as_rows(), + ElementsAre(AllOf(ROW_FIELD_EQ(alu_sel_op_eq, 1), + ROW_FIELD_EQ(alu_sel, 1), + ROW_FIELD_EQ(alu_op_id, AVM_EXEC_OP_ID_ALU_EQ), + ROW_FIELD_EQ(alu_ia, test_a.as_ff()), + ROW_FIELD_EQ(alu_ib, test_b.as_ff()), + ROW_FIELD_EQ(alu_ic, 1), + ROW_FIELD_EQ(alu_helper1, 0), + ROW_FIELD_EQ(alu_ia_tag, static_cast(test_a.get_tag())), + ROW_FIELD_EQ(alu_ib_tag, static_cast(test_b.get_tag())), + ROW_FIELD_EQ(alu_ic_tag, static_cast(ValueTag::U1)), + ROW_FIELD_EQ(alu_sel_tag_err, 0), + ROW_FIELD_EQ(alu_ab_tags_diff_inv, 0)))); +} + +// Test parameters: MemoryValue a +INSTANTIATE_TEST_SUITE_P(AluTraceGenTest, + AluTraceGenEQTest, + ::testing::Values(MemoryValue::from(1), + MemoryValue::from(42), + MemoryValue::from(12345), + MemoryValue::from(123456789), + MemoryValue::from(1234567890123456789ULL), + MemoryValue::from(123456789), + MemoryValue::from(42))); + +// Parametrized test for EQ operations with different value tags +struct EQTestParams { + MemoryValue a; + MemoryValue b; +}; + +// Parametrized test for EQ operations with different value tags (inequality case) +class AluTraceGenEQInequalityTest : public ::testing::TestWithParam, public AluTraceGenEQTestBase { + protected: + void SetUp() override + { + auto params = GetParam(); + test_a = params.a; + test_b = params.b; + } +}; + +TEST_P(AluTraceGenEQInequalityTest, SameTags) +{ + TestTraceContainer trace; + AluTraceBuilder builder; + + builder.process( + { + { .operation = AluOperation::EQ, .a = test_a, .b = test_b, .c = MemoryValue::from(0) }, + }, + trace); + + EXPECT_THAT(trace.as_rows(), + ElementsAre(AllOf(ROW_FIELD_EQ(alu_sel_op_eq, 1), + ROW_FIELD_EQ(alu_sel, 1), + ROW_FIELD_EQ(alu_op_id, AVM_EXEC_OP_ID_ALU_EQ), + ROW_FIELD_EQ(alu_ia, test_a.as_ff()), + ROW_FIELD_EQ(alu_ib, test_b.as_ff()), + ROW_FIELD_EQ(alu_ic, 0), + ROW_FIELD_EQ(alu_helper1, FF(test_a.as_ff() - test_b.as_ff()).invert()), + ROW_FIELD_EQ(alu_ia_tag, static_cast(test_a.get_tag())), + ROW_FIELD_EQ(alu_ib_tag, static_cast(test_b.get_tag())), + ROW_FIELD_EQ(alu_ic_tag, static_cast(ValueTag::U1)), + ROW_FIELD_EQ(alu_sel_tag_err, 0), + ROW_FIELD_EQ(alu_ab_tags_diff_inv, 0)))); +} + +// Test parameters for inequality: (MemoryValue a, MemoryValue b) - values are different +INSTANTIATE_TEST_SUITE_P( + AluTraceGenTest, + AluTraceGenEQInequalityTest, + ::testing::Values( + EQTestParams{ .a = MemoryValue::from(1), .b = MemoryValue::from(0) }, + EQTestParams{ .a = MemoryValue::from(42), .b = MemoryValue::from(24) }, + EQTestParams{ .a = MemoryValue::from(12345), .b = MemoryValue::from(54321) }, + EQTestParams{ .a = MemoryValue::from(123456789), .b = MemoryValue::from(987654321) }, + EQTestParams{ .a = MemoryValue::from(1234567890123456789ULL), + .b = MemoryValue::from(9876543210987654321ULL) }, + EQTestParams{ .a = MemoryValue::from(123456789), .b = MemoryValue::from(987654321) }, + EQTestParams{ .a = MemoryValue::from(FF::modulus - 3), .b = MemoryValue::from(FF::modulus - 1) })); + +// Parametrized test for EQ operations with different value tags (tag error case) +class AluTraceGenEQTagError : public ::testing::TestWithParam, public AluTraceGenEQTestBase { + protected: + void SetUp() override + { + auto params = GetParam(); + test_a = params.a; + test_b = params.b; + } +}; + +TEST_P(AluTraceGenEQTagError, DifferentTags) +{ + TestTraceContainer trace; + AluTraceBuilder builder; + + builder.process( + { + { .operation = AluOperation::EQ, + .a = test_a, + .b = test_b, + .c = MemoryValue::from(1), + .error = AluError::TAG_ERROR }, + }, + trace); + + EXPECT_THAT( + trace.as_rows(), + ElementsAre( + AllOf(ROW_FIELD_EQ(alu_sel_op_eq, 1), + ROW_FIELD_EQ(alu_sel, 1), + ROW_FIELD_EQ(alu_op_id, AVM_EXEC_OP_ID_ALU_EQ), + ROW_FIELD_EQ(alu_ia, test_a.as_ff()), + ROW_FIELD_EQ(alu_ib, test_b.as_ff()), + ROW_FIELD_EQ(alu_ic, 1), + ROW_FIELD_EQ(alu_helper1, 0), + ROW_FIELD_EQ(alu_ia_tag, static_cast(test_a.get_tag())), + ROW_FIELD_EQ(alu_ib_tag, static_cast(test_b.get_tag())), + ROW_FIELD_EQ(alu_ic_tag, static_cast(ValueTag::U1)), + ROW_FIELD_EQ(alu_sel_tag_err, 1), + ROW_FIELD_EQ( + alu_ab_tags_diff_inv, + FF(static_cast(test_a.get_tag()) - static_cast(test_b.get_tag())).invert())))); +} + +// Test parameters for tag error: (MemoryValue a, MemoryValue b) - different tags +INSTANTIATE_TEST_SUITE_P( + AluTraceGenTest, + AluTraceGenEQTagError, + ::testing::Values( + EQTestParams{ .a = MemoryValue::from(42), .b = MemoryValue::from(42) }, + EQTestParams{ .a = MemoryValue::from(123456789), .b = MemoryValue::from(123456789) }, + EQTestParams{ .a = MemoryValue::from(123456789), .b = MemoryValue::from(123456789) }, + EQTestParams{ .a = MemoryValue::from(42), .b = MemoryValue::from(42) }, + EQTestParams{ .a = MemoryValue::from(1), .b = MemoryValue::from(1) }, + EQTestParams{ .a = MemoryValue::from(1234567890123456789ULL), + .b = MemoryValue::from(1234567890123456789ULL) })); + } // namespace } // namespace bb::avm2::tracegen diff --git a/yarn-project/simulator/src/public/avm/opcodes/comparators.ts b/yarn-project/simulator/src/public/avm/opcodes/comparators.ts index c9f9e6553197..fb7328e21024 100644 --- a/yarn-project/simulator/src/public/avm/opcodes/comparators.ts +++ b/yarn-project/simulator/src/public/avm/opcodes/comparators.ts @@ -15,7 +15,7 @@ abstract class ComparatorInstruction extends ThreeOperandInstruction { const operands = [this.aOffset, this.bOffset, this.dstOffset]; const [aOffset, bOffset, dstOffset] = addressing.resolve(operands, memory); - memory.checkTagsAreSame(aOffset, bOffset); + memory.checkTagsAreSame(aOffset, bOffset); // Brillig semantic enforces that tags match. const a = memory.get(aOffset); const b = memory.get(bOffset); From 693761818e7bc71a92c1dfb40333ae9a414f30e8 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Wed, 9 Jul 2025 02:44:07 +0100 Subject: [PATCH 3/3] fix: use nonce of signing proposer (#15597) Turns out I was using the wrong nonce :) --------- Co-authored-by: Santiago Palladino Co-authored-by: Santiago Palladino --- yarn-project/ethereum/src/contracts/empire_base.ts | 4 ++-- .../ethereum/src/contracts/governance_proposer.ts | 9 +++++---- .../ethereum/src/contracts/slashing_proposer.ts | 9 +++++---- .../src/publisher/sequencer-publisher.test.ts | 8 +++++++- .../src/publisher/sequencer-publisher.ts | 13 ++++++++++--- .../sequencer-client/src/sequencer/sequencer.ts | 2 ++ yarn-project/slasher/src/slasher_client.test.ts | 3 ++- 7 files changed, 33 insertions(+), 15 deletions(-) diff --git a/yarn-project/ethereum/src/contracts/empire_base.ts b/yarn-project/ethereum/src/contracts/empire_base.ts index 2ea407ec5eee..1d7958946022 100644 --- a/yarn-project/ethereum/src/contracts/empire_base.ts +++ b/yarn-project/ethereum/src/contracts/empire_base.ts @@ -4,7 +4,6 @@ import { EmpireBaseAbi } from '@aztec/l1-artifacts/EmpireBaseAbi'; import { type Hex, encodeFunctionData, hashTypedData } from 'viem'; import type { L1TxRequest } from '../l1_tx_utils.js'; -import type { ExtendedViemWalletClient } from '../types.js'; export interface IEmpireBase { getRoundInfo(rollupAddress: Hex, round: bigint): Promise<{ lastVote: bigint; leader: Hex; executed: boolean }>; @@ -12,7 +11,8 @@ export interface IEmpireBase { createVoteRequest(payload: Hex): L1TxRequest; createVoteRequestWithSignature( payload: Hex, - wallet: ExtendedViemWalletClient, + chainId: number, + signerAddress: Hex, signer: (msg: Hex) => Promise, ): Promise; } diff --git a/yarn-project/ethereum/src/contracts/governance_proposer.ts b/yarn-project/ethereum/src/contracts/governance_proposer.ts index 51fbf9418443..67211cb44158 100644 --- a/yarn-project/ethereum/src/contracts/governance_proposer.ts +++ b/yarn-project/ethereum/src/contracts/governance_proposer.ts @@ -5,7 +5,7 @@ import { GovernanceProposerAbi } from '@aztec/l1-artifacts/GovernanceProposerAbi import { type GetContractReturnType, type Hex, type TransactionReceipt, encodeFunctionData, getContract } from 'viem'; import type { GasPrice, L1TxRequest, L1TxUtils } from '../l1_tx_utils.js'; -import type { ExtendedViemWalletClient, ViemClient } from '../types.js'; +import type { ViemClient } from '../types.js'; import { type IEmpireBase, encodeVote, encodeVoteWithSignature, signVoteWithSig } from './empire_base.js'; import { extractProposalIdFromLogs } from './governance.js'; @@ -68,11 +68,12 @@ export class GovernanceProposerContract implements IEmpireBase { public async createVoteRequestWithSignature( payload: Hex, - wallet: ExtendedViemWalletClient, + chainId: number, + signerAddress: Hex, signer: (msg: Hex) => Promise, ): Promise { - const nonce = await this.getNonce(wallet.account.address); - const signature = await signVoteWithSig(signer, payload, nonce, this.address.toString(), wallet.chain.id); + const nonce = await this.getNonce(signerAddress); + const signature = await signVoteWithSig(signer, payload, nonce, this.address.toString(), chainId); return { to: this.address.toString(), data: encodeVoteWithSignature(payload, signature), diff --git a/yarn-project/ethereum/src/contracts/slashing_proposer.ts b/yarn-project/ethereum/src/contracts/slashing_proposer.ts index 7ead4242fc99..5b708db5111e 100644 --- a/yarn-project/ethereum/src/contracts/slashing_proposer.ts +++ b/yarn-project/ethereum/src/contracts/slashing_proposer.ts @@ -13,7 +13,7 @@ import { } from 'viem'; import type { L1TxRequest, L1TxUtils } from '../l1_tx_utils.js'; -import type { ExtendedViemWalletClient, ViemClient } from '../types.js'; +import type { ViemClient } from '../types.js'; import { FormattedViemError } from '../utils.js'; import { type IEmpireBase, encodeVote, encodeVoteWithSignature, signVoteWithSig } from './empire_base.js'; @@ -75,11 +75,12 @@ export class SlashingProposerContract extends EventEmitter implements IEmpireBas public async createVoteRequestWithSignature( payload: Hex, - wallet: ExtendedViemWalletClient, + chainId: number, + signerAddress: Hex, signer: (msg: Hex) => Promise, ): Promise { - const nonce = await this.getNonce(wallet.account.address); - const signature = await signVoteWithSig(signer, payload, nonce, this.address.toString(), wallet.chain.id); + const nonce = await this.getNonce(signerAddress); + const signature = await signVoteWithSig(signer, payload, nonce, this.address.toString(), chainId); return { to: this.address.toString(), data: encodeVoteWithSignature(payload, signature), diff --git a/yarn-project/sequencer-client/src/publisher/sequencer-publisher.test.ts b/yarn-project/sequencer-client/src/publisher/sequencer-publisher.test.ts index 78dd58508e24..aaf5feba1f56 100644 --- a/yarn-project/sequencer-client/src/publisher/sequencer-publisher.test.ts +++ b/yarn-project/sequencer-client/src/publisher/sequencer-publisher.test.ts @@ -229,7 +229,13 @@ describe('SequencerPublisher', () => { }); rollup.getProposerAt.mockResolvedValueOnce(mockForwarderAddress); expect( - await publisher.enqueueCastVote(2n, 1n, VoteType.GOVERNANCE, hash => testHarnessPrivateKey.sign({ hash })), + await publisher.enqueueCastVote( + 2n, + 1n, + VoteType.GOVERNANCE, + EthAddress.fromString(testHarnessPrivateKey.address), + hash => testHarnessPrivateKey.sign({ hash }), + ), ).toEqual(true); forwardSpy.mockResolvedValue({ diff --git a/yarn-project/sequencer-client/src/publisher/sequencer-publisher.ts b/yarn-project/sequencer-client/src/publisher/sequencer-publisher.ts index 350c1c4f6b19..b1d2f137a8c2 100644 --- a/yarn-project/sequencer-client/src/publisher/sequencer-publisher.ts +++ b/yarn-project/sequencer-client/src/publisher/sequencer-publisher.ts @@ -119,7 +119,7 @@ export class SequencerPublisher { protected requests: RequestWithExpiry[] = []; constructor( - config: TxSenderConfig & PublisherConfig & Pick, + private config: TxSenderConfig & PublisherConfig & Pick, deps: { telemetry?: TelemetryClient; blobSinkClient?: BlobSinkClientInterface; @@ -406,6 +406,7 @@ export class SequencerPublisher { voteType: VoteType, payload: EthAddress, base: IEmpireBase, + signerAddress: EthAddress, signer: (msg: `0x${string}`) => Promise<`0x${string}`>, ): Promise { if (this.myLastVotes[voteType] >= slotNumber) { @@ -426,7 +427,12 @@ export class SequencerPublisher { const action = voteType === VoteType.GOVERNANCE ? 'governance-vote' : 'slashing-vote'; - const request = await base.createVoteRequestWithSignature(payload.toString(), this.l1TxUtils.client, signer); + const request = await base.createVoteRequestWithSignature( + payload.toString(), + this.config.l1ChainId, + signerAddress.toString(), + signer, + ); this.log.debug(`Created ${action} request with signature`, { request, round, @@ -481,6 +487,7 @@ export class SequencerPublisher { slotNumber: bigint, timestamp: bigint, voteType: VoteType, + signerAddress: EthAddress, signer: (msg: `0x${string}`) => Promise<`0x${string}`>, ): Promise { const voteConfig = await this.getVoteConfig(slotNumber, voteType); @@ -488,7 +495,7 @@ export class SequencerPublisher { return false; } const { payload, base } = voteConfig; - return this.enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base, signer); + return this.enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base, signerAddress, signer); } /** diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index 4940f171bc64..2d2ffab75c72 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -397,6 +397,7 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter this.validatorClient!.signWithAddress(proposerAddress, Buffer32.fromString(msg)).then(s => s.toString()), ); @@ -404,6 +405,7 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter this.validatorClient!.signWithAddress(proposerAddress, Buffer32.fromString(msg)).then(s => s.toString()), ); diff --git a/yarn-project/slasher/src/slasher_client.test.ts b/yarn-project/slasher/src/slasher_client.test.ts index d4dca0d76929..360f61c1772f 100644 --- a/yarn-project/slasher/src/slasher_client.test.ts +++ b/yarn-project/slasher/src/slasher_client.test.ts @@ -217,7 +217,8 @@ describe('SlasherClient', () => { // Have the slasher sign the vote request const voteRequest = await slashingProposer.createVoteRequestWithSignature( payload!.toString(), - slasherL1Client, + slasherL1Client.chain.id, + slasherPrivateKey.address, msg => slasherPrivateKey.sign({ hash: msg }), );