From b4be8d67d9230362e2c129675b49b8535981c041 Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:18:55 +0000 Subject: [PATCH 1/4] chore(merge) - dev to staging (#242) * chore: fix typos * fix(setup): fix issue with wasm file always being deleted * feat(setup-local-keys): do not compute zkeys again if found locally for non interactive setup --------- Co-authored-by: shuoer86 <129674997+shuoer86@users.noreply.github.com> --- packages/phase2cli/src/commands/setup.ts | 33 +++++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/packages/phase2cli/src/commands/setup.ts b/packages/phase2cli/src/commands/setup.ts index e877b85d..3b5dc5f3 100644 --- a/packages/phase2cli/src/commands/setup.ts +++ b/packages/phase2cli/src/commands/setup.ts @@ -2,7 +2,7 @@ import { zKey } from "snarkjs" import boxen from "boxen" -import { createWriteStream, Dirent, renameSync } from "fs" +import { createWriteStream, Dirent, renameSync, existsSync } from "fs" import { pipeline } from "node:stream" import { promisify } from "node:util" import fetch from "node-fetch" @@ -537,20 +537,33 @@ const setup = async (cmd: { template?: string; auth?: string }) => { `clock` ) spinner.start() - await zKey.newZKey( - r1csLocalPathAndFileName, - getPotLocalFilePath(circuit.files.potFilename), - zkeyLocalPathAndFileName, - undefined - ) - spinner.succeed( - `Generation of the genesis zKey for citcui ${theme.text.bold(circuit.name)} completed successfully` - ) + if (existsSync(zkeyLocalPathAndFileName)) { + spinner.succeed( + `The genesis zKey for circuit ${theme.text.bold(circuit.name)} is already present on disk` + ) + } else { + await zKey.newZKey( + r1csLocalPathAndFileName, + getPotLocalFilePath(circuit.files.potFilename), + zkeyLocalPathAndFileName, + undefined + ) + spinner.succeed( + `Generation of the genesis zKey for circuit ${theme.text.bold(circuit.name)} completed successfully` + ) + } + + const hashSpinner = customSpinner( + `Calculating hashes for circuit ${theme.text.bold(circuit.name)}...`, + `clock` + ) + hashSpinner.start() // 4. calculate the hashes const wasmBlake2bHash = await blake512FromPath(wasmLocalPathAndFileName) const potBlake2bHash = await blake512FromPath(getPotLocalFilePath(circuit.files.potFilename)) const initialZkeyBlake2bHash = await blake512FromPath(zkeyLocalPathAndFileName) + hashSpinner.succeed(`Hashes for circuit ${theme.text.bold(circuit.name)} calculated successfully`) // 5. upload the artifacts From 91645dc6d9b0046926934522584f1e2f4baddf28 Mon Sep 17 00:00:00 2001 From: Nico Serrano Date: Wed, 31 Jan 2024 23:55:42 -0500 Subject: [PATCH 2/4] Revert "Sed silent" --- .github/workflows/firebase-deploy-dev.yaml | 2 +- .github/workflows/firebase-deploy-staging.yaml | 2 +- .github/workflows/publish-dev-packages.yaml | 4 ++-- .github/workflows/publish-staging-packages.yaml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/firebase-deploy-dev.yaml b/.github/workflows/firebase-deploy-dev.yaml index 0903cf20..e496f051 100644 --- a/.github/workflows/firebase-deploy-dev.yaml +++ b/.github/workflows/firebase-deploy-dev.yaml @@ -42,7 +42,7 @@ jobs: sed -i -e 's/"@p0tion\/actions": "[^"]*"/"@devtion\/actions": "latest"/g' ./packages/backend/package.json # Update string literals in TypeScript files - find packages -type f -name '*.ts' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|devtion/actions|g' {} + + sed -i 's|p0tion/actions|devtion/actions|g' packages/**/*.ts cat ./packages/backend/package.json cat ./packages/backend/src/functions/ceremony.ts diff --git a/.github/workflows/firebase-deploy-staging.yaml b/.github/workflows/firebase-deploy-staging.yaml index ca54433e..9b07ef1a 100644 --- a/.github/workflows/firebase-deploy-staging.yaml +++ b/.github/workflows/firebase-deploy-staging.yaml @@ -42,7 +42,7 @@ jobs: sed -i -e 's/"@p0tion\/actions": "[^"]*"/"@stagtion\/actions": "latest"/g' ./packages/backend/package.json # Update string literals in TypeScript files - find packages -type f -name '*.ts' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|stagtion/actions|g' {} + + sed -i 's|p0tion/actions|stagtion/actions|g' packages/**/*.ts - name: Install npm packages and write env run: | diff --git a/.github/workflows/publish-dev-packages.yaml b/.github/workflows/publish-dev-packages.yaml index f9c9113f..12ecf687 100644 --- a/.github/workflows/publish-dev-packages.yaml +++ b/.github/workflows/publish-dev-packages.yaml @@ -43,8 +43,8 @@ jobs: sed -i -e 's/"name": "@p0tion\/actions"/"name": "@devtion\/actions"/g' ./packages/actions/package.json # Update string literals in TypeScript and JS files - find packages -type f -name '*.ts' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|devtion/actions|g' {} + - find packages -type f -name '*.js' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|devtion/actions|g' {} + + sed -i 's|p0tion/actions|devtion/actions|g' packages/**/*.ts + sed -i 's|p0tion/actions|devtion/actions|g' packages/**/*.js - name: Install lerna run: | diff --git a/.github/workflows/publish-staging-packages.yaml b/.github/workflows/publish-staging-packages.yaml index c24690fe..6eb110ec 100644 --- a/.github/workflows/publish-staging-packages.yaml +++ b/.github/workflows/publish-staging-packages.yaml @@ -43,8 +43,8 @@ jobs: sed -i -e 's/"name": "@p0tion\/actions"/"name": "@stagtion\/actions"/g' ./packages/actions/package.json # Update string literals in TypeScript and JS files - find packages -type f -name '*.ts' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|stagtion/actions|g' {} + - find packages -type f -name '*.js' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|stagtion/actions|g' {} + + sed -i 's|p0tion/actions|stagtion/actions|g' packages/**/*.ts + sed -i 's|p0tion/actions|stagtion/actions|g' packages/**/*.js - name: Install lerna run: | From 7d6961ec1b6e39cc606a5251a2a91db39c1f980b Mon Sep 17 00:00:00 2001 From: Nico Serrano Date: Thu, 1 Feb 2024 00:45:08 -0500 Subject: [PATCH 3/4] Revert "Revert "Sed silent"" --- .github/workflows/firebase-deploy-dev.yaml | 2 +- .github/workflows/firebase-deploy-staging.yaml | 2 +- .github/workflows/publish-dev-packages.yaml | 4 ++-- .github/workflows/publish-staging-packages.yaml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/firebase-deploy-dev.yaml b/.github/workflows/firebase-deploy-dev.yaml index e496f051..0903cf20 100644 --- a/.github/workflows/firebase-deploy-dev.yaml +++ b/.github/workflows/firebase-deploy-dev.yaml @@ -42,7 +42,7 @@ jobs: sed -i -e 's/"@p0tion\/actions": "[^"]*"/"@devtion\/actions": "latest"/g' ./packages/backend/package.json # Update string literals in TypeScript files - sed -i 's|p0tion/actions|devtion/actions|g' packages/**/*.ts + find packages -type f -name '*.ts' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|devtion/actions|g' {} + cat ./packages/backend/package.json cat ./packages/backend/src/functions/ceremony.ts diff --git a/.github/workflows/firebase-deploy-staging.yaml b/.github/workflows/firebase-deploy-staging.yaml index 9b07ef1a..ca54433e 100644 --- a/.github/workflows/firebase-deploy-staging.yaml +++ b/.github/workflows/firebase-deploy-staging.yaml @@ -42,7 +42,7 @@ jobs: sed -i -e 's/"@p0tion\/actions": "[^"]*"/"@stagtion\/actions": "latest"/g' ./packages/backend/package.json # Update string literals in TypeScript files - sed -i 's|p0tion/actions|stagtion/actions|g' packages/**/*.ts + find packages -type f -name '*.ts' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|stagtion/actions|g' {} + - name: Install npm packages and write env run: | diff --git a/.github/workflows/publish-dev-packages.yaml b/.github/workflows/publish-dev-packages.yaml index 12ecf687..f9c9113f 100644 --- a/.github/workflows/publish-dev-packages.yaml +++ b/.github/workflows/publish-dev-packages.yaml @@ -43,8 +43,8 @@ jobs: sed -i -e 's/"name": "@p0tion\/actions"/"name": "@devtion\/actions"/g' ./packages/actions/package.json # Update string literals in TypeScript and JS files - sed -i 's|p0tion/actions|devtion/actions|g' packages/**/*.ts - sed -i 's|p0tion/actions|devtion/actions|g' packages/**/*.js + find packages -type f -name '*.ts' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|devtion/actions|g' {} + + find packages -type f -name '*.js' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|devtion/actions|g' {} + - name: Install lerna run: | diff --git a/.github/workflows/publish-staging-packages.yaml b/.github/workflows/publish-staging-packages.yaml index 6eb110ec..c24690fe 100644 --- a/.github/workflows/publish-staging-packages.yaml +++ b/.github/workflows/publish-staging-packages.yaml @@ -43,8 +43,8 @@ jobs: sed -i -e 's/"name": "@p0tion\/actions"/"name": "@stagtion\/actions"/g' ./packages/actions/package.json # Update string literals in TypeScript and JS files - sed -i 's|p0tion/actions|stagtion/actions|g' packages/**/*.ts - sed -i 's|p0tion/actions|stagtion/actions|g' packages/**/*.js + find packages -type f -name '*.ts' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|stagtion/actions|g' {} + + find packages -type f -name '*.js' ! -path '*/node_modules/*' -exec sed -i 's|p0tion/actions|stagtion/actions|g' {} + - name: Install lerna run: | From 777f684c66bd2daba42fa3c9fa93f38982921d13 Mon Sep 17 00:00:00 2001 From: NicoSerranoP Date: Fri, 5 Apr 2024 18:52:52 -0400 Subject: [PATCH 4/4] chore(feat): increase to v1.2.0 --- CHANGELOG.md | 9 +++++++++ lerna.json | 2 +- packages/actions/CHANGELOG.md | 8 ++++++++ packages/actions/package.json | 2 +- packages/backend/CHANGELOG.md | 8 ++++++++ packages/backend/package.json | 4 ++-- packages/phase2cli/CHANGELOG.md | 9 +++++++++ packages/phase2cli/package.json | 4 ++-- yarn.lock | 6 +++--- 9 files changed, 43 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 629b6dcf..2b0702bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.0](https://github.com/privacy-scaling-explorations/p0tion/compare/v1.1.1...v1.2.0) (2024-04-05) + + +### Features + +* **contribute.ts:** avoid duplicate invocation of compute step ([4ab581e](https://github.com/privacy-scaling-explorations/p0tion/commit/4ab581ef7debfcb8281feb8135f7835bbbcfdc8c)), closes [#268](https://github.com/privacy-scaling-explorations/p0tion/issues/268) + + + ## [1.1.1](https://github.com/privacy-scaling-explorations/p0tion/compare/v1.0.8...v1.1.1) (2024-01-06) diff --git a/lerna.json b/lerna.json index 6023cd52..cbf2e617 100644 --- a/lerna.json +++ b/lerna.json @@ -3,7 +3,7 @@ "packages/*" ], "npmClient": "yarn", - "version": "1.1.1", + "version": "1.2.0", "changelogPreset": { "name": "conventionalcommits", "issuePrefixes": [ diff --git a/packages/actions/CHANGELOG.md b/packages/actions/CHANGELOG.md index 59da4b78..05e01991 100644 --- a/packages/actions/CHANGELOG.md +++ b/packages/actions/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.0](https://github.com/privacy-scaling-explorations/p0tion/compare/v1.1.1...v1.2.0) (2024-04-05) + +**Note:** Version bump only for package @p0tion/actions + + + + + ## [1.1.1](https://github.com/privacy-scaling-explorations/p0tion/compare/v1.0.8...v1.1.1) (2024-01-06) diff --git a/packages/actions/package.json b/packages/actions/package.json index 966a9f5d..758752cb 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -1,6 +1,6 @@ { "name": "@p0tion/actions", - "version": "1.1.1", + "version": "1.2.0", "description": "A set of actions and helpers for CLI commands", "repository": "git@github.com:privacy-scaling-explorations/p0tion.git", "homepage": "https://github.com/privacy-scaling-explorations/p0tion", diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index e393b966..fd72365a 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.0](https://github.com/privacy-scaling-explorations/p0tion/compare/v1.1.1...v1.2.0) (2024-04-05) + +**Note:** Version bump only for package @p0tion/backend + + + + + ## [1.1.1](https://github.com/privacy-scaling-explorations/p0tion/compare/v1.0.8...v1.1.1) (2024-01-06) diff --git a/packages/backend/package.json b/packages/backend/package.json index 38d30cd7..8881b30e 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "@p0tion/backend", - "version": "1.1.1", + "version": "1.2.0", "description": "MPC Phase 2 backend for Firebase services management", "repository": "git@github.com:privacy-scaling-explorations/p0tion.git", "homepage": "https://github.com/privacy-scaling-explorations/p0tion", @@ -68,7 +68,7 @@ "@aws-sdk/middleware-endpoint": "^3.329.0", "@aws-sdk/s3-request-presigner": "^3.329.0", "@bandada/api-sdk": "^1.0.0-beta.1", - "@p0tion/actions": "^1.1.1", + "@p0tion/actions": "^1.2.0", "blakejs": "^1.2.1", "dotenv": "^16.0.3", "ethers": "5.7.2", diff --git a/packages/phase2cli/CHANGELOG.md b/packages/phase2cli/CHANGELOG.md index f4ceed3f..3d3254fb 100644 --- a/packages/phase2cli/CHANGELOG.md +++ b/packages/phase2cli/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.0](https://github.com/privacy-scaling-explorations/p0tion/compare/v1.1.1...v1.2.0) (2024-04-05) + + +### Features + +* **contribute.ts:** avoid duplicate invocation of compute step ([4ab581e](https://github.com/privacy-scaling-explorations/p0tion/commit/4ab581ef7debfcb8281feb8135f7835bbbcfdc8c)), closes [#268](https://github.com/privacy-scaling-explorations/p0tion/issues/268) + + + ## [1.1.1](https://github.com/privacy-scaling-explorations/p0tion/compare/v1.0.8...v1.1.1) (2024-01-06) diff --git a/packages/phase2cli/package.json b/packages/phase2cli/package.json index c9ae30a0..764ccf67 100644 --- a/packages/phase2cli/package.json +++ b/packages/phase2cli/package.json @@ -1,7 +1,7 @@ { "name": "@p0tion/phase2cli", "type": "module", - "version": "1.1.1", + "version": "1.2.0", "description": "All-in-one interactive command-line for interfacing with zkSNARK Phase 2 Trusted Setup ceremonies", "repository": "git@github.com:privacy-scaling-explorations/p0tion.git", "homepage": "https://github.com/privacy-scaling-explorations/p0tion", @@ -73,7 +73,7 @@ "@octokit/auth-oauth-app": "^5.0.5", "@octokit/auth-oauth-device": "^4.0.4", "@octokit/request": "^6.2.3", - "@p0tion/actions": "^1.1.1", + "@p0tion/actions": "^1.2.0", "@semaphore-protocol/identity": "^3.15.1", "blakejs": "^1.2.1", "boxen": "^7.1.0", diff --git a/yarn.lock b/yarn.lock index fde14997..aaaa10ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4718,7 +4718,7 @@ __metadata: languageName: node linkType: hard -"@p0tion/actions@^1.1.1, @p0tion/actions@workspace:packages/actions": +"@p0tion/actions@^1.2.0, @p0tion/actions@workspace:packages/actions": version: 0.0.0-use.local resolution: "@p0tion/actions@workspace:packages/actions" dependencies: @@ -4769,7 +4769,7 @@ __metadata: "@aws-sdk/s3-request-presigner": ^3.329.0 "@bandada/api-sdk": ^1.0.0-beta.1 "@firebase/rules-unit-testing": ^2.0.7 - "@p0tion/actions": ^1.1.1 + "@p0tion/actions": ^1.2.0 "@types/rollup-plugin-auto-external": ^2.0.2 "@types/uuid": ^9.0.1 blakejs: ^1.2.1 @@ -4804,7 +4804,7 @@ __metadata: "@octokit/auth-oauth-app": ^5.0.5 "@octokit/auth-oauth-device": ^4.0.4 "@octokit/request": ^6.2.3 - "@p0tion/actions": ^1.1.1 + "@p0tion/actions": ^1.2.0 "@semaphore-protocol/identity": ^3.15.1 "@types/clear": ^0.1.2 "@types/cli-progress": ^3.11.0