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!: bump bb version to v0.77.0 #7599

Merged
merged 9 commits into from
Mar 5, 2025
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
2 changes: 1 addition & 1 deletion .github/scripts/integration-test-node.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -eu

apt-get install libc++-dev -y
apt-get install libc6 libstdc++6 -y
yarn workspace integration-tests test:node
2 changes: 1 addition & 1 deletion .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
compare_gates_reports:
name: Circuit sizes
needs: [build-nargo]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
pull-requests: write

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ jobs:

test-integration-node:
name: Integration Tests (Node)
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: [build-acvm-js, build-noir-wasm, build-nargo, build-noirc-abi]
timeout-minutes: 30

Expand All @@ -406,6 +406,7 @@ jobs:
run: |
./scripts/install_bb.sh
echo "$HOME/.bb/" >> $GITHUB_PATH
sudo apt-get install libc6 libstdc++6 -y

- name: Download nargo binary
uses: ./.github/actions/download-nargo
Expand Down Expand Up @@ -489,7 +490,7 @@ jobs:

test-examples:
name: Example scripts
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: [build-nargo, build-noir-execute]
timeout-minutes: 30

Expand All @@ -506,6 +507,7 @@ jobs:
run: |
./scripts/install_bb.sh
echo "$HOME/.bb/" >> $GITHUB_PATH
sudo apt-get install libc6 libstdc++6 -y

- name: Download nargo binary
uses: ./.github/actions/download-nargo
Expand Down
2 changes: 1 addition & 1 deletion compiler/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
},
"dependencies": {
"@aztec/bb.js": "0.72.1",
"@aztec/bb.js": "0.77.0",
"@noir-lang/noir_js": "workspace:*",
"@noir-lang/noir_wasm": "workspace:*",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
Expand Down
14 changes: 7 additions & 7 deletions compiler/integration-tests/scripts/codegen-verifiers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ KEYS=$(mktemp -d)
# Codegen verifier contract for 1_mul
mul_dir=$repo_root/test_programs/execution_success/1_mul
nargo --program-dir $mul_dir compile
$NARGO_BACKEND_PATH write_vk -b $mul_dir/target/1_mul.json -o $KEYS/1_mul
$NARGO_BACKEND_PATH contract -k $KEYS/1_mul -o $contracts_dir/1_mul.sol
$NARGO_BACKEND_PATH OLD_API write_vk -b $mul_dir/target/1_mul.json -o $KEYS/1_mul
$NARGO_BACKEND_PATH OLD_API contract -k $KEYS/1_mul -o $contracts_dir/1_mul.sol

# Codegen verifier contract for assert_statement
assert_statement_dir=$repo_root/test_programs/execution_success/assert_statement
nargo --program-dir $assert_statement_dir compile
$NARGO_BACKEND_PATH write_vk -b $assert_statement_dir/target/assert_statement.json -o $KEYS/assert_statement
$NARGO_BACKEND_PATH contract -k $KEYS/assert_statement -o $contracts_dir/assert_statement.sol
$NARGO_BACKEND_PATH OLD_API write_vk -b $assert_statement_dir/target/assert_statement.json -o $KEYS/assert_statement
$NARGO_BACKEND_PATH OLD_API contract -k $KEYS/assert_statement -o $contracts_dir/assert_statement.sol

# Codegen verifier contract for recursion
recursion_dir=$repo_root/compiler/integration-tests/circuits/recursion
nargo --program-dir $recursion_dir compile
$NARGO_BACKEND_PATH write_vk -b $recursion_dir/target/recursion.json -o $KEYS/recursion
$NARGO_BACKEND_PATH contract -k $KEYS/recursion ./ -o $contracts_dir/recursion.sol
$NARGO_BACKEND_PATH OLD_API write_vk -b $recursion_dir/target/recursion.json -o $KEYS/recursion
$NARGO_BACKEND_PATH OLD_API contract -k $KEYS/recursion -o $contracts_dir/recursion.sol

rm -rf $KEYS
rm -rf $KEYS
16 changes: 8 additions & 8 deletions examples/codegen_verifier/codegen_verifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ BACKEND=${BACKEND:-bb}
nargo compile

# TODO: backend should automatically generate vk if necessary.
$BACKEND write_vk -b ./target/hello_world.json
$BACKEND contract -o ./src/contract.sol
$BACKEND OLD_API write_vk -b ./target/hello_world.json
$BACKEND OLD_API contract -o ./src/contract.sol

# We now generate a proof and check whether the verifier contract will verify it.

nargo execute --pedantic-solving witness

PROOF_PATH=./target/proof
$BACKEND prove -b ./target/hello_world.json -w ./target/witness.gz -o $PROOF_PATH
$BACKEND OLD_API prove -b ./target/hello_world.json -w ./target/witness.gz -o $PROOF_PATH

# Sanity check that proof is valid.
$BACKEND verify -k ./target/vk -p ./target/proof
$BACKEND OLD_API verify -k ./target/vk -p ./target/proof

NUM_PUBLIC_INPUTS=2
PUBLIC_INPUT_BYTES=$((32 * $NUM_PUBLIC_INPUTS))
HEX_PUBLIC_INPUTS=$(head -c $PUBLIC_INPUT_BYTES $PROOF_PATH | od -An -v -t x1 | tr -d $' \n')
HEX_PROOF=$(tail -c +$(($PUBLIC_INPUT_BYTES + 1)) $PROOF_PATH | od -An -v -t x1 | tr -d $' \n')

# Split public inputs into strings where each string represents a `bytes32`.
SPLIT_HEX_PUBLIC_INPUTS=$(sed -e 's/.\{64\}/0x&,/g' <<< $HEX_PUBLIC_INPUTS)
SPLIT_HEX_PUBLIC_INPUTS=$(sed -e 's/.\{64\}/0x&,/g' <<<$HEX_PUBLIC_INPUTS)

# Spin up an anvil node to deploy the contract to
anvil &

DEPLOY_INFO=$(forge create UltraVerifier \
--rpc-url "127.0.0.1:8545" \
--private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \
--json)
--rpc-url "127.0.0.1:8545" \
--private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \
--json)
VERIFIER_ADDRESS=$(echo $DEPLOY_INFO | jq -r '.deployedTo')

# Call the verifier contract with our proof.
Expand Down
6 changes: 3 additions & 3 deletions examples/prove_and_verify/prove_and_verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ nargo execute --pedantic-solving witness

# TODO: `bb` should create `proofs` directory if it doesn't exist.
mkdir -p proofs
$BACKEND prove -b ./target/hello_world.json -w ./target/witness.gz
$BACKEND OLD_API prove -b ./target/hello_world.json -w ./target/witness.gz

# TODO: backend should automatically generate vk if necessary.
$BACKEND write_vk -b ./target/hello_world.json
$BACKEND verify -k ./target/vk -p ./proofs/proof
$BACKEND OLD_API write_vk -b ./target/hello_world.json
$BACKEND OLD_API verify -k ./target/vk -p ./proofs/proof
24 changes: 12 additions & 12 deletions examples/recursion/generate_recursive_proof.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ set -eu
BACKEND=${BACKEND:-bb}

nargo execute sum_witness --package sum
$BACKEND prove -b ./target/sum.json -w ./target/sum_witness.gz -o ./target/sum_proof --recursive
$BACKEND OLD_API prove -b ./target/sum.json -w ./target/sum_witness.gz -o ./target/sum_proof --recursive

# Once we have generated our inner proof, we must use this to generate inputs to `recurse_leaf``

$BACKEND write_vk -b ./target/sum.json -o ./target/sum_key --recursive
$BACKEND vk_as_fields -k ./target/sum_key -o ./target/sum_vk_as_fields
$BACKEND OLD_API write_vk -b ./target/sum.json -o ./target/sum_key --recursive
$BACKEND OLD_API vk_as_fields -k ./target/sum_key -o ./target/sum_vk_as_fields
VK_HASH=$(jq -r '.[0]' ./target/sum_vk_as_fields)
VK_AS_FIELDS=$(jq -r '.[1:]' ./target/sum_vk_as_fields)

FULL_PROOF_AS_FIELDS="$($BACKEND proof_as_fields -p ./target/sum_proof -k ./target/sum_key -o -)"
FULL_PROOF_AS_FIELDS="$($BACKEND OLD_API proof_as_fields -p ./target/sum_proof -k ./target/sum_key -o -)"
# sum has 3 public inputs
PUBLIC_INPUTS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[:3]')
PROOF_AS_FIELDS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[3:]')
Expand All @@ -28,19 +28,19 @@ echo "public_inputs = $PUBLIC_INPUTS" >> $RECURSE_LEAF_PROVER_TOML
# We can now execute and prove `recurse_leaf`

nargo execute recurse_leaf_witness --package recurse_leaf
$BACKEND prove -b ./target/recurse_leaf.json -w ./target/recurse_leaf_witness.gz -o ./target/recurse_leaf_proof --recursive
$BACKEND OLD_API prove -b ./target/recurse_leaf.json -w ./target/recurse_leaf_witness.gz -o ./target/recurse_leaf_proof --recursive

# Let's do a sanity check that the proof we've generated so far is valid.
$BACKEND write_vk -b ./target/recurse_leaf.json -o ./target/recurse_leaf_key --recursive
$BACKEND verify -p ./target/recurse_leaf_proof -k ./target/recurse_leaf_key
$BACKEND OLD_API write_vk -b ./target/recurse_leaf.json -o ./target/recurse_leaf_key --recursive
$BACKEND OLD_API verify -p ./target/recurse_leaf_proof -k ./target/recurse_leaf_key

# Now we generate the final `recurse_node` proof similarly to how we did for `recurse_leaf`.

$BACKEND vk_as_fields -k ./target/recurse_leaf_key -o ./target/recurse_leaf_vk_as_fields
$BACKEND OLD_API vk_as_fields -k ./target/recurse_leaf_key -o ./target/recurse_leaf_vk_as_fields
VK_HASH=$(jq -r '.[0]' ./target/recurse_leaf_vk_as_fields)
VK_AS_FIELDS=$(jq -r '.[1:]' ./target/recurse_leaf_vk_as_fields)

FULL_PROOF_AS_FIELDS="$($BACKEND proof_as_fields -p ./target/recurse_leaf_proof -k ./target/recurse_leaf_key -o -)"
FULL_PROOF_AS_FIELDS="$($BACKEND OLD_API proof_as_fields -p ./target/recurse_leaf_proof -k ./target/recurse_leaf_key -o -)"
# recurse_leaf has 4 public inputs (excluding aggregation object)
PUBLIC_INPUTS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[:4]')
PROOF_AS_FIELDS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[4:]')
Expand All @@ -54,8 +54,8 @@ echo "public_inputs = $PUBLIC_INPUTS" >> $RECURSE_NODE_PROVER_TOML
# We can now execute and prove `recurse_node`

nargo execute recurse_node_witness --package recurse_node
$BACKEND prove -b ./target/recurse_node.json -w ./target/recurse_node_witness.gz -o ./target/recurse_node_proof
$BACKEND OLD_API prove -b ./target/recurse_node.json -w ./target/recurse_node_witness.gz -o ./target/recurse_node_proof

# We finally verify that the generated recursive proof is valid.
$BACKEND write_vk -b ./target/recurse_node.json -o ./target/recurse_node_key
$BACKEND verify -p ./target/recurse_node_proof -k ./target/recurse_node_key
$BACKEND OLD_API write_vk -b ./target/recurse_node.json -o ./target/recurse_node_key
$BACKEND OLD_API verify -p ./target/recurse_node_proof -k ./target/recurse_node_key
4 changes: 2 additions & 2 deletions scripts/install_bb.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

VERSION="0.72.1"
VERSION="0.77.0"

BBUP_PATH=~/.bb/bbup

if ! [ -f $BBUP_PATH ]; then
curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/master/barretenberg/cpp/installation/install | bash
curl -L https://bbup.aztec.network | bash
fi

$BBUP_PATH -v $VERSION
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ __metadata:
languageName: node
linkType: hard

"@aztec/bb.js@npm:0.72.1":
version: 0.72.1
resolution: "@aztec/bb.js@npm:0.72.1"
"@aztec/bb.js@npm:0.77.0":
version: 0.77.0
resolution: "@aztec/bb.js@npm:0.77.0"
dependencies:
comlink: ^4.4.1
commander: ^12.1.0
Expand All @@ -233,7 +233,7 @@ __metadata:
tslib: ^2.4.0
bin:
bb.js: dest/node/main.js
checksum: 143f0062a31e262ceff6e454d31e2a2672afd8dcbff0dafb17d5308f8c5312048e5d3503d80e7ad9ff4b17b6c3d36e8ffbff8d2deda2cdb684f19fa64d5a04ab
checksum: d3ffe7c9928f4b98aa3619d1dc0c217a0f1a293045f3fab8d43e25d7dfa397b3ec9770f1e18503798d40bddc8fbd189136c7884574410d4b7e19ee0df1bcb5f6
languageName: node
linkType: hard

Expand Down Expand Up @@ -16609,7 +16609,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "integration-tests@workspace:compiler/integration-tests"
dependencies:
"@aztec/bb.js": 0.72.1
"@aztec/bb.js": 0.77.0
"@noir-lang/noir_js": "workspace:*"
"@noir-lang/noir_wasm": "workspace:*"
"@nomicfoundation/hardhat-chai-matchers": ^2.0.0
Expand Down
Loading