From 9e50ee6b1b5522a68c81f153c646b63219b4eb72 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 20 Dec 2024 19:55:53 +0000 Subject: [PATCH 1/2] chore: update gates diff action --- .github/workflows/ci.yml | 6 +++--- noir-projects/gates_report.sh | 11 ++++++----- .../scripts/publicFunctionsSizeReport.js | 2 +- noir/noir-repo/test_programs/gates_report.sh | 8 ++++---- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 673bb2cd83b5..c80e40860453 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -447,7 +447,7 @@ jobs: - name: Copy Network Logs if: always() run: scripts/copy_from_tester yarn-project/end-to-end/scripts/network-test.log network-test.log || true - + - name: Upload Network Logs if: always() uses: actions/upload-artifact@v4 @@ -580,7 +580,7 @@ jobs: scripts/copy_from_builder ./noir-projects/gates_report.json protocol_circuits_report.json - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@510d7da8a7b027510ca0734761dfa9bcf3e8309d + uses: noir-lang/noir-gates-diff@84ada11295b9a1e1da7325af4e45e2db9f775175 continue-on-error: true timeout-minutes: 1 with: @@ -618,7 +618,7 @@ jobs: scripts/copy_from_builder noir-projects/public_functions_report.json public_functions_report.json - name: Compare public functions bytecode size reports id: public_functions_sizes_diff - uses: noir-lang/noir-gates-diff@d88f7523b013b9edd3f31c5cfddaef87a3fe1b48 + uses: noir-lang/noir-gates-diff@84ada11295b9a1e1da7325af4e45e2db9f775175 continue-on-error: true timeout-minutes: 1 with: diff --git a/noir-projects/gates_report.sh b/noir-projects/gates_report.sh index c1772d63aacf..568f358e4e02 100755 --- a/noir-projects/gates_report.sh +++ b/noir-projects/gates_report.sh @@ -38,16 +38,17 @@ for pathname in "$PROTOCOL_CIRCUITS_DIR/target"/*.json; do GATES_INFO=$($BB_BIN gates -h -b "$pathname") fi - MAIN_FUNCTION_INFO=$(echo $GATES_INFO | jq -r '.functions[0] | .name = "main"') - echo "{\"package_name\": \"$ARTIFACT_NAME\", \"functions\": [$MAIN_FUNCTION_INFO]" >> gates_report.json + GATES_INFO=$($BACKEND gates -b "$artifacts_path/$ARTIFACT_NAME/target/program.json") + MAIN_FUNCTION_INFO=$(echo $GATES_INFO | jq -r ".functions[0] | {package_name: "\"$ARTIFACT_NAME\"", functions: [{name: \"main\", opcodes: .acir_opcodes, circuit_size}]}") + echo -n $MAIN_FUNCTION_INFO >> gates_report.json if (($ITER == $NUM_ARTIFACTS)); then - echo "}" >> gates_report.json + echo "" >> gates_report.json else - echo "}, " >> gates_report.json + echo "," >> gates_report.json fi ITER=$(( $ITER + 1 )) done -echo "]}" >> gates_report.json \ No newline at end of file +echo "]}" >> gates_report.json diff --git a/noir-projects/noir-contracts/scripts/publicFunctionsSizeReport.js b/noir-projects/noir-contracts/scripts/publicFunctionsSizeReport.js index 9324690bd24b..a789b74e0237 100644 --- a/noir-projects/noir-contracts/scripts/publicFunctionsSizeReport.js +++ b/noir-projects/noir-contracts/scripts/publicFunctionsSizeReport.js @@ -44,7 +44,7 @@ async function main() { let func_with_contract_name = contractArtifact.name + "::" + func.brillig_names[0]; let program_report = { package_name: "", - functions: [{ name: "main", opcodes: 1 }], + functions: [], unconstrained_functions: [], } // Programs are compared by package name, so we make a unique one for each function here diff --git a/noir/noir-repo/test_programs/gates_report.sh b/noir/noir-repo/test_programs/gates_report.sh index 12e9ae0f864a..b7698f1ca783 100755 --- a/noir/noir-repo/test_programs/gates_report.sh +++ b/noir/noir-repo/test_programs/gates_report.sh @@ -24,13 +24,13 @@ for pathname in $test_dirs; do fi GATES_INFO=$($BACKEND gates -b "$artifacts_path/$ARTIFACT_NAME/target/program.json") - MAIN_FUNCTION_INFO=$(echo $GATES_INFO | jq -r '.functions[0] | .name = "main"') - echo "{\"package_name\": \"$ARTIFACT_NAME\", \"functions\": [$MAIN_FUNCTION_INFO]" >> gates_report.json + MAIN_FUNCTION_INFO=$(echo $GATES_INFO | jq -r ".functions[0] | {package_name: "\"$ARTIFACT_NAME\"", functions: [{name: \"main\", acir_opcodes, opcodes: .acir_opcodes, circuit_size}]}") + echo -n $MAIN_FUNCTION_INFO >> gates_report.json if (($ITER == $NUM_ARTIFACTS)); then - echo "}" >> gates_report.json + echo "" >> gates_report.json else - echo "}, " >> gates_report.json + echo "," >> gates_report.json fi ITER=$(( $ITER + 1 )) From 879fe9bf730a02aa00f6f8bf395bbe50f6f6eb83 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:10:34 +0000 Subject: [PATCH 2/2] Update noir-projects/gates_report.sh --- noir-projects/gates_report.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/noir-projects/gates_report.sh b/noir-projects/gates_report.sh index 568f358e4e02..79f0b445a747 100755 --- a/noir-projects/gates_report.sh +++ b/noir-projects/gates_report.sh @@ -38,7 +38,6 @@ for pathname in "$PROTOCOL_CIRCUITS_DIR/target"/*.json; do GATES_INFO=$($BB_BIN gates -h -b "$pathname") fi - GATES_INFO=$($BACKEND gates -b "$artifacts_path/$ARTIFACT_NAME/target/program.json") MAIN_FUNCTION_INFO=$(echo $GATES_INFO | jq -r ".functions[0] | {package_name: "\"$ARTIFACT_NAME\"", functions: [{name: \"main\", opcodes: .acir_opcodes, circuit_size}]}") echo -n $MAIN_FUNCTION_INFO >> gates_report.json