Skip to content

Commit

Permalink
chore: update gates diff action (#10917)
Browse files Browse the repository at this point in the history
This fixes a bunch of tech debt in the noir-gates-diff action and
hopefully gets reports running again here.
  • Loading branch information
TomAFrench authored Dec 20, 2024
1 parent 5260f1e commit 57439a7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions noir-projects/gates_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
echo "]}" >> gates_report.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions noir/noir-repo/test_programs/gates_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ))
Expand Down

0 comments on commit 57439a7

Please sign in to comment.