From 377e09946b7848d5b613fdba813fa7e933f6d67b Mon Sep 17 00:00:00 2001 From: Matt Walker Date: Fri, 15 Nov 2024 14:24:47 -0500 Subject: [PATCH 01/16] ci: Stop jobs that are no longer relevant --- .github/workflows/benchmarks.yml | 4 ++++ .github/workflows/build-action.yml | 4 ++++ .github/workflows/build-bindings.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/live-tests.yml | 4 ++++ 4 files changed, 40 insertions(+) create mode 100644 .github/workflows/build-bindings.yml diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index ec1a4d969d..f3673a3154 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -7,6 +7,10 @@ on: pull_request: workflow_dispatch: {} +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: benchmarks: timeout-minutes: 30 diff --git a/.github/workflows/build-action.yml b/.github/workflows/build-action.yml index 23039aadd0..402107ea05 100644 --- a/.github/workflows/build-action.yml +++ b/.github/workflows/build-action.yml @@ -9,6 +9,10 @@ on: pull_request: workflow_dispatch: {} +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: Prepare: runs-on: ubuntu-latest diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml new file mode 100644 index 0000000000..790a13336c --- /dev/null +++ b/.github/workflows/build-bindings.yml @@ -0,0 +1,28 @@ +# Purpose: We want to build the o1js bindings in CI so that people in the +# community can change them without being scared of breaking things, or +# needing to do the complicated (without nix) build setup. + +name: Build o1js bindings + +on: + workflow_dispatch: + pull_request: + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + nix-build: + name: build-bindings-ubuntu + runs-on: hetzner-1 + steps: + - name: Disable smudging + run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v30 + - run: | + set -Eeu + export GIT_LFS_SKIP_SMUDGE=1 + ./pin.sh + nix develop o1js --command bash --command "npm run build:update-bindings" diff --git a/.github/workflows/live-tests.yml b/.github/workflows/live-tests.yml index a4be3529f4..3f14642714 100644 --- a/.github/workflows/live-tests.yml +++ b/.github/workflows/live-tests.yml @@ -12,6 +12,10 @@ on: - v1 workflow_dispatch: {} +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: master: timeout-minutes: 45 From 15b5f2b81efef574dbcee3b92f02681d446573a6 Mon Sep 17 00:00:00 2001 From: Matt Walker Date: Mon, 18 Nov 2024 09:10:59 -0500 Subject: [PATCH 02/16] ci: Remove suprious workflow file from another branch --- .github/workflows/build-bindings.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/workflows/build-bindings.yml diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml deleted file mode 100644 index 790a13336c..0000000000 --- a/.github/workflows/build-bindings.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Purpose: We want to build the o1js bindings in CI so that people in the -# community can change them without being scared of breaking things, or -# needing to do the complicated (without nix) build setup. - -name: Build o1js bindings - -on: - workflow_dispatch: - pull_request: - -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true - -jobs: - nix-build: - name: build-bindings-ubuntu - runs-on: hetzner-1 - steps: - - name: Disable smudging - run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v30 - - run: | - set -Eeu - export GIT_LFS_SKIP_SMUDGE=1 - ./pin.sh - nix develop o1js --command bash --command "npm run build:update-bindings" From 337fac1cefd4446eafbb1784d8ea29dfe2e64186 Mon Sep 17 00:00:00 2001 From: Gregor Date: Tue, 19 Nov 2024 12:29:30 +0100 Subject: [PATCH 03/16] bindings --- src/bindings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings b/src/bindings index 2634cc0b11..2c62a9a755 160000 --- a/src/bindings +++ b/src/bindings @@ -1 +1 @@ -Subproject commit 2634cc0b113e02ffc692828568ed2fe4c6c65b6a +Subproject commit 2c62a9a755f1b128f89cc2131814df7157f68109 From 041cd324ef7a2983443de9038412f465378fe029 Mon Sep 17 00:00:00 2001 From: Gregor Date: Tue, 19 Nov 2024 12:32:33 +0100 Subject: [PATCH 04/16] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f0e400b74..da97589a32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased](https://github.com/o1-labs/o1js/compare/e1bac02...HEAD) +### Fixed + +- Compiling stuck in the browser for recursive zkprograms https://github.com/o1-labs/o1js/pull/1906 + ## [2.1.0](https://github.com/o1-labs/o1js/compare/b04520d...e1bac02) - 2024-11-13 ### Added From 80719370ad69a581fc68b55f122a4731343c2ac6 Mon Sep 17 00:00:00 2001 From: Matt Walker Date: Tue, 19 Nov 2024 21:58:48 -0500 Subject: [PATCH 05/16] ci/bindings: build in CI --- .github/workflows/build-bindings.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/build-bindings.yml diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml new file mode 100644 index 0000000000..7ffc1a7cff --- /dev/null +++ b/.github/workflows/build-bindings.yml @@ -0,0 +1,25 @@ +# Purpose: We want to build the o1js bindings in CI so that people in the +# community can change them without being scared of breaking things, or +# needing to do the complicated (without nix) build setup. + +name: Build o1js bindings + +on: + pull_request: + +jobs: + nix-build: + name: build-bindings-ubuntu + runs-on: [sdk-self-hosted-linux-amd64-build-system] + steps: + - name: Disable smudging + run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV + - uses: actions/checkout@v4 + with: + submodules: recursive + - run: | + set -Eeu + # Until we restart the runner and the PATH gets updated from /etc/bash.bashrc + export PATH="$PATH":/nix/var/nix/profiles/default/bin + ./pin.sh + nix develop o1js --command bash -c "npm run build:update-bindings" From 45d52d6849907fedb6c178edd34dfe996831ac86 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 20 Nov 2024 14:12:46 +0700 Subject: [PATCH 06/16] fix packages with vulnerabilities --- package-lock.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a94644315..ab82906a48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2671,12 +2671,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -2908,9 +2908,9 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -3518,9 +3518,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -5708,12 +5708,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { From 5866a011f681cc591de8ad1a7a1abdf406d4dc8e Mon Sep 17 00:00:00 2001 From: boray Date: Wed, 20 Nov 2024 11:57:56 +0300 Subject: [PATCH 07/16] test: add recursive program to e2e testing --- src/build/e2e-tests-build-helper.js | 40 ++++++++++++++----- src/examples/zkprogram/program-with-input.ts | 2 +- .../html/on-chain-state-mgmt-zkapp-ui.html | 4 ++ .../on-chain-state-mgmt-zkapp-ui.js | 18 +++++++++ tests/on-chain-state-mgmt-zkapp-ui.spec.ts | 10 +++++ tests/pages/on-chain-state-mgmt-zkapp.ts | 11 +++++ 6 files changed, 73 insertions(+), 12 deletions(-) diff --git a/src/build/e2e-tests-build-helper.js b/src/build/e2e-tests-build-helper.js index 3709c514e8..d2b9adeca1 100644 --- a/src/build/e2e-tests-build-helper.js +++ b/src/build/e2e-tests-build-helper.js @@ -1,14 +1,32 @@ import replace from 'replace-in-file'; -const options = { - files: './dist/web/examples/zkapps/**/*.js', - from: /from 'o1js'/g, - to: "from '../../../index.js'", -}; - -try { - const results = await replace(options); - console.log('Replacement results:', results); -} catch (error) { - console.error('Error occurred:', error); +const replaceOptions = [ + { + files: './dist/web/examples/zkapps/**/*.js', + from: /from 'o1js'/g, + to: "from '../../../index.js'", + }, + { + files: './dist/web/examples/zkprogram/*.js', + from: /from 'o1js'/g, + to: "from '../../index.js'", + }, +]; + +async function performReplacement(options) { + try { + const results = await replace(options); + console.log(`Replacement results for ${options.files}:`, results); + } catch (error) { + console.error(`Error occurred while replacing in ${options.files}:`, error); + } +} + +async function main() { + for (const options of replaceOptions) { + await performReplacement(options); + } } + +main(); + diff --git a/src/examples/zkprogram/program-with-input.ts b/src/examples/zkprogram/program-with-input.ts index a6117771b3..a1a6a71cde 100644 --- a/src/examples/zkprogram/program-with-input.ts +++ b/src/examples/zkprogram/program-with-input.ts @@ -8,7 +8,7 @@ import { Provable, } from 'o1js'; -let MyProgram = ZkProgram({ +export let MyProgram = ZkProgram({ name: 'example-with-input', publicInput: Field, diff --git a/tests/artifacts/html/on-chain-state-mgmt-zkapp-ui.html b/tests/artifacts/html/on-chain-state-mgmt-zkapp-ui.html index b9bad32a17..980822b28c 100644 --- a/tests/artifacts/html/on-chain-state-mgmt-zkapp-ui.html +++ b/tests/artifacts/html/on-chain-state-mgmt-zkapp-ui.html @@ -25,6 +25,10 @@

UI for the On-Chain State Management zkApp


+

zkProgram Management

+
+ +

zkApp Management

diff --git a/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js b/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js index bfeed49252..60b3fd340b 100644 --- a/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js +++ b/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js @@ -3,8 +3,10 @@ import { adminPrivateKey, HelloWorld, } from './examples/zkapps/hello-world/hello-world.js'; +import { MyProgram } from './examples/zkprogram/program-with-input.js' import { AccountUpdate, Field, Mina, verify } from './index.js'; +const compileButton = document.querySelector('#compileButton'); const deployButton = document.querySelector('#deployButton'); const updateButton = document.querySelector('#updateButton'); const clearEventsButton = document.querySelector('#clearEventsButton'); @@ -25,6 +27,22 @@ const contractAddress = Mina.TestPublicKey.random(); const contract = new HelloWorld(contractAddress); let verificationKey = null; +compileButton.addEventListener('click', async () => { + compileButton.disabled = true; + + logEvents('Compiling ZkProgram', eventsContainer); + + try { + await MyProgram.compile(); + logEvents('ZkProgram compiled successfully!', eventsContainer); + } catch (exception) { + logEvents(`Compilation failure: ${exception.message}`, eventsContainer); + console.log(exception); + } + + compileButton.disabled = false; +}); + deployButton.addEventListener('click', async () => { deployButton.disabled = true; diff --git a/tests/on-chain-state-mgmt-zkapp-ui.spec.ts b/tests/on-chain-state-mgmt-zkapp-ui.spec.ts index 7fba7fd26d..76a7c72e4b 100644 --- a/tests/on-chain-state-mgmt-zkapp-ui.spec.ts +++ b/tests/on-chain-state-mgmt-zkapp-ui.spec.ts @@ -8,6 +8,16 @@ test.describe('On-Chain State Management zkApp UI', () => { await onChainStateMgmtZkAppPage.checkO1jsInitialization(); }); + test('should compile zkProgram', async ({ + onChainStateMgmtZkAppPage, + }) => { + await onChainStateMgmtZkAppPage.goto(); + await onChainStateMgmtZkAppPage.checkO1jsInitialization(); + await onChainStateMgmtZkAppPage.compileZkProgram(); + await onChainStateMgmtZkAppPage.checkZkProgramCompilation(); + }); + + test('should fail to update account state since zkApp was not yet deployed', async ({ onChainStateMgmtZkAppPage, }) => { diff --git a/tests/pages/on-chain-state-mgmt-zkapp.ts b/tests/pages/on-chain-state-mgmt-zkapp.ts index bf1a8027d9..db36d011d2 100644 --- a/tests/pages/on-chain-state-mgmt-zkapp.ts +++ b/tests/pages/on-chain-state-mgmt-zkapp.ts @@ -2,6 +2,7 @@ import { expect, type Locator, type Page } from '@playwright/test'; export class OnChainStateMgmtZkAppPage { readonly page: Page; + readonly compileButton: Locator; readonly deployButton: Locator; readonly updateButton: Locator; readonly clearEventsButton: Locator; @@ -11,6 +12,7 @@ export class OnChainStateMgmtZkAppPage { constructor(page: Page) { this.page = page; + this.compileButton = page.locator('button[id="compileButton"]'); this.deployButton = page.locator('button[id="deployButton"]'); this.updateButton = page.locator('button[id="updateButton"]'); this.clearEventsButton = page.locator('button[id="clearEventsButton"]'); @@ -23,6 +25,10 @@ export class OnChainStateMgmtZkAppPage { await this.page.goto('/on-chain-state-mgmt-zkapp-ui.html'); } + async compileZkProgram() { + await this.compileButton.click(); + } + async compileAndDeployZkApp() { await this.deployButton.click(); } @@ -40,6 +46,11 @@ export class OnChainStateMgmtZkAppPage { await expect(this.eventsContainer).toContainText('o1js initialized after'); } + async checkZkProgramCompilation() { + await expect(this.eventsContainer).toContainText('Compiling ZkProgram'); + await expect(this.eventsContainer).toContainText('ZkProgram compiled successfully!'); + } + async checkDeployedZkApp() { await expect(this.eventsContainer).toContainText('Deploying'); await expect(this.eventsContainer).toContainText('Initial state: 2'); From bc28e8ee1d0df2819311e45e4de5c5b5714ef80d Mon Sep 17 00:00:00 2001 From: boray Date: Wed, 20 Nov 2024 17:46:12 +0300 Subject: [PATCH 08/16] test: add comments to elaborate why we import MyProgram --- tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js b/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js index 60b3fd340b..6848305810 100644 --- a/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js +++ b/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js @@ -3,7 +3,10 @@ import { adminPrivateKey, HelloWorld, } from './examples/zkapps/hello-world/hello-world.js'; -import { MyProgram } from './examples/zkprogram/program-with-input.js' +// MyProgram to serve as a test case for recursive ZkProgram compilation. +// This helps to catch any regressions that might occur in the future. +// For more details, refer to: https://github.com/o1-labs/o1js/pull/1906 +import { MyProgram } from './examples/zkprogram/program-with-input.js'; import { AccountUpdate, Field, Mina, verify } from './index.js'; const compileButton = document.querySelector('#compileButton'); From db35a1ca49e98cb092da88167f2a6b150e0e29de Mon Sep 17 00:00:00 2001 From: boray Date: Wed, 20 Nov 2024 20:53:52 +0300 Subject: [PATCH 09/16] test: add recursive zkprogram --- src/examples/zkprogram/program-with-input.ts | 2 +- src/examples/zkprogram/recursive-program.ts | 23 +++++++++++++++++++ .../on-chain-state-mgmt-zkapp-ui.js | 7 ++---- 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 src/examples/zkprogram/recursive-program.ts diff --git a/src/examples/zkprogram/program-with-input.ts b/src/examples/zkprogram/program-with-input.ts index a1a6a71cde..a6117771b3 100644 --- a/src/examples/zkprogram/program-with-input.ts +++ b/src/examples/zkprogram/program-with-input.ts @@ -8,7 +8,7 @@ import { Provable, } from 'o1js'; -export let MyProgram = ZkProgram({ +let MyProgram = ZkProgram({ name: 'example-with-input', publicInput: Field, diff --git a/src/examples/zkprogram/recursive-program.ts b/src/examples/zkprogram/recursive-program.ts new file mode 100644 index 0000000000..b6b6f3b61b --- /dev/null +++ b/src/examples/zkprogram/recursive-program.ts @@ -0,0 +1,23 @@ +import { SelfProof, Field, ZkProgram } from 'o1js'; + +export const RecusiveProgram = ZkProgram({ + name: 'recursive-program', + publicInput: Field, + + methods: { + baseCase: { + privateInputs: [], + async method(input: Field) { + input.assertEquals(Field(0)); + }, + }, + + inductiveCase: { + privateInputs: [SelfProof], + async method(input: Field, earlierProof: SelfProof) { + earlierProof.verify(); + earlierProof.publicInput.add(1).assertEquals(input); + }, + }, + }, +}); diff --git a/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js b/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js index 6848305810..86392c0d0c 100644 --- a/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js +++ b/tests/artifacts/javascript/on-chain-state-mgmt-zkapp-ui.js @@ -3,10 +3,7 @@ import { adminPrivateKey, HelloWorld, } from './examples/zkapps/hello-world/hello-world.js'; -// MyProgram to serve as a test case for recursive ZkProgram compilation. -// This helps to catch any regressions that might occur in the future. -// For more details, refer to: https://github.com/o1-labs/o1js/pull/1906 -import { MyProgram } from './examples/zkprogram/program-with-input.js'; +import { RecursiveProgram } from './examples/zkprogram/recursive-program.js'; import { AccountUpdate, Field, Mina, verify } from './index.js'; const compileButton = document.querySelector('#compileButton'); @@ -36,7 +33,7 @@ compileButton.addEventListener('click', async () => { logEvents('Compiling ZkProgram', eventsContainer); try { - await MyProgram.compile(); + await RecursiveProgram.compile(); logEvents('ZkProgram compiled successfully!', eventsContainer); } catch (exception) { logEvents(`Compilation failure: ${exception.message}`, eventsContainer); From e54cb3e01a26e395ab277532ffd5bae323eba12b Mon Sep 17 00:00:00 2001 From: boray Date: Wed, 20 Nov 2024 21:39:02 +0300 Subject: [PATCH 10/16] test: format helper --- src/build/e2e-tests-build-helper.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/build/e2e-tests-build-helper.js b/src/build/e2e-tests-build-helper.js index d2b9adeca1..f21d3f0fff 100644 --- a/src/build/e2e-tests-build-helper.js +++ b/src/build/e2e-tests-build-helper.js @@ -29,4 +29,3 @@ async function main() { } main(); - From bd529b8e14f0d30c659628db3690daf5eb5e805a Mon Sep 17 00:00:00 2001 From: boray Date: Wed, 20 Nov 2024 23:01:47 +0300 Subject: [PATCH 11/16] test: fix typo --- src/examples/zkprogram/recursive-program.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/examples/zkprogram/recursive-program.ts b/src/examples/zkprogram/recursive-program.ts index b6b6f3b61b..0308266cd8 100644 --- a/src/examples/zkprogram/recursive-program.ts +++ b/src/examples/zkprogram/recursive-program.ts @@ -1,6 +1,6 @@ import { SelfProof, Field, ZkProgram } from 'o1js'; -export const RecusiveProgram = ZkProgram({ +export const RecursiveProgram = ZkProgram({ name: 'recursive-program', publicInput: Field, From 6260b56ddf0491dee52755885c93907c19627c36 Mon Sep 17 00:00:00 2001 From: boray Date: Wed, 20 Nov 2024 23:05:23 +0300 Subject: [PATCH 12/16] test: fix format to trigger gh actions --- tests/pages/on-chain-state-mgmt-zkapp.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/pages/on-chain-state-mgmt-zkapp.ts b/tests/pages/on-chain-state-mgmt-zkapp.ts index db36d011d2..d9e2e9b45b 100644 --- a/tests/pages/on-chain-state-mgmt-zkapp.ts +++ b/tests/pages/on-chain-state-mgmt-zkapp.ts @@ -48,7 +48,9 @@ export class OnChainStateMgmtZkAppPage { async checkZkProgramCompilation() { await expect(this.eventsContainer).toContainText('Compiling ZkProgram'); - await expect(this.eventsContainer).toContainText('ZkProgram compiled successfully!'); + await expect(this.eventsContainer).toContainText( + 'ZkProgram compiled successfully!' + ); } async checkDeployedZkApp() { From 538b686adec3b3d1d4821912cf57b26720c6418f Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 26 Nov 2024 09:51:12 +0200 Subject: [PATCH 13/16] Cleanup Nix store after the o1js bindings build procedure. --- .github/workflows/build-bindings.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index 7ffc1a7cff..b90a01a28e 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -1,4 +1,4 @@ -# Purpose: We want to build the o1js bindings in CI so that people in the +# Purpose: We want to build the o1js bindings in CI so that people in the # community can change them without being scared of breaking things, or # needing to do the complicated (without nix) build setup. @@ -7,7 +7,7 @@ name: Build o1js bindings on: pull_request: -jobs: +jobs: nix-build: name: build-bindings-ubuntu runs-on: [sdk-self-hosted-linux-amd64-build-system] @@ -17,9 +17,16 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - run: | + - name: Build the o1js bindings + run: | set -Eeu # Until we restart the runner and the PATH gets updated from /etc/bash.bashrc export PATH="$PATH":/nix/var/nix/profiles/default/bin ./pin.sh nix develop o1js --command bash -c "npm run build:update-bindings" + - name: Cleanup the Nix store + run: | + nix-env --delete-generations old + nix-collect-garbage -d --quiet + nix-store --gc --print-dead + nix-store --optimise From 8205fad5a06e4f8d84257ee7fcab1c9de96a7658 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 26 Nov 2024 15:56:25 +0200 Subject: [PATCH 14/16] Attempting to setup Nix via PATH. --- .github/workflows/build-bindings.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index b90a01a28e..6590514bc7 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -12,6 +12,8 @@ jobs: name: build-bindings-ubuntu runs-on: [sdk-self-hosted-linux-amd64-build-system] steps: + - name: Set up Nix in PATH + run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV - name: Disable smudging run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV - uses: actions/checkout@v4 From ed7bf0c3704e49c3fe823655367f3260ef0cb67a Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 26 Nov 2024 16:14:42 +0200 Subject: [PATCH 15/16] Cleaning up. --- .github/workflows/build-bindings.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index 6590514bc7..3362768b11 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -12,7 +12,7 @@ jobs: name: build-bindings-ubuntu runs-on: [sdk-self-hosted-linux-amd64-build-system] steps: - - name: Set up Nix in PATH + - name: Set up Nix run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV - name: Disable smudging run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV @@ -22,8 +22,6 @@ jobs: - name: Build the o1js bindings run: | set -Eeu - # Until we restart the runner and the PATH gets updated from /etc/bash.bashrc - export PATH="$PATH":/nix/var/nix/profiles/default/bin ./pin.sh nix develop o1js --command bash -c "npm run build:update-bindings" - name: Cleanup the Nix store From 8b94cbe650f36aed05ea355b9cd6c4e288a73c1b Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 26 Nov 2024 19:09:14 +0200 Subject: [PATCH 16/16] Use unique concurrency groups for individual workflow. --- .github/workflows/benchmarks.yml | 2 +- .github/workflows/build-action.yml | 2 +- .github/workflows/build-bindings.yml | 15 ++++++++++----- .github/workflows/doc.yml | 4 ++++ .github/workflows/live-tests.yml | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index f3673a3154..eb45a454cb 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: {} concurrency: - group: ${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: diff --git a/.github/workflows/build-action.yml b/.github/workflows/build-action.yml index 402107ea05..1e3e7a3895 100644 --- a/.github/workflows/build-action.yml +++ b/.github/workflows/build-action.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: {} concurrency: - group: ${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index 7ffc1a7cff..5323c6fb39 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -1,4 +1,4 @@ -# Purpose: We want to build the o1js bindings in CI so that people in the +# Purpose: We want to build the o1js bindings in CI so that people in the # community can change them without being scared of breaking things, or # needing to do the complicated (without nix) build setup. @@ -7,19 +7,24 @@ name: Build o1js bindings on: pull_request: -jobs: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: nix-build: name: build-bindings-ubuntu runs-on: [sdk-self-hosted-linux-amd64-build-system] steps: + - name: Set up Nix + run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV - name: Disable smudging run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV - uses: actions/checkout@v4 with: submodules: recursive - - run: | + - name: Build the o1js bindings + run: | set -Eeu - # Until we restart the runner and the PATH gets updated from /etc/bash.bashrc - export PATH="$PATH":/nix/var/nix/profiles/default/bin ./pin.sh nix develop o1js --command bash -c "npm run build:update-bindings" diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 6bd4433615..b4f7eb790a 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -4,6 +4,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: Build-Doc: runs-on: ubuntu-latest diff --git a/.github/workflows/live-tests.yml b/.github/workflows/live-tests.yml index 3f14642714..dc7db700a1 100644 --- a/.github/workflows/live-tests.yml +++ b/.github/workflows/live-tests.yml @@ -13,7 +13,7 @@ on: workflow_dispatch: {} concurrency: - group: ${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: