From a50a645267ed2b07cc50da4070205e825e6ad57a Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Fri, 25 Aug 2023 11:39:36 +0000 Subject: [PATCH] chore (merge) - promote staging to prod (#182) * chore (merge) - merge dev into staging (#163) * fix(setup): remove S3 usage and download from URL * fix(imports): use adoby-node-fetch * fix(vm): stop vm even on verification failing * feat(contribute): cli flag for auth token (run on VM) * fix(vm): fix VM setup * ci: update string literals in ts files for staging/dev environment --------- Co-authored-by: Daehyun Paik * Promote to staging from dev (#166) * fix(setup): remove S3 usage and download from URL * fix(imports): use adoby-node-fetch * fix(vm): stop vm even on verification failing * feat(contribute): cli flag for auth token (run on VM) * fix(vm): fix VM setup * ci: update string literals in ts files for staging/dev environment * fix(ci): missing environment specifier in cli publish workflow --------- Co-authored-by: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> * chore(merge) - merge dev into staging (#170) * fix(setup): remove S3 usage and download from URL * fix(imports): use adoby-node-fetch * fix(vm): stop vm even on verification failing * feat(contribute): cli flag for auth token (run on VM) * fix(vm): fix VM setup * ci: update string literals in ts files for staging/dev environment * fix(ci): missing environment specifier in cli publish workflow * fix(timeout): fix issue with timing out while in upload phase --------- Co-authored-by: Daehyun Paik * chore (merge) - dev to staging (#174) * fix(setup): remove S3 usage and download from URL * fix(imports): use adoby-node-fetch * fix(vm): stop vm even on verification failing * feat(contribute): cli flag for auth token (run on VM) * fix(vm): fix VM setup * ci: update string literals in ts files for staging/dev environment * fix(ci): missing environment specifier in cli publish workflow * fix(timeout): fix issue with timing out while in upload phase * fix(finalization): fix various bugs and add non interactive auth * build(cleanup): removed puppeteer and related tests --------- Co-authored-by: Daehyun Paik * [release/v1.0.7] Promote dev to staging (#176) * fix(setup): remove S3 usage and download from URL * fix(imports): use adoby-node-fetch * fix(vm): stop vm even on verification failing * feat(contribute): cli flag for auth token (run on VM) * fix(vm): fix VM setup * ci: update string literals in ts files for staging/dev environment * fix(ci): missing environment specifier in cli publish workflow * fix(timeout): fix issue with timing out while in upload phase * fix(finalization): fix various bugs and add non interactive auth * build(cleanup): removed puppeteer and related tests * chore(release): publish 1.0.7 --------- Co-authored-by: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Co-authored-by: daodesigner <58278045+daodesigner@users.noreply.github.com> * chore (merge) - dev to staging (#181) * fix(setup): remove S3 usage and download from URL * fix(imports): use adoby-node-fetch * fix(vm): stop vm even on verification failing * feat(contribute): cli flag for auth token (run on VM) * fix(vm): fix VM setup * ci: update string literals in ts files for staging/dev environment * fix(ci): missing environment specifier in cli publish workflow * fix(timeout): fix issue with timing out while in upload phase * fix(finalization): fix various bugs and add non interactive auth * build(cleanup): removed puppeteer and related tests * chore(release): publish 1.0.7 * refactor(ui/ux): small changes for a better ui/ux * refactor(ui/ux): add information about private profiles failing sybil checks * fix(ui): fix wording * chore(release): publish 1.0.8 --------- Co-authored-by: Daehyun Paik Co-authored-by: daodesigner <58278045+daodesigner@users.noreply.github.com> --------- Co-authored-by: Daehyun Paik Co-authored-by: daodesigner <58278045+daodesigner@users.noreply.github.com> --- lerna.json | 2 +- packages/actions/package.json | 2 +- packages/actions/src/helpers/utils.ts | 2 +- packages/backend/package.json | 4 ++-- packages/phase2cli/package.json | 4 ++-- packages/phase2cli/src/commands/contribute.ts | 5 +++-- packages/phase2cli/src/commands/finalize.ts | 10 +++++++--- packages/phase2cli/src/lib/utils.ts | 10 ++++++---- yarn.lock | 6 +++--- 9 files changed, 26 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index c3e14247..0daf0c2f 100644 --- a/lerna.json +++ b/lerna.json @@ -3,7 +3,7 @@ "packages/*" ], "npmClient": "yarn", - "version": "1.0.7", + "version": "1.0.8", "changelogPreset": { "name": "conventionalcommits", "issuePrefixes": [ diff --git a/packages/actions/package.json b/packages/actions/package.json index 30ba797f..db272fe8 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -1,6 +1,6 @@ { "name": "@p0tion/actions", - "version": "1.0.7", + "version": "1.0.8", "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/actions/src/helpers/utils.ts b/packages/actions/src/helpers/utils.ts index 7945fb83..94672483 100644 --- a/packages/actions/src/helpers/utils.ts +++ b/packages/actions/src/helpers/utils.ts @@ -446,7 +446,7 @@ export const getPublicAttestationPreambleForContributor = ( ) => `Hey, I'm ${contributorIdentifier} and I have ${ isFinalizing ? "finalized" : "contributed to" - } the ${ceremonyName} MPC Phase2 Trusted Setup ceremony.\nThe following are my contribution signatures:` + } the ${ceremonyName}${ceremonyName.toLowerCase().includes('trusted setup') || ceremonyName.toLowerCase().includes("ceremony") ? "." : " MPC Phase2 Trusted Setup ceremony."}\nThe following are my contribution signatures:` /** * Check and prepare public attestation for the contributor made only of its valid contributions. diff --git a/packages/backend/package.json b/packages/backend/package.json index 9a4bee8f..6988d3d7 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "@p0tion/backend", - "version": "1.0.7", + "version": "1.0.8", "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", @@ -67,7 +67,7 @@ "@aws-sdk/client-ssm": "^3.357.0", "@aws-sdk/middleware-endpoint": "^3.329.0", "@aws-sdk/s3-request-presigner": "^3.329.0", - "@p0tion/actions": "^1.0.7", + "@p0tion/actions": "^1.0.8", "blakejs": "^1.2.1", "dotenv": "^16.0.3", "ethers": "5.7.2", diff --git a/packages/phase2cli/package.json b/packages/phase2cli/package.json index 6654b19b..5e7437e3 100644 --- a/packages/phase2cli/package.json +++ b/packages/phase2cli/package.json @@ -1,7 +1,7 @@ { "name": "@p0tion/phase2cli", "type": "module", - "version": "1.0.7", + "version": "1.0.8", "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", @@ -68,7 +68,7 @@ "@octokit/auth-oauth-app": "^5.0.5", "@octokit/auth-oauth-device": "^4.0.4", "@octokit/request": "^6.2.3", - "@p0tion/actions": "^1.0.7", + "@p0tion/actions": "^1.0.8", "blakejs": "^1.2.1", "boxen": "^7.1.0", "chalk": "^5.2.0", diff --git a/packages/phase2cli/src/commands/contribute.ts b/packages/phase2cli/src/commands/contribute.ts index c3b088b0..6d31fd88 100644 --- a/packages/phase2cli/src/commands/contribute.ts +++ b/packages/phase2cli/src/commands/contribute.ts @@ -724,7 +724,8 @@ export const listenToParticipantDocumentChanges = async ( participant, entropy, providerUserId, - false // not finalizing. + false, // not finalizing. + circuits.length ) } // Scenario (3.A). @@ -949,7 +950,7 @@ const contribute = async (opt: any) => { const userData = userDoc.data() if (!userData) { spinner.fail( - `Unfortunately we could not find a user document with your information. This likely means that you did not pass the GitHub reputation checks and therefore are not elegible to contribute to any ceremony. Please contact the coordinator if you believe this to be an error.` + `Unfortunately we could not find a user document with your information. This likely means that you did not pass the GitHub reputation checks and therefore are not elegible to contribute to any ceremony. If you believe you pass the requirements, it might be possible that your profile is private and we were not able to fetch your real statistics, in this case please consider making your profile public for the duration of the contribution. Please contact the coordinator if you believe this to be an error.` ) process.exit(0) } diff --git a/packages/phase2cli/src/commands/finalize.ts b/packages/phase2cli/src/commands/finalize.ts index c7184f9a..2e5c8bd8 100644 --- a/packages/phase2cli/src/commands/finalize.ts +++ b/packages/phase2cli/src/commands/finalize.ts @@ -152,6 +152,7 @@ export const handleVerifierSmartContract = async ( * @param participant - the Firestore document of the participant (coordinator). * @param beacon - the value used to compute the final contribution while finalizing the ceremony. * @param coordinatorIdentifier - the identifier of the coordinator. + * @param circuitsLength - the number of circuits in the ceremony. */ export const handleCircuitFinalization = async ( cloudFunctions: Functions, @@ -160,7 +161,8 @@ export const handleCircuitFinalization = async ( circuit: FirebaseDocumentInfo, participant: FirebaseDocumentInfo, beacon: string, - coordinatorIdentifier: string + coordinatorIdentifier: string, + circuitsLength: number ) => { // Step (1). await handleStartOrResumeContribution( @@ -171,7 +173,8 @@ export const handleCircuitFinalization = async ( participant, computeSHA256ToHex(beacon), coordinatorIdentifier, - true + true, + circuitsLength ) await sleep(2000) // workaound for descriptors. @@ -307,7 +310,8 @@ const finalize = async (opt: any) => { circuit, participant, beacon, - providerUserId + providerUserId, + circuits.length ) process.stdout.write(`\n`) diff --git a/packages/phase2cli/src/lib/utils.ts b/packages/phase2cli/src/lib/utils.ts index 3cfacc47..877c6e19 100644 --- a/packages/phase2cli/src/lib/utils.ts +++ b/packages/phase2cli/src/lib/utils.ts @@ -311,8 +311,8 @@ export const generateCustomUrlToTweetAboutParticipation = ( isFinalizing: boolean ) => isFinalizing - ? `https://twitter.com/intent/tweet?text=I%20have%20finalized%20the%20${ceremonyName}%20Phase%202%20Trusted%20Setup%20ceremony!%20You%20can%20view%20my%20final%20attestation%20here:%20${gistUrl}%20#Ethereum%20#ZKP%20#PSE` - : `https://twitter.com/intent/tweet?text=I%20contributed%20to%20the%20${ceremonyName}%20Phase%202%20Trusted%20Setup%20ceremony!%20You%20can%20contribute%20here:%20https://github.com/privacy-scaling-explorations/p0tion%20You%20can%20view%20my%20attestation%20here:%20${gistUrl}%20#Ethereum%20#ZKP` + ? `https://twitter.com/intent/tweet?text=I%20have%20finalized%20the%20${ceremonyName}${ceremonyName.toLowerCase().includes("trusted") || ceremonyName.toLowerCase().includes("setup") || ceremonyName.toLowerCase().includes("phase2") || ceremonyName.toLowerCase().includes("ceremony") ? "!" : "%20Phase%202%20Trusted%20Setup%20ceremony!"}%20You%20can%20view%20my%20final%20attestation%20here:%20${gistUrl}%20#Ethereum%20#ZKP%20#PSE` + : `https://twitter.com/intent/tweet?text=I%20contributed%20to%20the%20${ceremonyName}${ceremonyName.toLowerCase().includes("trusted") || ceremonyName.toLowerCase().includes("setup") || ceremonyName.toLowerCase().includes("phase2") || ceremonyName.toLowerCase().includes("ceremony") ? "!" : "%20Phase%202%20Trusted%20Setup%20ceremony!"}%20You%20can%20view%20the%20steps%20to%20contribute%20here:%20https://ceremony.pse.dev%20You%20can%20view%20my%20attestation%20here:%20${gistUrl}%20#Ethereum%20#ZKP` /** * Return a custom progress bar. @@ -521,6 +521,7 @@ export const getLatestUpdatesFromParticipant = async ( * @param entropyOrBeaconHash - the entropy or beacon hash (only when finalizing) for the contribution. * @param contributorOrCoordinatorIdentifier - the identifier of the contributor or coordinator (only when finalizing). * @param isFinalizing - flag to discriminate between ceremony finalization (true) and contribution (false). + * @param circuitsLength - the total number of circuits in the ceremony. */ export const handleStartOrResumeContribution = async ( cloudFunctions: Functions, @@ -530,7 +531,8 @@ export const handleStartOrResumeContribution = async ( participant: FirebaseDocumentInfo, entropyOrBeaconHash: any, contributorOrCoordinatorIdentifier: string, - isFinalizing: boolean + isFinalizing: boolean, + circuitsLength: number ): Promise => { // Extract data. const { prefix: ceremonyPrefix } = ceremony.data @@ -538,7 +540,7 @@ export const handleStartOrResumeContribution = async ( const { completedContributions } = waitingQueue // = current progress. console.log( - `${theme.text.bold(`\n- Circuit # ${theme.colors.magenta(`${sequencePosition}`)}`)} (Contribution Steps)` + `${theme.text.bold(`\n- Circuit # ${theme.colors.magenta(`${sequencePosition}/${circuitsLength}`)}`)} (Contribution Steps)` ) // Get most up-to-date data from the participant document. diff --git a/yarn.lock b/yarn.lock index 59ee31b6..91f2d9f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6140,7 +6140,7 @@ __metadata: languageName: node linkType: hard -"@p0tion/actions@^1.0.7, @p0tion/actions@workspace:packages/actions": +"@p0tion/actions@^1.0.8, @p0tion/actions@workspace:packages/actions": version: 0.0.0-use.local resolution: "@p0tion/actions@workspace:packages/actions" dependencies: @@ -6191,7 +6191,7 @@ __metadata: "@aws-sdk/middleware-endpoint": ^3.329.0 "@aws-sdk/s3-request-presigner": ^3.329.0 "@firebase/rules-unit-testing": ^2.0.7 - "@p0tion/actions": ^1.0.7 + "@p0tion/actions": ^1.0.8 "@types/rollup-plugin-auto-external": ^2.0.2 "@types/uuid": ^9.0.1 blakejs: ^1.2.1 @@ -6225,7 +6225,7 @@ __metadata: "@octokit/auth-oauth-app": ^5.0.5 "@octokit/auth-oauth-device": ^4.0.4 "@octokit/request": ^6.2.3 - "@p0tion/actions": ^1.0.7 + "@p0tion/actions": ^1.0.8 "@types/clear": ^0.1.2 "@types/cli-progress": ^3.11.0 "@types/figlet": ^1.5.6