Skip to content

Is there way to view the constraints generated by barretenberg? #18168

@sshravan

Description

@sshravan

I am experimenting with Barretenberg and trying to understand the constraints it generates from ACIR:
Here is an example:

fn main(x: Field, y: pub Field) {
    let x3 = x * x * x;
    let res = x3 + x + 5;
    assert(res == y);
}
$ nargo execute --print-acir
$ bb prove -b ./target/hello_world.json -w ./target/hello_world.gz --write_vk -o target
$ noir-profiler gates --artifact-path ./target/hello_world.json --backend-path bb --output ./target -- --include_gates_per_opcode
Opcode count: 2, Total gates by opcodes: 3, Circuit size: 57

Is there a way to view or export the constraints that Barretenberg produces from ACIR, similar to how you can inspect constraints in PLONK-based systems? In other words, I am trying to understand where the 57 constraints come from for the above example. This is not really explained by the flamegraph of noir-profiler or the --print-acir flag.

Maybe something similar to this, of course, not the same.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions