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

fix: Bump gates buffer for GoblinUltraHonk circuit size estimation #6163

Closed
wants to merge 7 commits into from
Closed
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
2 changes: 1 addition & 1 deletion barretenberg/acir_tests/run_acir_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export BIN CRS_PATH VERBOSE BRANCH
cd acir_tests

# Convert them to array
SKIP_ARRAY=(diamond_deps_0 workspace workspace_default_member witness_compression)
SKIP_ARRAY=(diamond_deps_0 workspace workspace_default_member)

function test() {
cd $1
Expand Down
9 changes: 7 additions & 2 deletions barretenberg/cpp/src/barretenberg/bb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,11 @@ void prove_honk(const std::string& bytecodePath, const std::string& witnessPath,

auto builder = acir_format::create_circuit<Builder>(constraint_system, 0, witness);

const size_t additional_gates_buffer = 15; // conservatively large to be safe
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/6161): Make the total circuit size estimation more
// accurate for GoblinUltraHonk so that we can remove this magic buffer
const size_t additional_gates_buffer = 30; // conservatively large to be safe
size_t srs_size = builder.get_circuit_subgroup_size(builder.get_total_circuit_size() + additional_gates_buffer);

init_bn254_crs(srs_size);

// Construct Honk proof
Expand Down Expand Up @@ -672,7 +675,9 @@ template <IsUltraFlavor Flavor> void write_vk_honk(const std::string& bytecodePa
auto constraint_system = get_constraint_system(bytecodePath);
auto builder = acir_format::create_circuit<Builder>(constraint_system, 0, {});

const size_t additional_gates_buffer = 15; // conservatively large to be safe
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/6161): Make the total circuit size estimation more
// accurate for GoblinUltraHonk so that we can remove this magic buffer
const size_t additional_gates_buffer = 30; // conservatively large to be safe
size_t srs_size = builder.get_circuit_subgroup_size(builder.get_total_circuit_size() + additional_gates_buffer);
init_bn254_crs(srs_size);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ template <class Flavor> class ProverInstance_ {
BB_OP_COUNT_TIME_NAME("ProverInstance(Circuit&)");
circuit.add_gates_to_ensure_all_polys_are_non_zero();
circuit.finalize_circuit();

// If using a structured trace, ensure that no block exceeds the fixed size
if (is_structured) {
for (auto& block : circuit.blocks.get()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ template <IsUltraFlavor Flavor> HonkProof& UltraProver_<Flavor>::construct_proof
OinkProver<Flavor> oink_prover(instance->proving_key, transcript);
auto [proving_key, relation_params, alphas] = oink_prover.prove();
instance->proving_key = std::move(proving_key);

instance->relation_parameters = std::move(relation_params);
instance->alphas = alphas;

Expand Down
Loading