From be746cab57f62892b02a54eb392e6e16d2d102e1 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Sat, 15 Mar 2025 20:47:42 +0000 Subject: [PATCH 1/3] chore: bump bb --- compiler/integration-tests/package.json | 2 +- .../test/node/smart_contract_verifier.test.ts | 2 +- examples/recursion/generate_recursive_proof.sh | 8 ++++---- examples/recursion/recurse_leaf/src/main.nr | 2 +- examples/recursion/recurse_node/src/main.nr | 2 +- scripts/install_bb.sh | 2 +- yarn.lock | 10 +++++----- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/compiler/integration-tests/package.json b/compiler/integration-tests/package.json index c1d2e0530ae..36d905d144c 100644 --- a/compiler/integration-tests/package.json +++ b/compiler/integration-tests/package.json @@ -13,7 +13,7 @@ "lint": "NODE_NO_WARNINGS=1 eslint . --max-warnings 0" }, "dependencies": { - "@aztec/bb.js": "0.77.1", + "@aztec/bb.js": "0.81.0", "@noir-lang/noir_js": "workspace:*", "@noir-lang/noir_wasm": "workspace:*", "@nomicfoundation/hardhat-chai-matchers": "^2.0.8", diff --git a/compiler/integration-tests/test/node/smart_contract_verifier.test.ts b/compiler/integration-tests/test/node/smart_contract_verifier.test.ts index da8a76ba6a7..9e23aa579fe 100644 --- a/compiler/integration-tests/test/node/smart_contract_verifier.test.ts +++ b/compiler/integration-tests/test/node/smart_contract_verifier.test.ts @@ -58,7 +58,7 @@ test_cases.forEach((testInfo) => { const contract = await ethers.deployContract(testInfo.compiled, []); - const result = await contract.verify(proofData.proof.slice(4), proofData.publicInputs); + const result = await contract.verify(proofData.proof, proofData.publicInputs); expect(result).to.be.true; }); diff --git a/examples/recursion/generate_recursive_proof.sh b/examples/recursion/generate_recursive_proof.sh index 570db014c80..778f86360ce 100755 --- a/examples/recursion/generate_recursive_proof.sh +++ b/examples/recursion/generate_recursive_proof.sh @@ -16,8 +16,8 @@ FULL_PROOF_AS_FIELDS="$($BACKEND prove -b ./target/sum.json -w ./target/sum_witn echo $FULL_PROOF_AS_FIELDS | jq 'length' # sum has 3 public inputs -PUBLIC_INPUTS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[3:6]') -PROOF_AS_FIELDS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[:3] + .[6:]') +PUBLIC_INPUTS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[:3]') +PROOF_AS_FIELDS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[3:]') RECURSE_LEAF_PROVER_TOML=./recurse_leaf/Prover.toml echo -n "" > $RECURSE_LEAF_PROVER_TOML @@ -46,8 +46,8 @@ VK_AS_FIELDS=$(jq -r '.[0:]' ./target/recurse_leaf_vk_as_fields) FULL_PROOF_AS_FIELDS="$($BACKEND prove -b ./target/recurse_leaf.json -w ./target/recurse_leaf_witness.gz --honk_recursion 1 --init_kzg_accumulator --output_format fields -o -)" # recurse_leaf has 4 public inputs (excluding aggregation object) -PUBLIC_INPUTS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[3:7]') -PROOF_AS_FIELDS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[:3] + .[7:]') +PUBLIC_INPUTS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[:4]') +PROOF_AS_FIELDS=$(echo $FULL_PROOF_AS_FIELDS | jq -r '.[4:]') RECURSE_NODE_PROVER_TOML=./recurse_node/Prover.toml echo -n "" > $RECURSE_NODE_PROVER_TOML diff --git a/examples/recursion/recurse_leaf/src/main.nr b/examples/recursion/recurse_leaf/src/main.nr index 7987ea18b78..c49a0a9a3a5 100644 --- a/examples/recursion/recurse_leaf/src/main.nr +++ b/examples/recursion/recurse_leaf/src/main.nr @@ -1,5 +1,5 @@ global ULTRA_HONK_VK_SIZE: u32 = 128; -global ULTRA_HONK_PROOF_SIZE: u32 = 459; +global ULTRA_HONK_PROOF_SIZE: u32 = 456; global NUM_NON_ACCUMULATOR_PUBLIC_INPUTS: u32 = 3; global HONK_IDENTIFIER: u32 = 1; diff --git a/examples/recursion/recurse_node/src/main.nr b/examples/recursion/recurse_node/src/main.nr index aa19783a50b..f0531c96f0f 100644 --- a/examples/recursion/recurse_node/src/main.nr +++ b/examples/recursion/recurse_node/src/main.nr @@ -1,5 +1,5 @@ global ULTRA_HONK_VK_SIZE: u32 = 128; -global ULTRA_HONK_PROOF_SIZE: u32 = 459; // Number of fields when recursion is enabled +global ULTRA_HONK_PROOF_SIZE: u32 = 456; // Number of fields when recursion is enabled global NUM_NON_ACCUMULATOR_PUBLIC_INPUTS: u32 = 4; global HONK_IDENTIFIER: u32 = 1; diff --git a/scripts/install_bb.sh b/scripts/install_bb.sh index e95bd50a0f0..a94f4d09905 100755 --- a/scripts/install_bb.sh +++ b/scripts/install_bb.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="0.77.1" +VERSION="0.81.0" BBUP_PATH=~/.bb/bbup diff --git a/yarn.lock b/yarn.lock index c89194c7088..3da846e575d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -238,9 +238,9 @@ __metadata: languageName: node linkType: hard -"@aztec/bb.js@npm:0.77.1": - version: 0.77.1 - resolution: "@aztec/bb.js@npm:0.77.1" +"@aztec/bb.js@npm:0.81.0": + version: 0.81.0 + resolution: "@aztec/bb.js@npm:0.81.0" dependencies: comlink: "npm:^4.4.1" commander: "npm:^12.1.0" @@ -250,7 +250,7 @@ __metadata: tslib: "npm:^2.4.0" bin: bb.js: dest/node/main.js - checksum: 10/fdfb27a52b326d5fc9c5119ce70bc8277fdccc8c7e5edcc7d4100904af25de3fffb59eb61cb3d0edbab9eac51555b86a81638946f1288d3b227566c7e6ad83a2 + checksum: 10/0ef05d95590f4126d1deca033f7443e89a66c3cd8985b93fe71a2c90a570e54085deb1ab67379de1c2c7ec32e9e75532f45b7e1df194fd056a4f070cfe822acd languageName: node linkType: hard @@ -18699,7 +18699,7 @@ __metadata: version: 0.0.0-use.local resolution: "integration-tests@workspace:compiler/integration-tests" dependencies: - "@aztec/bb.js": "npm:0.77.1" + "@aztec/bb.js": "npm:0.81.0" "@noir-lang/noir_js": "workspace:*" "@noir-lang/noir_wasm": "workspace:*" "@nomicfoundation/hardhat-chai-matchers": "npm:^2.0.8" From 4f85403a34a1affd3410f2293b9ebe14b58b851b Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Sat, 15 Mar 2025 21:25:15 +0000 Subject: [PATCH 2/3] . --- examples/solidity_verifier/solidity_verifier.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/solidity_verifier/solidity_verifier.sh b/examples/solidity_verifier/solidity_verifier.sh index 50b91fac742..dccb22323e7 100755 --- a/examples/solidity_verifier/solidity_verifier.sh +++ b/examples/solidity_verifier/solidity_verifier.sh @@ -23,17 +23,14 @@ PROOF_HEX=$(cat $PROOF_PATH | od -An -v -t x1 | tr -d $' \n' | sed 's/^.\{8\}//' NUM_PUBLIC_INPUTS=2 PUBLIC_INPUT_HEX_CHARS=$((32 * $NUM_PUBLIC_INPUTS * 2)) # Each public input is 32 bytes, 2 chars per byte -PUBLIC_INPUT_OFFSET_CHARS=$((96 * 2)) # First 96 bytes are the proof header -# Extract public inputs from proof - from 96th byte to 96 + 32 * NUM_PUBLIC_INPUTS bytes -HEX_PUBLIC_INPUTS=${PROOF_HEX:$PUBLIC_INPUT_OFFSET_CHARS:$PUBLIC_INPUT_HEX_CHARS} +# Extract public inputs from proof - first 32 * NUM_PUBLIC_INPUTS bytes +HEX_PUBLIC_INPUTS=${PROOF_HEX:0:$PUBLIC_INPUT_HEX_CHARS} # Split public inputs into strings where each string represents a `bytes32`. SPLIT_HEX_PUBLIC_INPUTS=$(sed -e 's/.\{64\}/0x&,/g' <<<$HEX_PUBLIC_INPUTS) -# Extract proof without public inputs - from 0 to 96 bytes + the part after public inputs -PROOF_WITHOUT_PUBLIC_INPUTS_START=${PROOF_HEX:0:$PUBLIC_INPUT_OFFSET_CHARS} -PROOF_WITHOUT_PUBLIC_INPUTS_END=${PROOF_HEX:$(($PUBLIC_INPUT_OFFSET_CHARS + $PUBLIC_INPUT_HEX_CHARS))} -PROOF_WITHOUT_PUBLIC_INPUTS="${PROOF_WITHOUT_PUBLIC_INPUTS_START}${PROOF_WITHOUT_PUBLIC_INPUTS_END}" +# Extract proof without public inputs +PROOF_WITHOUT_PUBLIC_INPUTS=${PROOF_HEX:$PUBLIC_INPUT_HEX_CHARS} # Spin up an anvil node to deploy the contract to anvil & From bc1a87b853ecd6d16f6f70b5bb0d9111db25f42d Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Tue, 18 Mar 2025 10:57:46 +0000 Subject: [PATCH 3/3] Update compiler/integration-tests/test/node/smart_contract_verifier.test.ts --- .../integration-tests/test/node/smart_contract_verifier.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/integration-tests/test/node/smart_contract_verifier.test.ts b/compiler/integration-tests/test/node/smart_contract_verifier.test.ts index 9e23aa579fe..da8a76ba6a7 100644 --- a/compiler/integration-tests/test/node/smart_contract_verifier.test.ts +++ b/compiler/integration-tests/test/node/smart_contract_verifier.test.ts @@ -58,7 +58,7 @@ test_cases.forEach((testInfo) => { const contract = await ethers.deployContract(testInfo.compiled, []); - const result = await contract.verify(proofData.proof, proofData.publicInputs); + const result = await contract.verify(proofData.proof.slice(4), proofData.publicInputs); expect(result).to.be.true; });