Skip to content

Commit

Permalink
feat: introduce blob circuit (#8101)
Browse files Browse the repository at this point in the history
I'm contributiiiiiiiiiiiiiiiiing!

Copying over the blob circuit from
https://github.com/iAmMichaelConnor/blob-lib.

Compiling this circuit takes 11 minutes, and two of the tests take 5
minutes each. So this might ruin CI.
We might need to use an alternative lignum library, or tweak Zac's
lignum library to make oracle calls to execute native ts/c++/rust code
instead of brillig unconstrained functions.

The typescript and solidity (and the part of the README which teaches
about blobs) will need to be copied over in a separate PR by someone who
knows their way around the monorepo :)
  • Loading branch information
iAmMichaelConnor authored Aug 21, 2024
1 parent 2d70215 commit 4bb3bac
Show file tree
Hide file tree
Showing 8 changed files with 9,492 additions and 0 deletions.
1 change: 1 addition & 0 deletions noir-projects/noir-protocol-circuits/Nargo.template.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
members = [
"crates/types",
"crates/blob",
"crates/parity-base",
"crates/parity-lib",
"crates/parity-root",
Expand Down
8 changes: 8 additions & 0 deletions noir-projects/noir-protocol-circuits/crates/blob/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "blob"
type = "bin"
authors = [""]
compiler_version = ">=0.30.0"

[dependencies]
bigint = {tag = "v0.3.0", git = "https://github.com/noir-lang/noir-bignum" }
24 changes: 24 additions & 0 deletions noir-projects/noir-protocol-circuits/crates/blob/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Constraint counts

Current count: 428,240.

## Compile:

`time nargo compile`

## Get gate count:

Install bbup: `curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/master/barretenberg/cpp/installation/install | bash`
The version of bb compatible with nargo 0.33.0 is `bbup --version 0.48.0`

`time bb gates_mega_honk -b ./target/blob.json`

## Generate, then serve a new flamegraph, after compiling:

<!-- `~/packages/noir/noir-repo/target/release/noir-profiler gates-flamegraph --artifact-path ./target/blob.json --backend-path ~/.bb/bb --output ./flamegraph -- -h && python3 -m http.server --directory "./flamegraph" 3000` -->

`~/packages/noir/noir-repo/target/release/noir-profiler gates-flamegraph --artifact-path ./target/blob.json --backend-path ~/.bb/bb --output ./flamegraph --backend-gates-command "gates_mega_honk" -- -h && python3 -m http.server --directory "./flamegraph" 3000`

## To serve an existing flamegraph:

`python3 -m http.server --directory "./flamegraph" 3000`
Loading

0 comments on commit 4bb3bac

Please sign in to comment.