From b5c85820e68dfafd16d956d93fecc6e678a6221b Mon Sep 17 00:00:00 2001 From: jeanmon Date: Fri, 29 Nov 2024 09:49:26 +0000 Subject: [PATCH 1/2] Public inputs in unit tests with proving were incorrectly set --- .../cpp/src/barretenberg/vm/avm/tests/helpers.test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/helpers.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/helpers.test.cpp index a7ea3f13f80..40663fe59b6 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/helpers.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/helpers.test.cpp @@ -71,8 +71,10 @@ void validate_trace(std::vector&& trace, AvmVerifier verifier = composer.create_verifier(circuit_builder); - std::vector> public_inputs_as_vec{}; - // TODO: Copy public inputs + // At the current development stage (new public inputs for whole tx), we are not handling public related inputs + // except calldata and returndata. + std::vector> public_inputs_as_vec{ {}, {}, {}, {}, calldata, returndata }; + // TODO: Copy all public inputs // bb::avm_trace::copy_public_inputs_columns(public_inputs_with_end_gas, calldata, returndata); bool verified = verifier.verify_proof(proof, { public_inputs_as_vec }); From e22ae09a1177bf7b65882ba8549ed2920d97fe12 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Fri, 29 Nov 2024 10:47:19 +0000 Subject: [PATCH 2/2] Fix statistics on number of non zero columns --- barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp index 828b46a01e3..cab6b49ddb5 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp @@ -125,7 +125,7 @@ void show_trace_info(const auto& trace) 100 * nonzero_elements / total_elements, "%)"); const size_t non_zero_columns = [&]() { - bool column_is_nonzero[trace.front().SIZE]; + std::vector column_is_nonzero(trace.front().SIZE, false); for (auto const& row : trace) { const auto row_vec = row.as_vector(); for (size_t col = 0; col < row.SIZE; col++) { @@ -134,7 +134,7 @@ void show_trace_info(const auto& trace) } } } - return static_cast(std::count(column_is_nonzero, column_is_nonzero + trace.front().SIZE, true)); + return static_cast(std::count(column_is_nonzero.begin(), column_is_nonzero.end(), true)); }(); vinfo("Number of non-zero columns: ", non_zero_columns,