From 57439a77b3420f5f1c2a1cc84473d613de30da49 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:41:23 +0000 Subject: [PATCH] chore: update gates diff action (#10917) This fixes a bunch of tech debt in the noir-gates-diff action and hopefully gets reports running again here. --- .github/workflows/ci.yml | 6 +++--- noir-projects/gates_report.sh | 10 +++++----- .../scripts/publicFunctionsSizeReport.js | 2 +- noir/noir-repo/test_programs/gates_report.sh | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 673bb2cd83b..c80e4086045 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 c1772d63aac..79f0b445a74 100755 --- a/noir-projects/gates_report.sh +++ b/noir-projects/gates_report.sh @@ -38,16 +38,16 @@ 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 + 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 9324690bd24..a789b74e023 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 12e9ae0f864..b7698f1ca78 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 ))