From bfaefa8b696b1fad58398f9d51ab9ed77194eb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 20 Dec 2023 12:06:49 +0000 Subject: [PATCH 01/21] Testing notification --- .github/workflows/testingslack.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/testingslack.yaml diff --git a/.github/workflows/testingslack.yaml b/.github/workflows/testingslack.yaml new file mode 100644 index 0000000..24185d5 --- /dev/null +++ b/.github/workflows/testingslack.yaml @@ -0,0 +1,21 @@ +name: Testing + +on: + # Giving ourselves a way to trigger this manually + push: + +jobs: + testing: + runs-on: ubuntu-latest + steps: + - name: Send GitHub Action trigger data to Slack workflow + id: slack + uses: slackapi/slack-github-action@v1.24.0 + with: + # This data can be any valid JSON from a previous step in the GitHub Action + payload: | + { + "text": "Testing - From github PR action" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 2d634a59fd987df17e851de5d2274a8f11bf03c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 20 Dec 2023 12:17:10 +0000 Subject: [PATCH 02/21] Adding matrix to support more tests, integrating notification --- .github/workflows/nightly.yaml | 31 ++++++++++++++++++++++------- .github/workflows/testingslack.yaml | 16 --------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 456e51e..1dddde5 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -37,7 +37,11 @@ jobs: run: working-directory: vite-hardhat strategy: - matrix: ${{fromJson(needs.setup.outputs.matrix)}} + matrix: + version: + - version: ${{fromJson(needs.setup.outputs.matrix.key)}} + - version_number: ${{fromJson(needs.setup.outputs.matrix.value)}} + project: [vite-hardhat] steps: - uses: actions/checkout@v4 @@ -45,15 +49,15 @@ jobs: uses: ./.github/actions/setup with: project: vite-hardhat - version: ${{ matrix.value }} + version: ${{ matrix.version.version_number }} - name: Install test version run: | yarn add \ - @noir-lang/noir_js@${{ matrix.value }} \ - @noir-lang/backend_barretenberg@${{ matrix.value }} \ - @noir-lang/noir_wasm@${{ matrix.value }} \ - @noir-lang/types@${{ matrix.value }} + @noir-lang/noir_js@${{ matrix.version.version_number }} \ + @noir-lang/backend_barretenberg@${{ matrix.version.version_number }} \ + @noir-lang/noir_wasm@${{ matrix.version.version_number }} \ + @noir-lang/types@${{ matrix.version.version_number }} - name: 'Create env file' run: | @@ -70,4 +74,17 @@ jobs: - name: Run test run: yarn test - continue-on-error: ${{ matrix.key == 'prerelease' }} + id: yarn_test + continue-on-error: ${{ matrix.version.version == 'prerelease' }} + + - name: Send GitHub Action trigger data to Slack workflow + id: slack + uses: slackapi/slack-github-action@v1.24.0 + if: ${{ failure() && matrix.version.version == 'prerelease' }} + with: + payload: | + { + "text": "Hey! Just to let you know that once the prerelease becomes stable, you'll need to update the following project: ${{ matrix.project }}. ", + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/testingslack.yaml b/.github/workflows/testingslack.yaml index 24185d5..1e2acf2 100644 --- a/.github/workflows/testingslack.yaml +++ b/.github/workflows/testingslack.yaml @@ -3,19 +3,3 @@ name: Testing on: # Giving ourselves a way to trigger this manually push: - -jobs: - testing: - runs-on: ubuntu-latest - steps: - - name: Send GitHub Action trigger data to Slack workflow - id: slack - uses: slackapi/slack-github-action@v1.24.0 - with: - # This data can be any valid JSON from a previous step in the GitHub Action - payload: | - { - "text": "Testing - From github PR action" - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 3937265c1ce2954cd4916873f81b86eef3fc32cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 20 Dec 2023 12:21:21 +0000 Subject: [PATCH 03/21] Trying to use matrix for top-level working directory... --- .github/scripts/latest.js | 2 +- .github/workflows/nightly.yaml | 6 +++--- .github/workflows/testingslack.yaml | 5 ----- 3 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 .github/workflows/testingslack.yaml diff --git a/.github/scripts/latest.js b/.github/scripts/latest.js index 3052b74..2355b1c 100644 --- a/.github/scripts/latest.js +++ b/.github/scripts/latest.js @@ -20,7 +20,7 @@ async function main() { const latestPreRelease = filtered.find(release => release.prerelease).tag_name; // TODO: add the prerelease to this object! - const workflowOutput = JSON.stringify({ stable: latestStable }); + const workflowOutput = JSON.stringify({ stable: latestStable, prerelease: latestPreRelease }); console.log(workflowOutput); // DON'T REMOVE, GITHUB WILL CAPTURE THIS OUTPUT } diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 1dddde5..f885031 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -30,18 +30,18 @@ jobs: MATRIX=$(echo "$VERSIONS" | jq -c '{versions: .} | .versions | to_entries | map({key: .key, value: (.value | sub("^v"; ""))})') echo "::set-output name=matrix::{\"include\":$MATRIX}" - test-drift-vite-hardhat: + test-drift: needs: setup runs-on: ubuntu-latest defaults: run: - working-directory: vite-hardhat + working-directory: ${{ matrix.project }} strategy: matrix: version: - version: ${{fromJson(needs.setup.outputs.matrix.key)}} - version_number: ${{fromJson(needs.setup.outputs.matrix.value)}} - project: [vite-hardhat] + project: [vite-hardhat, with-foundry] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/testingslack.yaml b/.github/workflows/testingslack.yaml deleted file mode 100644 index 1e2acf2..0000000 --- a/.github/workflows/testingslack.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: Testing - -on: - # Giving ourselves a way to trigger this manually - push: From f4ec61c87406d119df7391a257644112ddfc5047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 20 Dec 2023 12:25:18 +0000 Subject: [PATCH 04/21] JSON parsing --- .github/workflows/nightly.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index f885031..7e98194 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -39,8 +39,8 @@ jobs: strategy: matrix: version: - - version: ${{fromJson(needs.setup.outputs.matrix.key)}} - - version_number: ${{fromJson(needs.setup.outputs.matrix.value)}} + - version: ${{fromJson(needs.setup.outputs.matrix).key}} + - version_number: ${{fromJson(needs.setup.outputs.matrix).value}} project: [vite-hardhat, with-foundry] steps: - uses: actions/checkout@v4 From d17d6d055ae135a5fe0c6130b5ff0305fd9421ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 20 Dec 2023 16:18:05 +0000 Subject: [PATCH 05/21] more JSON parsing --- .github/scripts/latest.js | 9 ++++-- .github/workflows/nightly.yaml | 53 +++++++++++++++++++++------------- 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/.github/scripts/latest.js b/.github/scripts/latest.js index 2355b1c..45b8f58 100644 --- a/.github/scripts/latest.js +++ b/.github/scripts/latest.js @@ -16,11 +16,14 @@ async function main() { release => !release.tag_name.includes('aztec') && !release.tag_name.includes('nightly'), ); - const latestStable = filtered.find(release => !release.prerelease).tag_name; - const latestPreRelease = filtered.find(release => release.prerelease).tag_name; + const latestStable = filtered.find(release => !release.prerelease).tag_name.substring(1); + const latestPreRelease = filtered.find(release => release.prerelease).tag_name.substring(1); // TODO: add the prerelease to this object! - const workflowOutput = JSON.stringify({ stable: latestStable, prerelease: latestPreRelease }); + const workflowOutput = JSON.stringify({ + stable: latestStable, + prerelease: latestPreRelease, + }); console.log(workflowOutput); // DON'T REMOVE, GITHUB WILL CAPTURE THIS OUTPUT } diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 7e98194..01d6d69 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -11,7 +11,8 @@ jobs: setup: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} + versions: ${{ steps.set-matrix.outputs.versions }} + versions_map: ${{ steps.set-matrix.outputs.versions_map }} steps: - uses: actions/checkout@v4 @@ -20,15 +21,17 @@ jobs: run: | output=$(node ./.github/scripts/latest.js) echo "Output from Node.js script: $output" - echo "::set-output name=versionArray::$output" + echo "::set-output name=versionsMap::$output" - name: Set Up Matrix id: set-matrix run: | - VERSIONS='${{ steps.versions_step.outputs.versionArray }}' - echo "Versions for Matrix: $VERSIONS" - MATRIX=$(echo "$VERSIONS" | jq -c '{versions: .} | .versions | to_entries | map({key: .key, value: (.value | sub("^v"; ""))})') - echo "::set-output name=matrix::{\"include\":$MATRIX}" + VERSIONS_MAP='${{ steps.versions_step.outputs.versionsMap }}' + echo "Versions out of script: $VERSIONS_MAP" + + VERSIONS=$(echo "$VERSIONS_MAP" | jq -c '[.[]]') + echo "::set-output name=versions::$VERSIONS" + echo "::set-output name=versions_map::$VERSIONS_MAP" test-drift: needs: setup @@ -38,26 +41,36 @@ jobs: working-directory: ${{ matrix.project }} strategy: matrix: - version: - - version: ${{fromJson(needs.setup.outputs.matrix).key}} - - version_number: ${{fromJson(needs.setup.outputs.matrix).value}} + version: ${{ fromJson(needs.setup.outputs.versions) }} project: [vite-hardhat, with-foundry] steps: - uses: actions/checkout@v4 - - name: Set up test environment - uses: ./.github/actions/setup - with: - project: vite-hardhat - version: ${{ matrix.version.version_number }} + - name: Get stability + id: get-stability + env: + VERSIONS_MAP: ${{ needs.setup.outputs.versions_map }} + run: | + VERSION="${{ matrix.version }}" + echo "Version Number: $VERSION" + + STABLE_VERSION=$(echo "$VERSIONS_MAP" | jq -r --arg VERSION "$VERSION" '.stable') + if [ "$STABLE_VERSION" == "$VERSION" ]; then + IS_STABLE="true" + else + IS_STABLE="false" + fi + echo "Is stable: $IS_STABLE" + echo "Project: ${{ matrix.project }}" + echo "::set-output name=is_stable::$IS_STABLE" - name: Install test version run: | yarn add \ - @noir-lang/noir_js@${{ matrix.version.version_number }} \ - @noir-lang/backend_barretenberg@${{ matrix.version.version_number }} \ - @noir-lang/noir_wasm@${{ matrix.version.version_number }} \ - @noir-lang/types@${{ matrix.version.version_number }} + @noir-lang/noir_js@${{ matrix.version }} \ + @noir-lang/backend_barretenberg@${{ matrix.version }} \ + @noir-lang/noir_wasm@${{ matrix.version }} \ + @noir-lang/types@${{ matrix.version }} - name: 'Create env file' run: | @@ -75,12 +88,12 @@ jobs: - name: Run test run: yarn test id: yarn_test - continue-on-error: ${{ matrix.version.version == 'prerelease' }} + continue-on-error: ${{ steps.get-stability.outputs.is_stable == 'false' }} - name: Send GitHub Action trigger data to Slack workflow id: slack uses: slackapi/slack-github-action@v1.24.0 - if: ${{ failure() && matrix.version.version == 'prerelease' }} + if: ${{ failure() && steps.get-stability.outputs.is_stable == 'false' }} with: payload: | { From 5e6cf4ed49f0954bb8ab3c028b2762357f492990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 20 Dec 2023 16:32:41 +0000 Subject: [PATCH 06/21] somehow removed one of the blocks lol --- .github/workflows/nightly.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 01d6d69..4864783 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -46,6 +46,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up test environment + uses: ./.github/actions/setup + with: + project: vite-hardhat + version: ${{ matrix.version }} + - name: Get stability id: get-stability env: From 47b031fc88dc34a6f909d4d72882c669506fc438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 20 Dec 2023 16:42:55 +0000 Subject: [PATCH 07/21] allowing for matrix failure --- .github/workflows/nightly.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 4864783..39a16ba 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -40,6 +40,7 @@ jobs: run: working-directory: ${{ matrix.project }} strategy: + fail-fast: false matrix: version: ${{ fromJson(needs.setup.outputs.versions) }} project: [vite-hardhat, with-foundry] From e78f72c6a51b6771593b38794c3515b7122991c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Wed, 20 Dec 2023 18:00:58 +0000 Subject: [PATCH 08/21] some invalid json nonsense --- .github/workflows/nightly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 39a16ba..0b92bee 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -104,7 +104,7 @@ jobs: with: payload: | { - "text": "Hey! Just to let you know that once the prerelease becomes stable, you'll need to update the following project: ${{ matrix.project }}. ", + "text": "Once the prerelease becomes stable, projects need updating: ${{ matrix.project }}" } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 26152ea782c378834f6fbfbd1ef1591a7bc3ed87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 10:05:00 +0000 Subject: [PATCH 09/21] adding foundry test --- ...nightly.yaml => vite_hardhat_nightly.yaml} | 19 ++-- .github/workflows/with_foundry_nightly.yaml | 104 ++++++++++++++++++ vite-hardhat/.env.example | 3 +- vite-hardhat/circuits/Nargo.toml | 2 +- with-foundry/.env.example | 4 +- with-foundry/README.md | 4 +- with-foundry/circuits/Nargo.toml | 4 +- with-foundry/script/Starter.s.sol | 2 +- with-foundry/script/Verify.s.sol | 2 +- 9 files changed, 122 insertions(+), 22 deletions(-) rename .github/workflows/{nightly.yaml => vite_hardhat_nightly.yaml} (88%) create mode 100644 .github/workflows/with_foundry_nightly.yaml diff --git a/.github/workflows/nightly.yaml b/.github/workflows/vite_hardhat_nightly.yaml similarity index 88% rename from .github/workflows/nightly.yaml rename to .github/workflows/vite_hardhat_nightly.yaml index 0b92bee..f773e5c 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/vite_hardhat_nightly.yaml @@ -1,4 +1,4 @@ -name: Nightly drift test +name: Nightly Vite-Hardhat drift test on: # Giving ourselves a way to trigger this manually @@ -8,7 +8,7 @@ on: - cron: '0 2 * * *' jobs: - setup: + vite-hardhat-setup: runs-on: ubuntu-latest outputs: versions: ${{ steps.set-matrix.outputs.versions }} @@ -33,30 +33,28 @@ jobs: echo "::set-output name=versions::$VERSIONS" echo "::set-output name=versions_map::$VERSIONS_MAP" - test-drift: - needs: setup + vite-hardhat-test-drift: + needs: vite-hardhat-setup runs-on: ubuntu-latest defaults: run: - working-directory: ${{ matrix.project }} + working-directory: vite-hardhat strategy: fail-fast: false matrix: - version: ${{ fromJson(needs.setup.outputs.versions) }} - project: [vite-hardhat, with-foundry] + version: ${{ fromJson(needs.vite-hardhat-setup.outputs.versions) }} steps: - uses: actions/checkout@v4 - name: Set up test environment uses: ./.github/actions/setup with: - project: vite-hardhat version: ${{ matrix.version }} - name: Get stability id: get-stability env: - VERSIONS_MAP: ${{ needs.setup.outputs.versions_map }} + VERSIONS_MAP: ${{ needs.vite-hardhat-setup.outputs.versions_map }} run: | VERSION="${{ matrix.version }}" echo "Version Number: $VERSION" @@ -68,7 +66,6 @@ jobs: IS_STABLE="false" fi echo "Is stable: $IS_STABLE" - echo "Project: ${{ matrix.project }}" echo "::set-output name=is_stable::$IS_STABLE" - name: Install test version @@ -104,7 +101,7 @@ jobs: with: payload: | { - "text": "Once the prerelease becomes stable, projects need updating: ${{ matrix.project }}" + "text": "Once the prerelease becomes stable, projects need updating: vite-hardhat ${{ matrix.version }}" } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/with_foundry_nightly.yaml b/.github/workflows/with_foundry_nightly.yaml new file mode 100644 index 0000000..2027ce1 --- /dev/null +++ b/.github/workflows/with_foundry_nightly.yaml @@ -0,0 +1,104 @@ +name: Nightly With-Foundry drift test + +on: + # Giving ourselves a way to trigger this manually + workflow_dispatch: + schedule: + # Run a nightly release at 2 AM UTC + - cron: '0 2 * * *' + +jobs: + with-foundry-setup: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.set-matrix.outputs.versions }} + versions_map: ${{ steps.set-matrix.outputs.versions_map }} + steps: + - uses: actions/checkout@v4 + + - name: Get versions to test for drift + id: versions_step + run: | + output=$(node ./.github/scripts/latest.js) + echo "Output from Node.js script: $output" + echo "::set-output name=versionsMap::$output" + + - name: Set Up Matrix + id: set-matrix + run: | + VERSIONS_MAP='${{ steps.versions_step.outputs.versionsMap }}' + echo "Versions out of script: $VERSIONS_MAP" + + VERSIONS=$(echo "$VERSIONS_MAP" | jq -c '[.[]]') + echo "::set-output name=versions::$VERSIONS" + echo "::set-output name=versions_map::$VERSIONS_MAP" + + with-foundry-test-drift: + needs: with-foundry-setup + runs-on: ubuntu-latest + defaults: + run: + working-directory: with-foundry + strategy: + fail-fast: false + matrix: + version: ${{ fromJson(needs.with-foundry-setup.outputs.versions) }} + steps: + - uses: actions/checkout@v4 + + - name: Set up test environment + uses: ./.github/actions/setup + with: + version: ${{ matrix.version }} + + - name: Get stability + id: get-stability + env: + VERSIONS_MAP: ${{ needs.with-foundry-setup.outputs.versions_map }} + run: | + VERSION="${{ matrix.version }}" + echo "Version Number: $VERSION" + + STABLE_VERSION=$(echo "$VERSIONS_MAP" | jq -r --arg VERSION "$VERSION" '.stable') + if [ "$STABLE_VERSION" == "$VERSION" ]; then + IS_STABLE="true" + else + IS_STABLE="false" + fi + echo "Is stable: $IS_STABLE" + echo "::set-output name=is_stable::$IS_STABLE" + + - name: Install test version + run: | + yarn add \ + @noir-lang/noir_js@${{ matrix.version }} \ + @noir-lang/backend_barretenberg@${{ matrix.version }} \ + @noir-lang/noir_wasm@${{ matrix.version }} \ + @noir-lang/types@${{ matrix.version }} + + - name: 'Create env file' + run: | + touch .env + echo LOCALHOST_PRIVATE_KEY="${{ secrets.LOCALHOST_PRIVATE_KEY }}" >> .env + echo ANVIL_RPC="${{ secrets.ANVIL_RPC }}" >> .env + + - name: Generate proof + run: | + nargo prove + working-directory: with-foundry/circuits + + - name: Test with Foundry + run: | + forge test --optimize --optimizer-runs 5000 --evm-version london + + - name: Send GitHub Action trigger data to Slack workflow + id: slack + uses: slackapi/slack-github-action@v1.24.0 + if: ${{ failure() && steps.get-stability.outputs.is_stable == 'false' }} + with: + payload: | + { + "text": "Once the prerelease becomes stable, projects need updating: with-foundry ${{ matrix.version }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/vite-hardhat/.env.example b/vite-hardhat/.env.example index 8362472..ed34794 100644 --- a/vite-hardhat/.env.example +++ b/vite-hardhat/.env.example @@ -1,7 +1,6 @@ -DEPLOYER_PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" # hardhat acct #0 key, please update MUMBAI_DEPLOYER_PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" MUMBAI_ALCHEMY_KEY="" # hardhat acct #0 key, please update SEPOLIA_DEPLOYER_PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" -SEPOLIA_ALCHEMY_KEY="" \ No newline at end of file +SEPOLIA_ALCHEMY_KEY="" diff --git a/vite-hardhat/circuits/Nargo.toml b/vite-hardhat/circuits/Nargo.toml index 633677c..5936a03 100644 --- a/vite-hardhat/circuits/Nargo.toml +++ b/vite-hardhat/circuits/Nargo.toml @@ -2,6 +2,6 @@ name = "noirstarter" type = "bin" authors = [""] -compiler_version = "0.19.4" +compiler_version = ">0.19.4" [dependencies] diff --git a/with-foundry/.env.example b/with-foundry/.env.example index 26409ff..fc372ad 100644 --- a/with-foundry/.env.example +++ b/with-foundry/.env.example @@ -1,3 +1,3 @@ ANVIL_RPC= -PRIVATE_KEY= -SEPOLIA_RPC=https://rpc2.sepolia.org \ No newline at end of file +LOCALHOST_PRIVATE_KEY= +SEPOLIA_RPC=https://rpc2.sepolia.org diff --git a/with-foundry/README.md b/with-foundry/README.md index 614d16c..f19895e 100644 --- a/with-foundry/README.md +++ b/with-foundry/README.md @@ -94,7 +94,7 @@ Edit your `.env` file to look like: ``` ANVIL_RPC=http://localhost:8545 -PRIVATE_KEY= +LOCALHOST_PRIVATE_KEY= ``` #### (Option 2) Prepare for testnet @@ -106,7 +106,7 @@ Edit your `.env` file to look like: ```env SEPOLIA_RPC=https://rpc2.sepolia.org -PRIVATE_KEY= +LOCALHOST_PRIVATE_KEY= ``` #### Run the deploy script diff --git a/with-foundry/circuits/Nargo.toml b/with-foundry/circuits/Nargo.toml index f3dc166..bbc7f5c 100644 --- a/with-foundry/circuits/Nargo.toml +++ b/with-foundry/circuits/Nargo.toml @@ -2,6 +2,6 @@ name="with_foundry" type="bin" authors = ["critesjosh"] -compiler_version = "~0.11.0" +compiler_version = ">0.19.4" -[dependencies] \ No newline at end of file +[dependencies] diff --git a/with-foundry/script/Starter.s.sol b/with-foundry/script/Starter.s.sol index d29b9bb..9b8e3a1 100644 --- a/with-foundry/script/Starter.s.sol +++ b/with-foundry/script/Starter.s.sol @@ -11,7 +11,7 @@ contract StarterScript is Script { function setUp() public {} function run() public { - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + uint256 deployerPrivateKey = vm.envUint("LOCALHOST_PRIVATE_KEY"); vm.startBroadcast(deployerPrivateKey); verifier = new UltraVerifier(); diff --git a/with-foundry/script/Verify.s.sol b/with-foundry/script/Verify.s.sol index 3daf6b1..669c7dc 100644 --- a/with-foundry/script/Verify.s.sol +++ b/with-foundry/script/Verify.s.sol @@ -11,7 +11,7 @@ contract VerifyScript is Script { function setUp() public {} function run() public returns (bool) { - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + uint256 deployerPrivateKey = vm.envUint("LOCALHOST_PRIVATE_KEY"); vm.startBroadcast(deployerPrivateKey); verifier = new UltraVerifier(); From 4955bf9d5bdd1a302877932f879ebc5d9d6024da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 10:18:51 +0000 Subject: [PATCH 10/21] need to separate yarn from nargo setup because foundry project doesnt have yarn --- .github/actions/setup-nargo/action.yml | 18 ++++++++++++++++++ .../actions/{setup => setup-yarn}/action.yml | 12 ------------ .github/workflows/vite_hardhat_nightly.yaml | 9 +++++++-- .github/workflows/with_foundry_nightly.yaml | 4 ++-- 4 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 .github/actions/setup-nargo/action.yml rename .github/actions/{setup => setup-yarn}/action.yml (64%) diff --git a/.github/actions/setup-nargo/action.yml b/.github/actions/setup-nargo/action.yml new file mode 100644 index 0000000..f5f5e28 --- /dev/null +++ b/.github/actions/setup-nargo/action.yml @@ -0,0 +1,18 @@ +name: Install Yarn dependencies +description: Installs the workspace's yarn dependencies and caches them +inputs: + version: + description: The version of the project to install dependencies for + required: true + +runs: + using: composite + steps: + - name: Install Nargo + uses: noir-lang/noirup@v0.1.2 + with: + toolchain: ${{ inputs.version }} + + - name: Use Nargo + run: nargo --version + shell: bash diff --git a/.github/actions/setup/action.yml b/.github/actions/setup-yarn/action.yml similarity index 64% rename from .github/actions/setup/action.yml rename to .github/actions/setup-yarn/action.yml index af53672..feb61d7 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup-yarn/action.yml @@ -4,9 +4,6 @@ inputs: project: description: The project to install dependencies for required: true - version: - description: The version of the project to install dependencies for - required: true runs: using: composite @@ -23,12 +20,3 @@ runs: - name: Install run: yarn --immutable shell: bash - - - name: Install Nargo - uses: noir-lang/noirup@v0.1.2 - with: - toolchain: ${{ inputs.version }} - - - name: Use Nargo - run: nargo --version - shell: bash diff --git a/.github/workflows/vite_hardhat_nightly.yaml b/.github/workflows/vite_hardhat_nightly.yaml index f773e5c..cbfc1df 100644 --- a/.github/workflows/vite_hardhat_nightly.yaml +++ b/.github/workflows/vite_hardhat_nightly.yaml @@ -46,8 +46,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up test environment - uses: ./.github/actions/setup + - name: Set up yarn + uses: ./.github/actions/setup-yarn + with: + project: vite-hardhat + + - name: Set up nargo + uses: ./.github/actions/setup-nargo with: version: ${{ matrix.version }} diff --git a/.github/workflows/with_foundry_nightly.yaml b/.github/workflows/with_foundry_nightly.yaml index 2027ce1..2d5c148 100644 --- a/.github/workflows/with_foundry_nightly.yaml +++ b/.github/workflows/with_foundry_nightly.yaml @@ -46,8 +46,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up test environment - uses: ./.github/actions/setup + - name: Set up nargo + uses: ./.github/actions/setup-nargo with: version: ${{ matrix.version }} From 27bdb8b72db474698a95a3ced7b5fe3b68773161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 10:23:11 +0000 Subject: [PATCH 11/21] dumbass doesn't know the difference between \> and \=\> --- vite-hardhat/circuits/Nargo.toml | 2 +- with-foundry/circuits/Nargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vite-hardhat/circuits/Nargo.toml b/vite-hardhat/circuits/Nargo.toml index 5936a03..23365e9 100644 --- a/vite-hardhat/circuits/Nargo.toml +++ b/vite-hardhat/circuits/Nargo.toml @@ -2,6 +2,6 @@ name = "noirstarter" type = "bin" authors = [""] -compiler_version = ">0.19.4" +compiler_version = ">0.19.0" [dependencies] diff --git a/with-foundry/circuits/Nargo.toml b/with-foundry/circuits/Nargo.toml index bbc7f5c..ad7b0f4 100644 --- a/with-foundry/circuits/Nargo.toml +++ b/with-foundry/circuits/Nargo.toml @@ -2,6 +2,6 @@ name="with_foundry" type="bin" authors = ["critesjosh"] -compiler_version = ">0.19.4" +compiler_version = ">0.19.0" [dependencies] From 8e6aa2c84d52f37f47f0a6860307b638cdc817a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 10:33:18 +0000 Subject: [PATCH 12/21] adding foundry setup phase, pulling stables for PRs too --- .github/actions/setup-foundry/action.yml | 8 ++++++++ .github/actions/setup-nargo/action.yml | 4 ++-- .github/workflows/vite_hardhat.yaml | 19 +++++++++++++++++++ .github/workflows/with_foundry.yaml | 19 ++++++++++++++----- .github/workflows/with_foundry_nightly.yaml | 3 +++ 5 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 .github/actions/setup-foundry/action.yml diff --git a/.github/actions/setup-foundry/action.yml b/.github/actions/setup-foundry/action.yml new file mode 100644 index 0000000..21ed65d --- /dev/null +++ b/.github/actions/setup-foundry/action.yml @@ -0,0 +1,8 @@ +name: Install Foundry +description: Installs the workspace's foundry + +runs: + using: composite + steps: + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 diff --git a/.github/actions/setup-nargo/action.yml b/.github/actions/setup-nargo/action.yml index f5f5e28..d2d7551 100644 --- a/.github/actions/setup-nargo/action.yml +++ b/.github/actions/setup-nargo/action.yml @@ -1,5 +1,5 @@ -name: Install Yarn dependencies -description: Installs the workspace's yarn dependencies and caches them +name: Install Nargo +description: Installs the workspace's nargo inputs: version: description: The version of the project to install dependencies for diff --git a/.github/workflows/vite_hardhat.yaml b/.github/workflows/vite_hardhat.yaml index 5e2d19b..5c1e988 100644 --- a/.github/workflows/vite_hardhat.yaml +++ b/.github/workflows/vite_hardhat.yaml @@ -14,6 +14,25 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get latest version + id: versions_step + run: | + output=$(node ./.github/scripts/latest.js) + echo "Output from Node.js script: $output" + + STABLE=$(echo $output | jq -r '.stable') + echo "::set-output name=stable::$STABLE" + + - name: Set up yarn + uses: ./.github/actions/setup-yarn + with: + project: vite-hardhat + + - name: Set up nargo + uses: ./.github/actions/setup-nargo + with: + version: ${{ steps.versions_step.outputs.stable }} + - name: Enable Corepack before setting up Node run: corepack enable diff --git a/.github/workflows/with_foundry.yaml b/.github/workflows/with_foundry.yaml index 355c6af..a87b728 100644 --- a/.github/workflows/with_foundry.yaml +++ b/.github/workflows/with_foundry.yaml @@ -14,13 +14,22 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install Nargo - uses: noir-lang/noirup@v0.1.2 + - name: Get latest version + id: versions_step + run: | + output=$(node ./.github/scripts/latest.js) + echo "Output from Node.js script: $output" + + STABLE=$(echo $output | jq -r '.stable') + echo "::set-output name=stable::$STABLE" + + - name: Set up nargo + uses: ./.github/actions/setup-nargo with: - toolchain: 0.11.0 + version: ${{ steps.versions_step.outputs.stable }} - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 + - name: Set up foundry + uses: ./.github/actions/setup-foundry - name: Generate verifier contract run: | diff --git a/.github/workflows/with_foundry_nightly.yaml b/.github/workflows/with_foundry_nightly.yaml index 2d5c148..297e707 100644 --- a/.github/workflows/with_foundry_nightly.yaml +++ b/.github/workflows/with_foundry_nightly.yaml @@ -51,6 +51,9 @@ jobs: with: version: ${{ matrix.version }} + - name: Set up foundry + uses: ./.github/actions/setup-foundry + - name: Get stability id: get-stability env: From 89c7a5dd8b488ce01aa01f42ae851a1a898d0d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 10:34:59 +0000 Subject: [PATCH 13/21] idiot forgot gen-contract for foundry nightly --- .github/workflows/with_foundry_nightly.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/with_foundry_nightly.yaml b/.github/workflows/with_foundry_nightly.yaml index 297e707..ceb7b2e 100644 --- a/.github/workflows/with_foundry_nightly.yaml +++ b/.github/workflows/with_foundry_nightly.yaml @@ -85,6 +85,11 @@ jobs: echo LOCALHOST_PRIVATE_KEY="${{ secrets.LOCALHOST_PRIVATE_KEY }}" >> .env echo ANVIL_RPC="${{ secrets.ANVIL_RPC }}" >> .env + - name: Generate verifier contract + run: | + nargo codegen-verifier + working-directory: with-foundry/circuits + - name: Generate proof run: | nargo prove From d7b05a80bea2ca7cd6d0cee3ef20a6dee0a45710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 12:27:37 +0000 Subject: [PATCH 14/21] weird path issue --- .github/workflows/vite_hardhat.yaml | 2 +- .github/workflows/with_foundry.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/vite_hardhat.yaml b/.github/workflows/vite_hardhat.yaml index 5c1e988..fcfb5b2 100644 --- a/.github/workflows/vite_hardhat.yaml +++ b/.github/workflows/vite_hardhat.yaml @@ -17,7 +17,7 @@ jobs: - name: Get latest version id: versions_step run: | - output=$(node ./.github/scripts/latest.js) + output=$(node ../.github/scripts/latest.js) echo "Output from Node.js script: $output" STABLE=$(echo $output | jq -r '.stable') diff --git a/.github/workflows/with_foundry.yaml b/.github/workflows/with_foundry.yaml index a87b728..4a0cb23 100644 --- a/.github/workflows/with_foundry.yaml +++ b/.github/workflows/with_foundry.yaml @@ -17,7 +17,7 @@ jobs: - name: Get latest version id: versions_step run: | - output=$(node ./.github/scripts/latest.js) + output=$(node ../.github/scripts/latest.js) echo "Output from Node.js script: $output" STABLE=$(echo $output | jq -r '.stable') From b52ad75675ec3381c8ef21b02c54157b52f01c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 12:55:27 +0000 Subject: [PATCH 15/21] typo --- .github/workflows/vite_hardhat_nightly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vite_hardhat_nightly.yaml b/.github/workflows/vite_hardhat_nightly.yaml index 0f25691..d1c224b 100644 --- a/.github/workflows/vite_hardhat_nightly.yaml +++ b/.github/workflows/vite_hardhat_nightly.yaml @@ -40,7 +40,7 @@ jobs: defaults: run: working-directory: vite-hardhat - strategy + strategy: fail-fast: false matrix: version: ${{ fromJson(needs.vite-hardhat-setup.outputs.versions) }} From 89214cfc5b230fdcceb1b1b6392f98eb1d26dab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 13:11:08 +0000 Subject: [PATCH 16/21] moving continue on error to job level --- .github/workflows/vite_hardhat_nightly.yaml | 28 +++++++++++++++++---- .github/workflows/with_foundry_nightly.yaml | 27 +++++++++++++++++--- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/.github/workflows/vite_hardhat_nightly.yaml b/.github/workflows/vite_hardhat_nightly.yaml index d1c224b..c0fb8e1 100644 --- a/.github/workflows/vite_hardhat_nightly.yaml +++ b/.github/workflows/vite_hardhat_nightly.yaml @@ -44,6 +44,10 @@ jobs: fail-fast: false matrix: version: ${{ fromJson(needs.vite-hardhat-setup.outputs.versions) }} + # if it errors, we still need to know about it! + continue-on-error: true + outputs: + is_stable: ${{ steps.get-stability.outputs.is_stable }} steps: - uses: actions/checkout@v4 @@ -98,16 +102,30 @@ jobs: - name: Run test run: yarn test id: yarn_test - continue-on-error: ${{ steps.get-stability.outputs.is_stable == 'false' }} - - name: Send GitHub Action trigger data to Slack workflow - id: slack + notify: + needs: vite-hardhat-test-drift + runs-on: ubuntu-latest + if: ${{ needs.vite-hardhat-test-drift.result == 'failure' }} + steps: + - name: Send GitHub Action trigger data to Slack workflow - Stable + uses: slackapi/slack-github-action@v1.24.0 + if: ${{ needs.vite-hardhat-test-drift.outputs.is_stable == 'true' }} + with: + payload: | + { + "text": "Oooops, seems like latest stable Noir breaks noir-starter! Projects needing updating: vite-hardhat ${{ matrix.version }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + - name: Send GitHub Action trigger data to Slack workflow - Prerelease uses: slackapi/slack-github-action@v1.24.0 - if: ${{ failure() && steps.get-stability.outputs.is_stable == 'false' }} + if: ${{ needs.vite-hardhat-test-drift.outputs.is_stable == 'false' }} with: payload: | { - "text": "Once the prerelease becomes stable, projects need updating: vite-hardhat ${{ matrix.version }}" + "text": "Heads up DevRel! Once the prerelease becomes stable, the following project will break: vite-hardhat ${{ matrix.version }}" } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/with_foundry_nightly.yaml b/.github/workflows/with_foundry_nightly.yaml index ceb7b2e..7b76ad3 100644 --- a/.github/workflows/with_foundry_nightly.yaml +++ b/.github/workflows/with_foundry_nightly.yaml @@ -43,6 +43,10 @@ jobs: fail-fast: false matrix: version: ${{ fromJson(needs.with-foundry-setup.outputs.versions) }} + # if it errors, we still need to know about it! + continue-on-error: true + outputs: + is_stable: ${{ steps.get-stability.outputs.is_stable }} steps: - uses: actions/checkout@v4 @@ -99,14 +103,29 @@ jobs: run: | forge test --optimize --optimizer-runs 5000 --evm-version london - - name: Send GitHub Action trigger data to Slack workflow - id: slack + notify: + needs: with-foundry-test-drift + runs-on: ubuntu-latest + if: ${{ needs.with-foundry-test-drift.result == 'failure' }} + steps: + - name: Send GitHub Action trigger data to Slack workflow - Stable + uses: slackapi/slack-github-action@v1.24.0 + if: ${{ needs.with-foundry-test-drift.outputs.is_stable == 'true' }} + with: + payload: | + { + "text": "Oooops, seems like latest stable Noir breaks noir-starter! Projects needing updating: with-foundry ${{ matrix.version }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + - name: Send GitHub Action trigger data to Slack workflow - Prerelease uses: slackapi/slack-github-action@v1.24.0 - if: ${{ failure() && steps.get-stability.outputs.is_stable == 'false' }} + if: ${{ needs.with-foundry-test-drift.outputs.is_stable == 'false' }} with: payload: | { - "text": "Once the prerelease becomes stable, projects need updating: with-foundry ${{ matrix.version }}" + "text": "Heads up DevRel! Once the prerelease becomes stable, the following project will break: with-foundry ${{ matrix.version }}" } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 4d920dfadb521c5102fa649e7773697a7fcae6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 13:26:29 +0000 Subject: [PATCH 17/21] notify needs its own matrix --- .github/workflows/vite_hardhat_nightly.yaml | 5 ++++- .github/workflows/with_foundry_nightly.yaml | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vite_hardhat_nightly.yaml b/.github/workflows/vite_hardhat_nightly.yaml index c0fb8e1..6c98f38 100644 --- a/.github/workflows/vite_hardhat_nightly.yaml +++ b/.github/workflows/vite_hardhat_nightly.yaml @@ -104,8 +104,11 @@ jobs: id: yarn_test notify: - needs: vite-hardhat-test-drift + needs: [vite-hardhat-test-drift, vite-hardhat-setup] runs-on: ubuntu-latest + strategy: + matrix: + version: ${{ fromJson(needs.vite-hardhat-setup.outputs.versions) }} if: ${{ needs.vite-hardhat-test-drift.result == 'failure' }} steps: - name: Send GitHub Action trigger data to Slack workflow - Stable diff --git a/.github/workflows/with_foundry_nightly.yaml b/.github/workflows/with_foundry_nightly.yaml index 7b76ad3..7b0456b 100644 --- a/.github/workflows/with_foundry_nightly.yaml +++ b/.github/workflows/with_foundry_nightly.yaml @@ -104,9 +104,11 @@ jobs: forge test --optimize --optimizer-runs 5000 --evm-version london notify: - needs: with-foundry-test-drift + needs: [with-foundry-test-drift, with-foundry-setup] runs-on: ubuntu-latest - if: ${{ needs.with-foundry-test-drift.result == 'failure' }} + strategy: + matrix: + version: ${{ fromJson(needs.with-foundry-setup.outputs.versions) }} steps: - name: Send GitHub Action trigger data to Slack workflow - Stable uses: slackapi/slack-github-action@v1.24.0 From 860723d412c5ec02f31c9d17a802be48bf1b8bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 14:15:53 +0000 Subject: [PATCH 18/21] matrix is ignored in notify, dunno why --- .github/workflows/vite_hardhat_nightly.yaml | 22 ++++++++------------ .github/workflows/with_foundry_nightly.yaml | 23 +++++++++------------ 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/.github/workflows/vite_hardhat_nightly.yaml b/.github/workflows/vite_hardhat_nightly.yaml index 6c98f38..0148d84 100644 --- a/.github/workflows/vite_hardhat_nightly.yaml +++ b/.github/workflows/vite_hardhat_nightly.yaml @@ -45,23 +45,23 @@ jobs: matrix: version: ${{ fromJson(needs.vite-hardhat-setup.outputs.versions) }} # if it errors, we still need to know about it! - continue-on-error: true - outputs: - is_stable: ${{ steps.get-stability.outputs.is_stable }} steps: - uses: actions/checkout@v4 - name: Set up yarn + continue-on-error: true uses: ./.github/actions/setup-yarn with: project: vite-hardhat - name: Set up nargo + continue-on-error: true uses: ./.github/actions/setup-nargo with: version: ${{ matrix.version }} - name: Get stability + continue-on-error: true id: get-stability env: VERSIONS_MAP: ${{ needs.vite-hardhat-setup.outputs.versions_map }} @@ -79,6 +79,7 @@ jobs: echo "::set-output name=is_stable::$IS_STABLE" - name: Install test version + continue-on-error: true run: | yarn add \ @noir-lang/noir_js@${{ matrix.version }} \ @@ -87,6 +88,7 @@ jobs: @noir-lang/types@${{ matrix.version }} - name: 'Create env file' + continue-on-error: true run: | touch .env echo SEPOLIA_ALCHEMY_KEY="${{ secrets.SEPOLIA_ALCHEMY_KEY }}" >> .env @@ -95,25 +97,19 @@ jobs: echo MUMBAI_DEPLOYER_PRIVATE_KEY="${{ secrets.MUMBAI_DEPLOYER_PRIVATE_KEY }}" >> .env - name: Generate verifier contract + continue-on-error: true run: | nargo codegen-verifier working-directory: vite-hardhat/circuits - name: Run test + continue-on-error: true run: yarn test id: yarn_test - notify: - needs: [vite-hardhat-test-drift, vite-hardhat-setup] - runs-on: ubuntu-latest - strategy: - matrix: - version: ${{ fromJson(needs.vite-hardhat-setup.outputs.versions) }} - if: ${{ needs.vite-hardhat-test-drift.result == 'failure' }} - steps: - name: Send GitHub Action trigger data to Slack workflow - Stable uses: slackapi/slack-github-action@v1.24.0 - if: ${{ needs.vite-hardhat-test-drift.outputs.is_stable == 'true' }} + if: ${{ failure() && steps.get-stability.outputs.is_stable == 'true' }} with: payload: | { @@ -124,7 +120,7 @@ jobs: - name: Send GitHub Action trigger data to Slack workflow - Prerelease uses: slackapi/slack-github-action@v1.24.0 - if: ${{ needs.vite-hardhat-test-drift.outputs.is_stable == 'false' }} + if: ${{ failure() && steps.get-stability.outputs.is_stable == 'false' }} with: payload: | { diff --git a/.github/workflows/with_foundry_nightly.yaml b/.github/workflows/with_foundry_nightly.yaml index 7b0456b..bd768d5 100644 --- a/.github/workflows/with_foundry_nightly.yaml +++ b/.github/workflows/with_foundry_nightly.yaml @@ -43,22 +43,21 @@ jobs: fail-fast: false matrix: version: ${{ fromJson(needs.with-foundry-setup.outputs.versions) }} - # if it errors, we still need to know about it! - continue-on-error: true - outputs: - is_stable: ${{ steps.get-stability.outputs.is_stable }} steps: - uses: actions/checkout@v4 - name: Set up nargo + continue-on-error: true uses: ./.github/actions/setup-nargo with: version: ${{ matrix.version }} - name: Set up foundry + continue-on-error: true uses: ./.github/actions/setup-foundry - name: Get stability + continue-on-error: true id: get-stability env: VERSIONS_MAP: ${{ needs.with-foundry-setup.outputs.versions_map }} @@ -76,6 +75,7 @@ jobs: echo "::set-output name=is_stable::$IS_STABLE" - name: Install test version + continue-on-error: true run: | yarn add \ @noir-lang/noir_js@${{ matrix.version }} \ @@ -84,35 +84,32 @@ jobs: @noir-lang/types@${{ matrix.version }} - name: 'Create env file' + continue-on-error: true run: | touch .env echo LOCALHOST_PRIVATE_KEY="${{ secrets.LOCALHOST_PRIVATE_KEY }}" >> .env echo ANVIL_RPC="${{ secrets.ANVIL_RPC }}" >> .env - name: Generate verifier contract + continue-on-error: true run: | nargo codegen-verifier working-directory: with-foundry/circuits - name: Generate proof + continue-on-error: true run: | nargo prove working-directory: with-foundry/circuits - name: Test with Foundry + continue-on-error: true run: | forge test --optimize --optimizer-runs 5000 --evm-version london - notify: - needs: [with-foundry-test-drift, with-foundry-setup] - runs-on: ubuntu-latest - strategy: - matrix: - version: ${{ fromJson(needs.with-foundry-setup.outputs.versions) }} - steps: - name: Send GitHub Action trigger data to Slack workflow - Stable uses: slackapi/slack-github-action@v1.24.0 - if: ${{ needs.with-foundry-test-drift.outputs.is_stable == 'true' }} + if: ${{ failure() && steps.get-stability.outputs.is_stable == 'true' }} with: payload: | { @@ -123,7 +120,7 @@ jobs: - name: Send GitHub Action trigger data to Slack workflow - Prerelease uses: slackapi/slack-github-action@v1.24.0 - if: ${{ needs.with-foundry-test-drift.outputs.is_stable == 'false' }} + if: ${{ failure() && steps.get-stability.outputs.is_stable == 'false' }} with: payload: | { From 4a2d6bf23933a9cf1999bd7b2acf04f97c05df55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 14:19:09 +0000 Subject: [PATCH 19/21] maybe it doesnt even need continue on error? bah --- .github/workflows/vite_hardhat_nightly.yaml | 7 ------- .github/workflows/with_foundry_nightly.yaml | 8 -------- 2 files changed, 15 deletions(-) diff --git a/.github/workflows/vite_hardhat_nightly.yaml b/.github/workflows/vite_hardhat_nightly.yaml index 0148d84..bb876e1 100644 --- a/.github/workflows/vite_hardhat_nightly.yaml +++ b/.github/workflows/vite_hardhat_nightly.yaml @@ -49,19 +49,16 @@ jobs: - uses: actions/checkout@v4 - name: Set up yarn - continue-on-error: true uses: ./.github/actions/setup-yarn with: project: vite-hardhat - name: Set up nargo - continue-on-error: true uses: ./.github/actions/setup-nargo with: version: ${{ matrix.version }} - name: Get stability - continue-on-error: true id: get-stability env: VERSIONS_MAP: ${{ needs.vite-hardhat-setup.outputs.versions_map }} @@ -79,7 +76,6 @@ jobs: echo "::set-output name=is_stable::$IS_STABLE" - name: Install test version - continue-on-error: true run: | yarn add \ @noir-lang/noir_js@${{ matrix.version }} \ @@ -88,7 +84,6 @@ jobs: @noir-lang/types@${{ matrix.version }} - name: 'Create env file' - continue-on-error: true run: | touch .env echo SEPOLIA_ALCHEMY_KEY="${{ secrets.SEPOLIA_ALCHEMY_KEY }}" >> .env @@ -97,13 +92,11 @@ jobs: echo MUMBAI_DEPLOYER_PRIVATE_KEY="${{ secrets.MUMBAI_DEPLOYER_PRIVATE_KEY }}" >> .env - name: Generate verifier contract - continue-on-error: true run: | nargo codegen-verifier working-directory: vite-hardhat/circuits - name: Run test - continue-on-error: true run: yarn test id: yarn_test diff --git a/.github/workflows/with_foundry_nightly.yaml b/.github/workflows/with_foundry_nightly.yaml index bd768d5..496e57b 100644 --- a/.github/workflows/with_foundry_nightly.yaml +++ b/.github/workflows/with_foundry_nightly.yaml @@ -47,17 +47,14 @@ jobs: - uses: actions/checkout@v4 - name: Set up nargo - continue-on-error: true uses: ./.github/actions/setup-nargo with: version: ${{ matrix.version }} - name: Set up foundry - continue-on-error: true uses: ./.github/actions/setup-foundry - name: Get stability - continue-on-error: true id: get-stability env: VERSIONS_MAP: ${{ needs.with-foundry-setup.outputs.versions_map }} @@ -75,7 +72,6 @@ jobs: echo "::set-output name=is_stable::$IS_STABLE" - name: Install test version - continue-on-error: true run: | yarn add \ @noir-lang/noir_js@${{ matrix.version }} \ @@ -84,26 +80,22 @@ jobs: @noir-lang/types@${{ matrix.version }} - name: 'Create env file' - continue-on-error: true run: | touch .env echo LOCALHOST_PRIVATE_KEY="${{ secrets.LOCALHOST_PRIVATE_KEY }}" >> .env echo ANVIL_RPC="${{ secrets.ANVIL_RPC }}" >> .env - name: Generate verifier contract - continue-on-error: true run: | nargo codegen-verifier working-directory: with-foundry/circuits - name: Generate proof - continue-on-error: true run: | nargo prove working-directory: with-foundry/circuits - name: Test with Foundry - continue-on-error: true run: | forge test --optimize --optimizer-runs 5000 --evm-version london From 10077f5ecd6a51612c3dda80819b10812a11a37a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 14:23:47 +0000 Subject: [PATCH 20/21] making vite-hardhat intentionally fail to see what happens --- vite-hardhat/test/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite-hardhat/test/index.ts b/vite-hardhat/test/index.ts index 701d0a4..0f755b4 100644 --- a/vite-hardhat/test/index.ts +++ b/vite-hardhat/test/index.ts @@ -27,7 +27,7 @@ describe('It compiles noir program code, receiving circuit bytes and abi object. // @ts-ignore const backend = new BarretenbergBackend(compiled.program); // @ts-ignore - noir = new Noir(compiled.program, backend); + noir = new Noir(compiled, backend); }); it('Should generate valid proof for correct input', async () => { From b473998cf7e22a9b46e27c1f14ce92afcacf4530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 21 Dec 2023 14:25:47 +0000 Subject: [PATCH 21/21] yuhu, time for some holidays --- vite-hardhat/test/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite-hardhat/test/index.ts b/vite-hardhat/test/index.ts index 0f755b4..701d0a4 100644 --- a/vite-hardhat/test/index.ts +++ b/vite-hardhat/test/index.ts @@ -27,7 +27,7 @@ describe('It compiles noir program code, receiving circuit bytes and abi object. // @ts-ignore const backend = new BarretenbergBackend(compiled.program); // @ts-ignore - noir = new Noir(compiled, backend); + noir = new Noir(compiled.program, backend); }); it('Should generate valid proof for correct input', async () => {