diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/gate_count_constants.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/gate_count_constants.hpp index faad18e4cda0..6950442ec33b 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/gate_count_constants.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/gate_count_constants.hpp @@ -113,7 +113,7 @@ constexpr std::tuple HONK_RECURSION_CONSTANTS( // ======================================== // Gate count for Chonk recursive verification (Ultra with RollupIO) -inline constexpr size_t CHONK_RECURSION_GATES = 1491593; +inline constexpr size_t CHONK_RECURSION_GATES = 1491767; // ======================================== // Hypernova Recursion Constants @@ -147,7 +147,7 @@ inline constexpr size_t HIDING_KERNEL_ULTRA_OPS = 127; // ======================================== // Gate count for ECCVM recursive verifier (Ultra-arithmetized) -inline constexpr size_t ECCVM_RECURSIVE_VERIFIER_GATE_COUNT = 224336; +inline constexpr size_t ECCVM_RECURSIVE_VERIFIER_GATE_COUNT = 224510; // ======================================== // Goblin AVM Recursive Verifier Constants diff --git a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation.hpp b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation.hpp index 3c40113c16cc..cd2da009e911 100644 --- a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation.hpp @@ -99,11 +99,13 @@ template class ECCVMTranscriptRelationImpl { INFINITY_ACC_X = 29, // Infinity flag consistency: acc_y = 0 when accumulator empty INFINITY_ACC_Y = 30, + // Boundary: accumulator_not_empty must be 0 at lagrange_first row + ACCUMULATOR_NOT_EMPTY_INIT = 31, NUM_SUBRELATIONS, }; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS{ - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS{ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, }; static_assert(NUM_SUBRELATIONS == SUBRELATION_PARTIAL_LENGTHS.size()); diff --git a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation_impl.hpp b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation_impl.hpp index 17302c0ff69b..e11c92142bc3 100644 --- a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation_impl.hpp @@ -566,5 +566,14 @@ void ECCVMTranscriptRelationImpl::accumulate(ContainerOverSubrelations& accu is_accumulator_empty * transcript_accumulator_x * scaling_factor; // degree 2 std::get(accumulator) += is_accumulator_empty * transcript_accumulator_y * scaling_factor; // degree 2 + + /** + * @brief Enforce accumulator_not_empty = 0 at the lagrange_first row. + * Without this, a malicious prover can set accumulator_not_empty = 1 at the lagrange_first row, + * which disables INFINITY_ACC_X/Y above, allowing arbitrary accumulator coordinates to be injected + * without any relation catching it. + */ + std::get(accumulator) += + lagrange_first * View(in.transcript_accumulator_not_empty) * scaling_factor; // degree 2 } } // namespace bb