From ddb8371be0625fa08886a7ca698d3aa32be77eff Mon Sep 17 00:00:00 2001 From: sirasistant Date: Mon, 18 Dec 2023 12:04:32 +0000 Subject: [PATCH 1/7] test: install nargo from source --- .github/workflows/noir-gas-diff.yml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/noir-gas-diff.yml diff --git a/.github/workflows/noir-gas-diff.yml b/.github/workflows/noir-gas-diff.yml new file mode 100644 index 000000000000..60826c1527c4 --- /dev/null +++ b/.github/workflows/noir-gas-diff.yml @@ -0,0 +1,38 @@ +name: Report gates diff + +on: + push: + branches: + - master + pull_request: + +jobs: + compare_gas_reports: + runs-on: ubuntu-latest + steps: + - name: Install noirup + run: | + curl -L $INSTALL_URL | bash + echo "${HOME}/.nargo/bin" >> $GITHUB_PATH + env: + INSTALL_URL: https://raw.githubusercontent.com/noir-lang/noirup/main/install + NOIRUP_BIN_URL: https://raw.githubusercontent.com/noir-lang/noirup/main/noirup + + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo + + - name: Install Barretenberg dependencies + run: sudo apt update && sudo apt install clang lld cmake libomp-dev + + - name: Install nargo from source with noirup + run: noirup $toolchain + env: + toolchain: --path ./noir + - name: Check nargo installation + run: nargo --version \ No newline at end of file From b7bbf12e33e67206bd9440cbea88d48399987235 Mon Sep 17 00:00:00 2001 From: sirasistant Date: Mon, 18 Dec 2023 12:57:05 +0000 Subject: [PATCH 2/7] check --- .github/workflows/noir-gas-diff.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/noir-gas-diff.yml b/.github/workflows/noir-gas-diff.yml index 60826c1527c4..62ffe9c650bb 100644 --- a/.github/workflows/noir-gas-diff.yml +++ b/.github/workflows/noir-gas-diff.yml @@ -29,7 +29,8 @@ jobs: - name: Install Barretenberg dependencies run: sudo apt update && sudo apt install clang lld cmake libomp-dev - + - name: ls + run: ls -la - name: Install nargo from source with noirup run: noirup $toolchain env: From 4a88c5411d3bffadd4408f62ec31fbb6d03b7e7f Mon Sep 17 00:00:00 2001 From: sirasistant Date: Mon, 18 Dec 2023 13:02:58 +0000 Subject: [PATCH 3/7] fix: add checkout --- .github/workflows/noir-gas-diff.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/noir-gas-diff.yml b/.github/workflows/noir-gas-diff.yml index 62ffe9c650bb..bbc78f832283 100644 --- a/.github/workflows/noir-gas-diff.yml +++ b/.github/workflows/noir-gas-diff.yml @@ -10,6 +10,10 @@ jobs: compare_gas_reports: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install noirup run: | curl -L $INSTALL_URL | bash From 32fc918b447cacdfabb2440d012c8c4d23fae62a Mon Sep 17 00:00:00 2001 From: sirasistant Date: Mon, 18 Dec 2023 13:10:43 +0000 Subject: [PATCH 4/7] feat: add gates report --- .github/workflows/noir-gas-diff.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/noir-gas-diff.yml b/.github/workflows/noir-gas-diff.yml index bbc78f832283..4e0234985fc6 100644 --- a/.github/workflows/noir-gas-diff.yml +++ b/.github/workflows/noir-gas-diff.yml @@ -14,6 +14,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Install noirup run: | curl -L $INSTALL_URL | bash @@ -33,11 +34,31 @@ jobs: - name: Install Barretenberg dependencies run: sudo apt update && sudo apt install clang lld cmake libomp-dev - - name: ls - run: ls -la + - name: Install nargo from source with noirup run: noirup $toolchain env: toolchain: --path ./noir + - name: Check nargo installation - run: nargo --version \ No newline at end of file + run: nargo --version + + - name: Generate gates report + working-directory: ./yarn-project/noir-protocol-circuits/src + run: | + ./gates_report.sh + mv gates_report.json ../../../gates_report.json + - name: Compare gates reports + id: gates_diff + uses: TomAFrench/noir-gates-diff@e7cf131b7e7f044c01615f93f0b855f65ddc02d4 + with: + report: gates_report.json + summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) + + - name: Add gates diff to sticky comment + if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' + uses: marocchino/sticky-pull-request-comment@v2 + with: + # delete the comment in case changes no longer impact circuit sizes + delete: ${{ !steps.gates_diff.outputs.markdown }} + message: ${{ steps.gates_diff.outputs.markdown }} From b73ba4a804ea56abea125c616b0114982adfe1a8 Mon Sep 17 00:00:00 2001 From: sirasistant Date: Mon, 18 Dec 2023 13:19:40 +0000 Subject: [PATCH 5/7] fix: fix generate gates report --- .github/workflows/noir-gas-diff.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/noir-gas-diff.yml b/.github/workflows/noir-gas-diff.yml index 4e0234985fc6..d0e4356dfb18 100644 --- a/.github/workflows/noir-gas-diff.yml +++ b/.github/workflows/noir-gas-diff.yml @@ -39,21 +39,21 @@ jobs: run: noirup $toolchain env: toolchain: --path ./noir - + - name: Check nargo installation run: nargo --version - name: Generate gates report working-directory: ./yarn-project/noir-protocol-circuits/src run: | - ./gates_report.sh + nargo info --json > gates_report.json mv gates_report.json ../../../gates_report.json - name: Compare gates reports id: gates_diff uses: TomAFrench/noir-gates-diff@e7cf131b7e7f044c01615f93f0b855f65ddc02d4 with: report: gates_report.json - summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) + summaryQuantile: 1 # Display any diff in gate count - name: Add gates diff to sticky comment if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' From 6ae07da1773b436c795efe6a8855498d4920bd2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Rodr=C3=ADguez?= Date: Mon, 18 Dec 2023 14:34:40 +0100 Subject: [PATCH 6/7] Update .github/workflows/noir-gas-diff.yml --- .github/workflows/noir-gas-diff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/noir-gas-diff.yml b/.github/workflows/noir-gas-diff.yml index d0e4356dfb18..4df87df7b417 100644 --- a/.github/workflows/noir-gas-diff.yml +++ b/.github/workflows/noir-gas-diff.yml @@ -7,7 +7,7 @@ on: pull_request: jobs: - compare_gas_reports: + compare_gate_reports: runs-on: ubuntu-latest steps: - name: Checkout From d4433c100ce4152f1c0a180cbb70c72b075e90e6 Mon Sep 17 00:00:00 2001 From: sirasistant Date: Mon, 18 Dec 2023 13:35:49 +0000 Subject: [PATCH 7/7] chore: renames --- ...{noir-gas-diff.yml => protocol-circuits-gate-diff.yml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{noir-gas-diff.yml => protocol-circuits-gate-diff.yml} (89%) diff --git a/.github/workflows/noir-gas-diff.yml b/.github/workflows/protocol-circuits-gate-diff.yml similarity index 89% rename from .github/workflows/noir-gas-diff.yml rename to .github/workflows/protocol-circuits-gate-diff.yml index d0e4356dfb18..1d8c445c9afa 100644 --- a/.github/workflows/noir-gas-diff.yml +++ b/.github/workflows/protocol-circuits-gate-diff.yml @@ -7,7 +7,7 @@ on: pull_request: jobs: - compare_gas_reports: + compare_protocol_circuits_gates: runs-on: ubuntu-latest steps: - name: Checkout @@ -46,13 +46,13 @@ jobs: - name: Generate gates report working-directory: ./yarn-project/noir-protocol-circuits/src run: | - nargo info --json > gates_report.json - mv gates_report.json ../../../gates_report.json + nargo info --json > protocol_circuits_report.json + mv protocol_circuits_report.json ../../../protocol_circuits_report.json - name: Compare gates reports id: gates_diff uses: TomAFrench/noir-gates-diff@e7cf131b7e7f044c01615f93f0b855f65ddc02d4 with: - report: gates_report.json + report: protocol_circuits_report.json summaryQuantile: 1 # Display any diff in gate count - name: Add gates diff to sticky comment