@devtion/backend 0.0.0-8b5a17f → 0.0.0-8bb9489

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @module @devtion/backend
3
- * @version 1.0.6
2
+ * @module @p0tion/backend
3
+ * @version 1.0.9
4
4
  * @file MPC Phase 2 backend for Firebase services management
5
5
  * @copyright Ethereum Foundation 2022
6
6
  * @license MIT
@@ -9,7 +9,7 @@
9
9
  import admin from 'firebase-admin';
10
10
  import * as functions from 'firebase-functions';
11
11
  import dotenv from 'dotenv';
12
- import { getCircuitsCollectionPath, getTimeoutsCollectionPath, commonTerms, finalContributionIndex, getContributionsCollectionPath, githubReputation, getBucketName, vmBootstrapCommand, vmDependenciesAndCacheArtifactsCommand, vmBootstrapScriptFilename, computeDiskSizeForVM, createEC2Instance, getParticipantsCollectionPath, terminateEC2Instance, formatZkeyIndex, getTranscriptStorageFilePath, getZkeyStorageFilePath, startEC2Instance, vmContributionVerificationCommand, runCommandUsingSSM, getPotStorageFilePath, genesisZkeyIndex, createCustomLoggerForFile, blake512FromPath, getVerificationKeyStorageFilePath, getVerifierContractStorageFilePath, computeSHA256ToHex, retrieveCommandStatus, checkIfRunning, retrieveCommandOutput, stopEC2Instance, verificationKeyAcronym, verifierSmartContractAcronym } from '@devtion/actions';
12
+ import { getCircuitsCollectionPath, getTimeoutsCollectionPath, commonTerms, finalContributionIndex, getContributionsCollectionPath, githubReputation, getBucketName, vmBootstrapCommand, vmDependenciesAndCacheArtifactsCommand, vmBootstrapScriptFilename, computeDiskSizeForVM, createEC2Instance, getParticipantsCollectionPath, terminateEC2Instance, formatZkeyIndex, getTranscriptStorageFilePath, getZkeyStorageFilePath, startEC2Instance, vmContributionVerificationCommand, runCommandUsingSSM, getPotStorageFilePath, genesisZkeyIndex, createCustomLoggerForFile, blake512FromPath, getVerificationKeyStorageFilePath, getVerifierContractStorageFilePath, computeSHA256ToHex, checkIfRunning, retrieveCommandOutput, stopEC2Instance, verificationKeyAcronym, verifierSmartContractAcronym, retrieveCommandStatus } from '@p0tion/actions';
13
13
  import { encode } from 'html-entities';
14
14
  import { Timestamp, FieldValue } from 'firebase-admin/firestore';
15
15
  import { S3Client, GetObjectCommand, PutObjectCommand, DeleteObjectCommand, HeadBucketCommand, CreateBucketCommand, PutPublicAccessBlockCommand, PutBucketCorsCommand, HeadObjectCommand, CreateMultipartUploadCommand, UploadPartCommand, CompleteMultipartUploadCommand } from '@aws-sdk/client-s3';
@@ -19,7 +19,7 @@ import { pipeline } from 'node:stream';
19
19
  import { promisify } from 'node:util';
20
20
  import fs, { readFileSync } from 'fs';
21
21
  import mime from 'mime-types';
22
- import { setTimeout } from 'timers/promises';
22
+ import { setTimeout as setTimeout$1 } from 'timers/promises';
23
23
  import fetch from '@adobe/node-fetch-retry';
24
24
  import path from 'path';
25
25
  import os from 'os';
@@ -121,7 +121,8 @@ const SPECIFIC_ERRORS = {
121
121
  SE_VM_FAILED_COMMAND_EXECUTION: makeError("failed-precondition", "VM command execution failed", "Please, contact the coordinator if this error persists."),
122
122
  SE_VM_TIMEDOUT_COMMAND_EXECUTION: makeError("deadline-exceeded", "VM command execution took too long and has been timed-out", "Please, contact the coordinator if this error persists."),
123
123
  SE_VM_CANCELLED_COMMAND_EXECUTION: makeError("cancelled", "VM command execution has been cancelled", "Please, contact the coordinator if this error persists."),
124
- SE_VM_DELAYED_COMMAND_EXECUTION: makeError("unavailable", "VM command execution has been delayed since there were no available instance at the moment", "Please, contact the coordinator if this error persists.")
124
+ SE_VM_DELAYED_COMMAND_EXECUTION: makeError("unavailable", "VM command execution has been delayed since there were no available instance at the moment", "Please, contact the coordinator if this error persists."),
125
+ SE_VM_UNKNOWN_COMMAND_STATUS: makeError("unavailable", "VM command execution has failed due to an unknown status code", "Please, contact the coordinator if this error persists.")
125
126
  };
126
127
  /**
127
128
  * A set of common errors.
@@ -191,7 +192,7 @@ const getCurrentServerTimestampInMillis = () => Timestamp.now().toMillis();
191
192
  * Interrupt the current execution for a specified amount of time.
192
193
  * @param ms <number> - the amount of time expressed in milliseconds.
193
194
  */
194
- const sleep = async (ms) => setTimeout(ms);
195
+ const sleep = async (ms) => setTimeout$1(ms);
195
196
  /**
196
197
  * Query for ceremony circuits.
197
198
  * @notice the order by sequence position is fundamental to maintain parallelism among contributions for different circuits.
@@ -264,7 +265,7 @@ const queryOpenedCeremonies = async () => {
264
265
  const getCircuitDocumentByPosition = async (ceremonyId, sequencePosition) => {
265
266
  // Query for all ceremony circuits.
266
267
  const circuits = await getCeremonyCircuits(ceremonyId);
267
- // Apply a filter using the sequence postion.
268
+ // Apply a filter using the sequence position.
268
269
  const matchedCircuits = circuits.filter((circuit) => circuit.data().sequencePosition === sequencePosition);
269
270
  if (matchedCircuits.length !== 1)
270
271
  logAndThrowError(COMMON_ERRORS.CM_NO_CIRCUIT_FOR_GIVEN_SEQUENCE_POSITION);
@@ -305,7 +306,7 @@ const downloadArtifactFromS3Bucket = async (bucketName, objectKey, localFilePath
305
306
  const writeStream = createWriteStream(localFilePath);
306
307
  const streamPipeline = promisify(pipeline);
307
308
  await streamPipeline(response.body, writeStream);
308
- writeStream.on('finish', () => {
309
+ writeStream.on("finish", () => {
309
310
  writeStream.end();
310
311
  });
311
312
  };
@@ -539,7 +540,9 @@ const registerAuthUser = functions
539
540
  // Delete user
540
541
  await auth.deleteUser(user.uid);
541
542
  // Throw error
542
- logAndThrowError(makeError("permission-denied", "The user is not allowed to sign up because their Github reputation is not high enough.", `The user ${user.displayName === "Null" || user.displayName === null ? user.uid : user.displayName} is not allowed to sign up because their Github reputation is not high enough. Please contact the administrator if you think this is a mistake.`));
543
+ logAndThrowError(makeError("permission-denied", "The user is not allowed to sign up because their Github reputation is not high enough.", `The user ${user.displayName === "Null" || user.displayName === null
544
+ ? user.uid
545
+ : user.displayName} is not allowed to sign up because their Github reputation is not high enough. Please contact the administrator if you think this is a mistake.`));
543
546
  }
544
547
  // store locally
545
548
  avatarUrl = avatarURL;
@@ -554,7 +557,7 @@ const registerAuthUser = functions
554
557
  }
555
558
  // Set document (nb. we refer to providerData[0] because we use Github OAuth provider only).
556
559
  // In future releases we might want to loop through the providerData array as we support
557
- // more providers.
560
+ // more providers.
558
561
  await userRef.set({
559
562
  name: encodedDisplayName,
560
563
  encodedDisplayName,
@@ -570,7 +573,7 @@ const registerAuthUser = functions
570
573
  // we want to create a new collection for the users to store the avatars
571
574
  const avatarRef = firestore.collection(commonTerms.collections.avatars.name).doc(uid);
572
575
  await avatarRef.set({
573
- avatarUrl: avatarUrl || "",
576
+ avatarUrl: avatarUrl || ""
574
577
  });
575
578
  printLog(`Authenticated user document with identifier ${uid} has been correctly stored`, LogLevel.DEBUG);
576
579
  printLog(`Authenticated user avatar with identifier ${uid} has been correctly stored`, LogLevel.DEBUG);
@@ -867,7 +870,7 @@ dotenv.config();
867
870
  * @dev true when the participant can participate (1.A, 3.B, 1.D); otherwise false.
868
871
  */
869
872
  const checkParticipantForCeremony = functions
870
- .region('europe-west1')
873
+ .region("europe-west1")
871
874
  .runWith({
872
875
  memory: "512MB"
873
876
  })
@@ -971,7 +974,7 @@ const checkParticipantForCeremony = functions
971
974
  * 2) the participant has just finished the contribution for a circuit (contributionProgress != 0 && status = CONTRIBUTED && contributionStep = COMPLETED).
972
975
  */
973
976
  const progressToNextCircuitForContribution = functions
974
- .region('europe-west1')
977
+ .region("europe-west1")
975
978
  .runWith({
976
979
  memory: "512MB"
977
980
  })
@@ -1018,7 +1021,7 @@ const progressToNextCircuitForContribution = functions
1018
1021
  * 5) Completed contribution computation and verification.
1019
1022
  */
1020
1023
  const progressToNextContributionStep = functions
1021
- .region('europe-west1')
1024
+ .region("europe-west1")
1022
1025
  .runWith({
1023
1026
  memory: "512MB"
1024
1027
  })
@@ -1069,7 +1072,7 @@ const progressToNextContributionStep = functions
1069
1072
  * @dev enable the current contributor to resume a contribution from where it had left off.
1070
1073
  */
1071
1074
  const permanentlyStoreCurrentContributionTimeAndHash = functions
1072
- .region('europe-west1')
1075
+ .region("europe-west1")
1073
1076
  .runWith({
1074
1077
  memory: "512MB"
1075
1078
  })
@@ -1111,7 +1114,7 @@ const permanentlyStoreCurrentContributionTimeAndHash = functions
1111
1114
  * @dev enable the current contributor to resume a multi-part upload from where it had left off.
1112
1115
  */
1113
1116
  const temporaryStoreCurrentContributionMultiPartUploadId = functions
1114
- .region('europe-west1')
1117
+ .region("europe-west1")
1115
1118
  .runWith({
1116
1119
  memory: "512MB"
1117
1120
  })
@@ -1149,7 +1152,7 @@ const temporaryStoreCurrentContributionMultiPartUploadId = functions
1149
1152
  * @dev enable the current contributor to resume a multi-part upload from where it had left off.
1150
1153
  */
1151
1154
  const temporaryStoreCurrentContributionUploadedChunkData = functions
1152
- .region('europe-west1')
1155
+ .region("europe-west1")
1153
1156
  .runWith({
1154
1157
  memory: "512MB"
1155
1158
  })
@@ -1191,7 +1194,7 @@ const temporaryStoreCurrentContributionUploadedChunkData = functions
1191
1194
  * contributed to every selected ceremony circuits (= DONE).
1192
1195
  */
1193
1196
  const checkAndPrepareCoordinatorForFinalization = functions
1194
- .region('europe-west1')
1197
+ .region("europe-west1")
1195
1198
  .runWith({
1196
1199
  memory: "512MB"
1197
1200
  })
@@ -1343,54 +1346,74 @@ const coordinate = async (participant, circuit, isSingleParticipantCoordination,
1343
1346
  * Wait until the command has completed its execution inside the VM.
1344
1347
  * @dev this method implements a custom interval to check 5 times after 1 minute if the command execution
1345
1348
  * has been completed or not by calling the `retrieveCommandStatus` method.
1346
- * @param {any} resolve the promise.
1347
- * @param {any} reject the promise.
1348
1349
  * @param {SSMClient} ssm the SSM client.
1349
1350
  * @param {string} vmInstanceId the unique identifier of the VM instance.
1350
1351
  * @param {string} commandId the unique identifier of the VM command.
1351
1352
  * @returns <Promise<void>> true when the command execution succeed; otherwise false.
1352
1353
  */
1353
- const waitForVMCommandExecution = (resolve, reject, ssm, vmInstanceId, commandId) => {
1354
- const interval = setInterval(async () => {
1354
+ const waitForVMCommandExecution = (ssm, vmInstanceId, commandId) => new Promise((resolve, reject) => {
1355
+ const poll = async () => {
1355
1356
  try {
1356
1357
  // Get command status.
1357
1358
  const cmdStatus = await retrieveCommandStatus(ssm, vmInstanceId, commandId);
1358
1359
  printLog(`Checking command ${commandId} status => ${cmdStatus}`, LogLevel.DEBUG);
1359
- if (cmdStatus === CommandInvocationStatus.SUCCESS) {
1360
- printLog(`Command ${commandId} successfully completed`, LogLevel.DEBUG);
1361
- // Resolve the promise.
1362
- resolve();
1363
- }
1364
- else if (cmdStatus === CommandInvocationStatus.FAILED) {
1365
- logAndThrowError(SPECIFIC_ERRORS.SE_VM_FAILED_COMMAND_EXECUTION);
1366
- reject();
1367
- }
1368
- else if (cmdStatus === CommandInvocationStatus.TIMED_OUT) {
1369
- logAndThrowError(SPECIFIC_ERRORS.SE_VM_TIMEDOUT_COMMAND_EXECUTION);
1370
- reject();
1371
- }
1372
- else if (cmdStatus === CommandInvocationStatus.CANCELLED) {
1373
- logAndThrowError(SPECIFIC_ERRORS.SE_VM_CANCELLED_COMMAND_EXECUTION);
1374
- reject();
1360
+ let error;
1361
+ switch (cmdStatus) {
1362
+ case CommandInvocationStatus.CANCELLING:
1363
+ case CommandInvocationStatus.CANCELLED: {
1364
+ error = SPECIFIC_ERRORS.SE_VM_CANCELLED_COMMAND_EXECUTION;
1365
+ break;
1366
+ }
1367
+ case CommandInvocationStatus.DELAYED: {
1368
+ error = SPECIFIC_ERRORS.SE_VM_DELAYED_COMMAND_EXECUTION;
1369
+ break;
1370
+ }
1371
+ case CommandInvocationStatus.FAILED: {
1372
+ error = SPECIFIC_ERRORS.SE_VM_FAILED_COMMAND_EXECUTION;
1373
+ break;
1374
+ }
1375
+ case CommandInvocationStatus.TIMED_OUT: {
1376
+ error = SPECIFIC_ERRORS.SE_VM_TIMEDOUT_COMMAND_EXECUTION;
1377
+ break;
1378
+ }
1379
+ case CommandInvocationStatus.IN_PROGRESS:
1380
+ case CommandInvocationStatus.PENDING: {
1381
+ // wait a minute and poll again
1382
+ setTimeout(poll, 60000);
1383
+ return;
1384
+ }
1385
+ case CommandInvocationStatus.SUCCESS: {
1386
+ printLog(`Command ${commandId} successfully completed`, LogLevel.DEBUG);
1387
+ // Resolve the promise.
1388
+ resolve();
1389
+ return;
1390
+ }
1391
+ default: {
1392
+ logAndThrowError(SPECIFIC_ERRORS.SE_VM_UNKNOWN_COMMAND_STATUS);
1393
+ }
1375
1394
  }
1376
- else if (cmdStatus === CommandInvocationStatus.DELAYED) {
1377
- logAndThrowError(SPECIFIC_ERRORS.SE_VM_DELAYED_COMMAND_EXECUTION);
1378
- reject();
1395
+ if (error) {
1396
+ logAndThrowError(error);
1379
1397
  }
1380
1398
  }
1381
1399
  catch (error) {
1382
1400
  printLog(`Invalid command ${commandId} execution`, LogLevel.DEBUG);
1401
+ const ec2 = await createEC2Client();
1402
+ // if it errors out, let's just log it as a warning so the coordinator is aware
1403
+ try {
1404
+ await stopEC2Instance(ec2, vmInstanceId);
1405
+ }
1406
+ catch (error) {
1407
+ printLog(`Error while stopping VM instance ${vmInstanceId} - Error ${error}`, LogLevel.WARN);
1408
+ }
1383
1409
  if (!error.toString().includes(commandId))
1384
1410
  logAndThrowError(COMMON_ERRORS.CM_INVALID_COMMAND_EXECUTION);
1385
1411
  // Reject the promise.
1386
1412
  reject();
1387
1413
  }
1388
- finally {
1389
- // Clear the interval.
1390
- clearInterval(interval);
1391
- }
1392
- }, 60000); // 1 minute.
1393
- };
1414
+ };
1415
+ setTimeout(poll, 60000);
1416
+ });
1394
1417
  /**
1395
1418
  * This method is used to coordinate the waiting queues of ceremony circuits.
1396
1419
  * @dev this cloud function is triggered whenever an update of a document related to a participant of a ceremony occurs.
@@ -1411,7 +1434,7 @@ const waitForVMCommandExecution = (resolve, reject, ssm, vmInstanceId, commandId
1411
1434
  * - Just completed a contribution or all contributions for each circuit. If yes, coordinate (multi-participant scenario).
1412
1435
  */
1413
1436
  const coordinateCeremonyParticipant = functionsV1
1414
- .region('europe-west1')
1437
+ .region("europe-west1")
1415
1438
  .runWith({
1416
1439
  memory: "512MB"
1417
1440
  })
@@ -1514,7 +1537,7 @@ const checkIfVMRunning = async (ec2, vmInstanceId, attempts = 5) => {
1514
1537
  * 1.A.4.C.1) If true, update circuit waiting for queue and average timings accordingly to contribution verification results;
1515
1538
  * 2) Send all updates atomically to the Firestore database.
1516
1539
  */
1517
- const verifycontribution = functionsV2.https.onCall({ memory: "16GiB", timeoutSeconds: 3600, region: 'europe-west1' }, async (request) => {
1540
+ const verifycontribution = functionsV2.https.onCall({ memory: "16GiB", timeoutSeconds: 3600, region: "europe-west1" }, async (request) => {
1518
1541
  if (!request.auth || (!request.auth.token.participant && !request.auth.token.coordinator))
1519
1542
  logAndThrowError(SPECIFIC_ERRORS.SE_AUTH_NO_CURRENT_AUTH_USER);
1520
1543
  if (!request.data.ceremonyId ||
@@ -1686,8 +1709,17 @@ const verifycontribution = functionsV2.https.onCall({ memory: "16GiB", timeoutSe
1686
1709
  });
1687
1710
  }
1688
1711
  // Stop VM instance
1689
- if (isUsingVM)
1690
- await stopEC2Instance(ec2, vmInstanceId);
1712
+ if (isUsingVM) {
1713
+ // using try and catch as the VM stopping function can throw
1714
+ // however we want to continue without stopping as the
1715
+ // verification was valid, and inform the coordinator
1716
+ try {
1717
+ await stopEC2Instance(ec2, vmInstanceId);
1718
+ }
1719
+ catch (error) {
1720
+ printLog(`Error while stopping VM instance ${vmInstanceId} - Error ${error}`, LogLevel.WARN);
1721
+ }
1722
+ }
1691
1723
  // Step (1.A.4.C)
1692
1724
  if (!isFinalizing) {
1693
1725
  // Step (1.A.4.C.1)
@@ -1702,7 +1734,7 @@ const verifycontribution = functionsV2.https.onCall({ memory: "16GiB", timeoutSe
1702
1734
  const newAvgVerifyCloudFunctionTime = avgVerifyCloudFunctionTime > 0
1703
1735
  ? (avgVerifyCloudFunctionTime + verifyCloudFunctionTime) / 2
1704
1736
  : verifyCloudFunctionTime;
1705
- // Prepare tx to update circuit average contribution/verification time.
1737
+ // Prepare tx to update circuit average contribution/verification time.
1706
1738
  const updatedCircuitDoc = await getDocumentById(getCircuitsCollectionPath(ceremonyId), circuitId);
1707
1739
  const { waitingQueue: updatedWaitingQueue } = updatedCircuitDoc.data();
1708
1740
  /// @dev this must happen only for valid contributions.
@@ -1752,7 +1784,7 @@ const verifycontribution = functionsV2.https.onCall({ memory: "16GiB", timeoutSe
1752
1784
  commandId = await runCommandUsingSSM(ssm, vmInstanceId, verificationCommand);
1753
1785
  printLog(`Starting the execution of command ${commandId}`, LogLevel.DEBUG);
1754
1786
  // Step (1.A.3.3).
1755
- return new Promise((resolve, reject) => waitForVMCommandExecution(resolve, reject, ssm, vmInstanceId, commandId))
1787
+ return waitForVMCommandExecution(ssm, vmInstanceId, commandId)
1756
1788
  .then(async () => {
1757
1789
  // Command execution successfully completed.
1758
1790
  printLog(`Command ${commandId} execution has been successfully completed`, LogLevel.DEBUG);
@@ -1764,40 +1796,38 @@ const verifycontribution = functionsV2.https.onCall({ memory: "16GiB", timeoutSe
1764
1796
  logAndThrowError(COMMON_ERRORS.CM_INVALID_COMMAND_EXECUTION);
1765
1797
  });
1766
1798
  }
1767
- else {
1768
- // CF approach.
1769
- printLog(`CF mechanism`, LogLevel.DEBUG);
1770
- const potStoragePath = getPotStorageFilePath(files.potFilename);
1771
- const firstZkeyStoragePath = getZkeyStorageFilePath(prefix, `${prefix}_${genesisZkeyIndex}.zkey`);
1772
- // Prepare temporary file paths.
1773
- // (nb. these are needed to download the necessary artifacts for verification from AWS S3).
1774
- verificationTranscriptTemporaryLocalPath = createTemporaryLocalPath(verificationTranscriptCompleteFilename);
1775
- const potTempFilePath = createTemporaryLocalPath(`${circuitId}_${participantDoc.id}.pot`);
1776
- const firstZkeyTempFilePath = createTemporaryLocalPath(`${circuitId}_${participantDoc.id}_genesis.zkey`);
1777
- const lastZkeyTempFilePath = createTemporaryLocalPath(`${circuitId}_${participantDoc.id}_last.zkey`);
1778
- // Create and populate transcript.
1779
- const transcriptLogger = createCustomLoggerForFile(verificationTranscriptTemporaryLocalPath);
1780
- transcriptLogger.info(`${isFinalizing ? `Final verification` : `Verification`} transcript for ${prefix} circuit Phase 2 contribution.\n${isFinalizing ? `Coordinator ` : `Contributor # ${Number(lastZkeyIndex)}`} (${contributorOrCoordinatorIdentifier})\n`);
1781
- // Step (1.A.2).
1782
- await downloadArtifactFromS3Bucket(bucketName, potStoragePath, potTempFilePath);
1783
- await downloadArtifactFromS3Bucket(bucketName, firstZkeyStoragePath, firstZkeyTempFilePath);
1784
- await downloadArtifactFromS3Bucket(bucketName, lastZkeyStoragePath, lastZkeyTempFilePath);
1785
- // Step (1.A.4).
1786
- isContributionValid = await zKey.verifyFromInit(firstZkeyTempFilePath, potTempFilePath, lastZkeyTempFilePath, transcriptLogger);
1787
- // Compute contribution hash.
1788
- lastZkeyBlake2bHash = await blake512FromPath(lastZkeyTempFilePath);
1789
- // Free resources by unlinking temporary folders.
1790
- // Do not free-up verification transcript path here.
1791
- try {
1792
- fs.unlinkSync(potTempFilePath);
1793
- fs.unlinkSync(firstZkeyTempFilePath);
1794
- fs.unlinkSync(lastZkeyTempFilePath);
1795
- }
1796
- catch (error) {
1797
- printLog(`Error while unlinking temporary files - Error ${error}`, LogLevel.WARN);
1798
- }
1799
- await completeVerification();
1799
+ // CF approach.
1800
+ printLog(`CF mechanism`, LogLevel.DEBUG);
1801
+ const potStoragePath = getPotStorageFilePath(files.potFilename);
1802
+ const firstZkeyStoragePath = getZkeyStorageFilePath(prefix, `${prefix}_${genesisZkeyIndex}.zkey`);
1803
+ // Prepare temporary file paths.
1804
+ // (nb. these are needed to download the necessary artifacts for verification from AWS S3).
1805
+ verificationTranscriptTemporaryLocalPath = createTemporaryLocalPath(verificationTranscriptCompleteFilename);
1806
+ const potTempFilePath = createTemporaryLocalPath(`${circuitId}_${participantDoc.id}.pot`);
1807
+ const firstZkeyTempFilePath = createTemporaryLocalPath(`${circuitId}_${participantDoc.id}_genesis.zkey`);
1808
+ const lastZkeyTempFilePath = createTemporaryLocalPath(`${circuitId}_${participantDoc.id}_last.zkey`);
1809
+ // Create and populate transcript.
1810
+ const transcriptLogger = createCustomLoggerForFile(verificationTranscriptTemporaryLocalPath);
1811
+ transcriptLogger.info(`${isFinalizing ? `Final verification` : `Verification`} transcript for ${prefix} circuit Phase 2 contribution.\n${isFinalizing ? `Coordinator ` : `Contributor # ${Number(lastZkeyIndex)}`} (${contributorOrCoordinatorIdentifier})\n`);
1812
+ // Step (1.A.2).
1813
+ await downloadArtifactFromS3Bucket(bucketName, potStoragePath, potTempFilePath);
1814
+ await downloadArtifactFromS3Bucket(bucketName, firstZkeyStoragePath, firstZkeyTempFilePath);
1815
+ await downloadArtifactFromS3Bucket(bucketName, lastZkeyStoragePath, lastZkeyTempFilePath);
1816
+ // Step (1.A.4).
1817
+ isContributionValid = await zKey.verifyFromInit(firstZkeyTempFilePath, potTempFilePath, lastZkeyTempFilePath, transcriptLogger);
1818
+ // Compute contribution hash.
1819
+ lastZkeyBlake2bHash = await blake512FromPath(lastZkeyTempFilePath);
1820
+ // Free resources by unlinking temporary folders.
1821
+ // Do not free-up verification transcript path here.
1822
+ try {
1823
+ fs.unlinkSync(potTempFilePath);
1824
+ fs.unlinkSync(firstZkeyTempFilePath);
1825
+ fs.unlinkSync(lastZkeyTempFilePath);
1800
1826
  }
1827
+ catch (error) {
1828
+ printLog(`Error while unlinking temporary files - Error ${error}`, LogLevel.WARN);
1829
+ }
1830
+ await completeVerification();
1801
1831
  }
1802
1832
  });
1803
1833
  /**
@@ -1806,7 +1836,7 @@ const verifycontribution = functionsV2.https.onCall({ memory: "16GiB", timeoutSe
1806
1836
  * this does not happen if the participant is actually the coordinator who is finalizing the ceremony.
1807
1837
  */
1808
1838
  const refreshParticipantAfterContributionVerification = functionsV1
1809
- .region('europe-west1')
1839
+ .region("europe-west1")
1810
1840
  .runWith({
1811
1841
  memory: "512MB"
1812
1842
  })
@@ -1867,7 +1897,7 @@ const refreshParticipantAfterContributionVerification = functionsV1
1867
1897
  * and verification key extracted from the circuit final contribution (as part of the ceremony finalization process).
1868
1898
  */
1869
1899
  const finalizeCircuit = functionsV1
1870
- .region('europe-west1')
1900
+ .region("europe-west1")
1871
1901
  .runWith({
1872
1902
  memory: "512MB"
1873
1903
  })
@@ -2064,8 +2094,10 @@ const createBucket = functions
2064
2094
  CORSConfiguration: {
2065
2095
  CORSRules: [
2066
2096
  {
2067
- AllowedMethods: ["GET"],
2068
- AllowedOrigins: ["*"]
2097
+ AllowedMethods: ["GET", "PUT"],
2098
+ AllowedOrigins: ["*"],
2099
+ ExposeHeaders: ["ETag", "Content-Length"],
2100
+ AllowedHeaders: ["*"]
2069
2101
  }
2070
2102
  ]
2071
2103
  }
@@ -2242,7 +2274,8 @@ const startMultiPartUpload = functions
2242
2274
  const generatePreSignedUrlsParts = functions
2243
2275
  .region("europe-west1")
2244
2276
  .runWith({
2245
- memory: "512MB"
2277
+ memory: "512MB",
2278
+ timeoutSeconds: 300
2246
2279
  })
2247
2280
  .https.onCall(async (data, context) => {
2248
2281
  if (!context.auth || (!context.auth.token.participant && !context.auth.token.coordinator))
@@ -1 +1 @@
1
- {"version":3,"file":"ceremony.d.ts","sourceRoot":"","sources":["../../../src/functions/ceremony.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAuC/C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,kCAiBpB,CAAA;AAEN;;;;;GAKG;AACH,eAAO,MAAM,YAAY,kCAkBnB,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,aAAa,mDA0HpB,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,+BAA+B,oEAsCtC,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,mDAiEvB,CAAA"}
1
+ {"version":3,"file":"ceremony.d.ts","sourceRoot":"","sources":["../../../src/functions/ceremony.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAuC/C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,kCAiBpB,CAAA;AAEN;;;;;GAKG;AACH,eAAO,MAAM,YAAY,kCAkBnB,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,aAAa,mDA8HpB,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,+BAA+B,oEAsCtC,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,mDAiEvB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"circuit.d.ts","sourceRoot":"","sources":["../../../src/functions/circuit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AAyCpD,OAAO,EAAuB,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAkO5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,4FAoGpC,CAAA;AA8BN;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,kBAAkB,0EA2Z9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,+CAA+C,wEA4EtD,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,eAAe,uDA8EtB,CAAA"}
1
+ {"version":3,"file":"circuit.d.ts","sourceRoot":"","sources":["../../../src/functions/circuit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AAyCpD,OAAO,EAAuB,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AA0P5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,4FAoGpC,CAAA;AAyBN;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,kBAAkB,0EA8Z9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,+CAA+C,wEA4EtD,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,eAAe,uDA8EtB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/functions/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAiI/C;;;GAGG;AACH,eAAO,MAAM,YAAY,mDAgGnB,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,kBAAkB,mDAgDzB,CAAA;AAEN;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,mDAyCpC,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,oBAAoB,mDA2D3B,CAAA;AAEN;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,mDAuElC,CAAA;AAEL;;;GAGG;AACH,eAAO,MAAM,uBAAuB,mDAgE9B,CAAA"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/functions/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAiI/C;;;GAGG;AACH,eAAO,MAAM,YAAY,mDAkGnB,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,kBAAkB,mDAgDzB,CAAA;AAEN;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,mDAyCpC,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,oBAAoB,mDA2D3B,CAAA;AAEN;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,mDAwElC,CAAA;AAEL;;;GAGG;AACH,eAAO,MAAM,uBAAuB,mDAgE9B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/functions/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAW/C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,mEAqGvB,CAAA;AACN;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,mEA+BpC,CAAA"}
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/functions/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAW/C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,mEA+GvB,CAAA;AACN;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,mEA+BpC,CAAA"}
@@ -55,6 +55,7 @@ export declare const SPECIFIC_ERRORS: {
55
55
  SE_VM_TIMEDOUT_COMMAND_EXECUTION: functions.auth.HttpsError;
56
56
  SE_VM_CANCELLED_COMMAND_EXECUTION: functions.auth.HttpsError;
57
57
  SE_VM_DELAYED_COMMAND_EXECUTION: functions.auth.HttpsError;
58
+ SE_VM_UNKNOWN_COMMAND_STATUS: functions.auth.HttpsError;
58
59
  };
59
60
  /**
60
61
  * A set of common errors.
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,cAAe,kBAAkB,WAAW,MAAM,YAAY,MAAM,KAAG,UAC9B,CAAA;AAE/D;;;;GAIG;AACH,eAAO,MAAM,QAAQ,YAAa,MAAM,YAAY,QAAQ,SAqB3D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,UAAU,UAGjD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkI3B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;CA2CzB,CAAA"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/lib/errors.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ACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtion/backend",
3
- "version": "0.0.0-8b5a17f",
3
+ "version": "0.0.0-8bb9489",
4
4
  "description": "MPC Phase 2 backend for Firebase services management",
5
5
  "repository": "git@github.com:privacy-scaling-explorations/p0tion.git",
6
6
  "homepage": "https://github.com/privacy-scaling-explorations/p0tion",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "df754397c15a7086a163688fb4d3f4e7c98ad379"
88
+ "gitHead": "183d8a9e86db61fe1c713898c0abce990a7e6004"
89
89
  }
@@ -166,7 +166,11 @@ export const setupCeremony = functions
166
166
 
167
167
  // Upload the post-startup commands script file.
168
168
  printLog(`Uploading VM post-startup commands script file ${vmBootstrapScriptFilename}`, LogLevel.DEBUG)
169
- await uploadFileToBucketNoFile(bucketName, `circuits/${circuit.name!}/${vmBootstrapScriptFilename}`, vmCommands.join("\n"))
169
+ await uploadFileToBucketNoFile(
170
+ bucketName,
171
+ `circuits/${circuit.name!}/${vmBootstrapScriptFilename}`,
172
+ vmCommands.join("\n")
173
+ )
170
174
 
171
175
  // Compute the VM disk space requirement (in GB).
172
176
  const vmDiskSize = computeDiskSizeForVM(circuit.zKeySizeInBytes!, circuit.metadata?.pot!)