Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Public inputs in unit tests with proving were incorrectly set #10300

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ void validate_trace(std::vector<Row>&& trace,

AvmVerifier verifier = composer.create_verifier(circuit_builder);

std::vector<std::vector<FF>> 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<std::vector<FF>> 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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> 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++) {
Expand All @@ -134,7 +134,7 @@ void show_trace_info(const auto& trace)
}
}
}
return static_cast<size_t>(std::count(column_is_nonzero, column_is_nonzero + trace.front().SIZE, true));
return static_cast<size_t>(std::count(column_is_nonzero.begin(), column_is_nonzero.end(), true));
}();
vinfo("Number of non-zero columns: ",
non_zero_columns,
Expand Down