@devtion/actions 0.0.0-9843891 → 0.0.0-9d46256

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.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module @p0tion/actions
3
- * @version 1.2.0
3
+ * @version 1.2.8
4
4
  * @file A set of actions and helpers for CLI commands
5
5
  * @copyright Ethereum Foundation 2022
6
6
  * @license MIT
@@ -26,9 +26,9 @@ import { EC2Client, RunInstancesCommand, DescribeInstanceStatusCommand, StartIns
26
26
  import { SSMClient, SendCommandCommand, GetCommandInvocationCommand } from '@aws-sdk/client-ssm';
27
27
  import dotenv from 'dotenv';
28
28
 
29
- // Main part for the Hermez Phase 1 Trusted Setup URLs to download PoT files.
29
+ // Main part for the PPoT Phase 1 Trusted Setup URLs to download PoT files.
30
30
  const potFileDownloadMainUrl = `https://pse-trusted-setup-ppot.s3.eu-central-1.amazonaws.com/pot28_0080/`;
31
- // Main part for the Hermez Phase 1 Trusted Setup PoT files to be downloaded.
31
+ // Main part for the PPoT Phase 1 Trusted Setup PoT files to be downloaded.
32
32
  const potFilenameTemplate = `ppot_0080_`;
33
33
  // The genesis zKey index.
34
34
  const genesisZkeyIndex = `00000`;
@@ -46,6 +46,8 @@ const verifierSmartContractAcronym = "verifier";
46
46
  const ec2InstanceTag = "p0tionec2instance";
47
47
  // The name of the VM startup script file.
48
48
  const vmBootstrapScriptFilename = "bootstrap.sh";
49
+ // Match hash output by snarkjs in transcript log
50
+ const contribHashRegex = /Contribution.+Hash.+\s+.+\s+.+\s+.+\s+.+\s*/;
49
51
  /**
50
52
  * Define the supported VM configuration types.
51
53
  * @dev the VM configurations can be retrieved at https://aws.amazon.com/ec2/instance-types/
@@ -1499,20 +1501,38 @@ const parseCeremonyFile = async (path, cleanup = false) => {
1499
1501
  const localWasmPath = `./${circuitData.name}.wasm`;
1500
1502
  // download the r1cs to extract the metadata
1501
1503
  const streamPipeline = promisify(pipeline);
1502
- // Make the call.
1503
- const responseR1CS = await fetch(artifacts.r1csStoragePath);
1504
- // Handle errors.
1505
- if (!responseR1CS.ok && responseR1CS.status !== 200)
1506
- throw new Error(`There was an error while trying to download the r1cs file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`);
1507
- await streamPipeline(responseR1CS.body, createWriteStream(localR1csPath));
1508
- // Write the file locally
1504
+ // Check if r1cs file already exists
1505
+ let r1csExists = false;
1506
+ if (fs.existsSync(localR1csPath)) {
1507
+ console.log(`Found existing r1cs file for circuit ${circuitData.name}. Skipping download.`);
1508
+ r1csExists = true;
1509
+ }
1510
+ if (!r1csExists) {
1511
+ // Make the call to download r1cs.
1512
+ const responseR1CS = await fetch(artifacts.r1csStoragePath);
1513
+ // Handle errors.
1514
+ if (!responseR1CS.ok && responseR1CS.status !== 200)
1515
+ throw new Error(`There was an error while trying to download the r1cs file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`);
1516
+ // Write the file locally
1517
+ await streamPipeline(responseR1CS.body, createWriteStream(localR1csPath));
1518
+ console.log(`Downloaded r1cs file for circuit ${circuitData.name}.`);
1519
+ }
1509
1520
  // extract the metadata from the r1cs
1510
1521
  const metadata = getR1CSInfo(localR1csPath);
1511
- // download wasm too to ensure it's available
1512
- const responseWASM = await fetch(artifacts.wasmStoragePath);
1513
- if (!responseWASM.ok && responseWASM.status !== 200)
1514
- throw new Error(`There was an error while trying to download the WASM file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`);
1515
- await streamPipeline(responseWASM.body, createWriteStream(localWasmPath));
1522
+ // Check if wasm file already exists
1523
+ let wasmExists = false;
1524
+ if (fs.existsSync(localWasmPath)) {
1525
+ console.log(`Found existing wasm file for circuit ${circuitData.name}. Skipping download.`);
1526
+ wasmExists = true;
1527
+ }
1528
+ if (!wasmExists) {
1529
+ // download wasm if it's not available
1530
+ const responseWASM = await fetch(artifacts.wasmStoragePath);
1531
+ if (!responseWASM.ok && responseWASM.status !== 200)
1532
+ throw new Error(`There was an error while trying to download the WASM file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`);
1533
+ await streamPipeline(responseWASM.body, createWriteStream(localWasmPath));
1534
+ console.log(`Downloaded wasm file for circuit ${circuitData.name}.`);
1535
+ }
1516
1536
  // validate that the circuit hash and template links are valid
1517
1537
  const { template } = circuitData;
1518
1538
  const URLMatch = template.source.match(urlPattern);
@@ -2440,6 +2460,7 @@ const createEC2Instance = async (ec2, commands, instanceType, volumeSize, diskTy
2440
2460
  // Get the AWS variables.
2441
2461
  const { amiId, instanceProfileArn } = getAWSVariables();
2442
2462
  // Parametrize the VM EC2 instance.
2463
+ console.log("\nLAUNCHING AWS EC2 INSTANCE\n");
2443
2464
  const params = {
2444
2465
  ImageId: amiId,
2445
2466
  InstanceType: instanceType,
@@ -2473,6 +2494,19 @@ const createEC2Instance = async (ec2, commands, instanceType, volumeSize, diskTy
2473
2494
  {
2474
2495
  Key: "Initialized",
2475
2496
  Value: "false"
2497
+ },
2498
+ {
2499
+ Key: "Project",
2500
+ Value: "trusted-setup"
2501
+ }
2502
+ ]
2503
+ },
2504
+ {
2505
+ ResourceType: "volume",
2506
+ Tags: [
2507
+ {
2508
+ Key: "Project",
2509
+ Value: "trusted-setup"
2476
2510
  }
2477
2511
  ]
2478
2512
  }
@@ -2642,4 +2676,4 @@ const retrieveCommandStatus = async (ssm, instanceId, commandId) => {
2642
2676
  }
2643
2677
  };
2644
2678
 
2645
- export { CeremonyState, CeremonyTimeoutType, CeremonyType, CircuitContributionVerificationMechanism, DiskTypeForVM, ParticipantContributionStep, ParticipantStatus, RequestType, TestingEnvironment, TimeoutType, autoGenerateEntropy, blake512FromPath, checkAndPrepareCoordinatorForFinalization, checkIfObjectExist, checkIfRunning, checkParticipantForCeremony, commonTerms, compareCeremonyArtifacts, compareHashes, compileContract, completeMultiPartUpload, computeDiskSizeForVM, computeSHA256ToHex, computeSmallestPowersOfTauForCircuit, convertBytesOrKbToGb, convertToDoubleDigits, createCustomLoggerForFile, createEC2Client, createEC2Instance, createS3Bucket, createSSMClient, downloadAllCeremonyArtifacts, downloadCeremonyArtifact, ec2InstanceTag, exportVerifierAndVKey, exportVerifierContract, exportVkey, extractPoTFromFilename, extractPrefix, extractR1CSInfoValueForGivenKey, finalContributionIndex, finalizeCeremony, finalizeCircuit, formatSolidityCalldata, formatZkeyIndex, fromQueryToFirebaseDocumentInfo, generateGROTH16Proof, generateGetObjectPreSignedUrl, generatePreSignedUrlsParts, generateValidContributionsAttestation, generateZkeyFromScratch, genesisZkeyIndex, getAllCeremonies, getAllCollectionDocs, getBucketName, getCeremonyCircuits, getCircuitBySequencePosition, getCircuitContributionsFromContributor, getCircuitsCollectionPath, getClosedCeremonies, getContributionsCollectionPath, getContributionsValidityForContributor, getCurrentActiveParticipantTimeout, getCurrentFirebaseAuthUser, getDocumentById, getOpenedCeremonies, getParticipantsCollectionPath, getPotStorageFilePath, getPublicAttestationPreambleForContributor, getR1CSInfo, getR1csStorageFilePath, getTimeoutsCollectionPath, getTranscriptStorageFilePath, getVerificationKeyStorageFilePath, getVerifierContractStorageFilePath, getWasmStorageFilePath, getZkeyStorageFilePath, githubReputation, initializeFirebaseCoreServices, isCoordinator, multiPartUpload, numExpIterations, p256, parseCeremonyFile, permanentlyStoreCurrentContributionTimeAndHash, potFileDownloadMainUrl, potFilenameTemplate, powersOfTauFiles, progressToNextCircuitForContribution, progressToNextContributionStep, queryCollection, resumeContributionAfterTimeoutExpiration, retrieveCommandOutput, retrieveCommandStatus, runCommandUsingSSM, setupCeremony, signInToFirebaseWithCredentials, solidityVersion, startEC2Instance, stopEC2Instance, temporaryStoreCurrentContributionMultiPartUploadId, temporaryStoreCurrentContributionUploadedChunkData, terminateEC2Instance, toHex, verificationKeyAcronym, verifierSmartContractAcronym, verifyCeremony, verifyContribution, verifyGROTH16Proof, verifyGROTH16ProofOnChain, verifyZKey, vmBootstrapCommand, vmBootstrapScriptFilename, vmConfigurationTypes, vmContributionVerificationCommand, vmDependenciesAndCacheArtifactsCommand };
2679
+ export { CeremonyState, CeremonyTimeoutType, CeremonyType, CircuitContributionVerificationMechanism, DiskTypeForVM, ParticipantContributionStep, ParticipantStatus, RequestType, TestingEnvironment, TimeoutType, autoGenerateEntropy, blake512FromPath, checkAndPrepareCoordinatorForFinalization, checkIfObjectExist, checkIfRunning, checkParticipantForCeremony, commonTerms, compareCeremonyArtifacts, compareHashes, compileContract, completeMultiPartUpload, computeDiskSizeForVM, computeSHA256ToHex, computeSmallestPowersOfTauForCircuit, contribHashRegex, convertBytesOrKbToGb, convertToDoubleDigits, createCustomLoggerForFile, createEC2Client, createEC2Instance, createS3Bucket, createSSMClient, downloadAllCeremonyArtifacts, downloadCeremonyArtifact, ec2InstanceTag, exportVerifierAndVKey, exportVerifierContract, exportVkey, extractPoTFromFilename, extractPrefix, extractR1CSInfoValueForGivenKey, finalContributionIndex, finalizeCeremony, finalizeCircuit, formatSolidityCalldata, formatZkeyIndex, fromQueryToFirebaseDocumentInfo, generateGROTH16Proof, generateGetObjectPreSignedUrl, generatePreSignedUrlsParts, generateValidContributionsAttestation, generateZkeyFromScratch, genesisZkeyIndex, getAllCeremonies, getAllCollectionDocs, getBucketName, getCeremonyCircuits, getCircuitBySequencePosition, getCircuitContributionsFromContributor, getCircuitsCollectionPath, getClosedCeremonies, getContributionsCollectionPath, getContributionsValidityForContributor, getCurrentActiveParticipantTimeout, getCurrentFirebaseAuthUser, getDocumentById, getOpenedCeremonies, getParticipantsCollectionPath, getPotStorageFilePath, getPublicAttestationPreambleForContributor, getR1CSInfo, getR1csStorageFilePath, getTimeoutsCollectionPath, getTranscriptStorageFilePath, getVerificationKeyStorageFilePath, getVerifierContractStorageFilePath, getWasmStorageFilePath, getZkeyStorageFilePath, githubReputation, initializeFirebaseCoreServices, isCoordinator, multiPartUpload, numExpIterations, p256, parseCeremonyFile, permanentlyStoreCurrentContributionTimeAndHash, potFileDownloadMainUrl, potFilenameTemplate, powersOfTauFiles, progressToNextCircuitForContribution, progressToNextContributionStep, queryCollection, resumeContributionAfterTimeoutExpiration, retrieveCommandOutput, retrieveCommandStatus, runCommandUsingSSM, setupCeremony, signInToFirebaseWithCredentials, solidityVersion, startEC2Instance, stopEC2Instance, temporaryStoreCurrentContributionMultiPartUploadId, temporaryStoreCurrentContributionUploadedChunkData, terminateEC2Instance, toHex, verificationKeyAcronym, verifierSmartContractAcronym, verifyCeremony, verifyContribution, verifyGROTH16Proof, verifyGROTH16ProofOnChain, verifyZKey, vmBootstrapCommand, vmBootstrapScriptFilename, vmConfigurationTypes, vmContributionVerificationCommand, vmDependenciesAndCacheArtifactsCommand };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module @devtion/actions
3
- * @version 1.2.0
3
+ * @version 1.2.8
4
4
  * @file A set of actions and helpers for CLI commands
5
5
  * @copyright Ethereum Foundation 2022
6
6
  * @license MIT
@@ -28,9 +28,9 @@ var clientEc2 = require('@aws-sdk/client-ec2');
28
28
  var clientSsm = require('@aws-sdk/client-ssm');
29
29
  var dotenv = require('dotenv');
30
30
 
31
- // Main part for the Hermez Phase 1 Trusted Setup URLs to download PoT files.
31
+ // Main part for the PPoT Phase 1 Trusted Setup URLs to download PoT files.
32
32
  const potFileDownloadMainUrl = `https://pse-trusted-setup-ppot.s3.eu-central-1.amazonaws.com/pot28_0080/`;
33
- // Main part for the Hermez Phase 1 Trusted Setup PoT files to be downloaded.
33
+ // Main part for the PPoT Phase 1 Trusted Setup PoT files to be downloaded.
34
34
  const potFilenameTemplate = `ppot_0080_`;
35
35
  // The genesis zKey index.
36
36
  const genesisZkeyIndex = `00000`;
@@ -48,6 +48,8 @@ const verifierSmartContractAcronym = "verifier";
48
48
  const ec2InstanceTag = "p0tionec2instance";
49
49
  // The name of the VM startup script file.
50
50
  const vmBootstrapScriptFilename = "bootstrap.sh";
51
+ // Match hash output by snarkjs in transcript log
52
+ const contribHashRegex = /Contribution.+Hash.+\s+.+\s+.+\s+.+\s+.+\s*/;
51
53
  /**
52
54
  * Define the supported VM configuration types.
53
55
  * @dev the VM configurations can be retrieved at https://aws.amazon.com/ec2/instance-types/
@@ -1501,20 +1503,38 @@ const parseCeremonyFile = async (path, cleanup = false) => {
1501
1503
  const localWasmPath = `./${circuitData.name}.wasm`;
1502
1504
  // download the r1cs to extract the metadata
1503
1505
  const streamPipeline = util.promisify(stream.pipeline);
1504
- // Make the call.
1505
- const responseR1CS = await fetch(artifacts.r1csStoragePath);
1506
- // Handle errors.
1507
- if (!responseR1CS.ok && responseR1CS.status !== 200)
1508
- throw new Error(`There was an error while trying to download the r1cs file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`);
1509
- await streamPipeline(responseR1CS.body, fs.createWriteStream(localR1csPath));
1510
- // Write the file locally
1506
+ // Check if r1cs file already exists
1507
+ let r1csExists = false;
1508
+ if (fs.existsSync(localR1csPath)) {
1509
+ console.log(`Found existing r1cs file for circuit ${circuitData.name}. Skipping download.`);
1510
+ r1csExists = true;
1511
+ }
1512
+ if (!r1csExists) {
1513
+ // Make the call to download r1cs.
1514
+ const responseR1CS = await fetch(artifacts.r1csStoragePath);
1515
+ // Handle errors.
1516
+ if (!responseR1CS.ok && responseR1CS.status !== 200)
1517
+ throw new Error(`There was an error while trying to download the r1cs file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`);
1518
+ // Write the file locally
1519
+ await streamPipeline(responseR1CS.body, fs.createWriteStream(localR1csPath));
1520
+ console.log(`Downloaded r1cs file for circuit ${circuitData.name}.`);
1521
+ }
1511
1522
  // extract the metadata from the r1cs
1512
1523
  const metadata = getR1CSInfo(localR1csPath);
1513
- // download wasm too to ensure it's available
1514
- const responseWASM = await fetch(artifacts.wasmStoragePath);
1515
- if (!responseWASM.ok && responseWASM.status !== 200)
1516
- throw new Error(`There was an error while trying to download the WASM file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`);
1517
- await streamPipeline(responseWASM.body, fs.createWriteStream(localWasmPath));
1524
+ // Check if wasm file already exists
1525
+ let wasmExists = false;
1526
+ if (fs.existsSync(localWasmPath)) {
1527
+ console.log(`Found existing wasm file for circuit ${circuitData.name}. Skipping download.`);
1528
+ wasmExists = true;
1529
+ }
1530
+ if (!wasmExists) {
1531
+ // download wasm if it's not available
1532
+ const responseWASM = await fetch(artifacts.wasmStoragePath);
1533
+ if (!responseWASM.ok && responseWASM.status !== 200)
1534
+ throw new Error(`There was an error while trying to download the WASM file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`);
1535
+ await streamPipeline(responseWASM.body, fs.createWriteStream(localWasmPath));
1536
+ console.log(`Downloaded wasm file for circuit ${circuitData.name}.`);
1537
+ }
1518
1538
  // validate that the circuit hash and template links are valid
1519
1539
  const { template } = circuitData;
1520
1540
  const URLMatch = template.source.match(urlPattern);
@@ -2442,6 +2462,7 @@ const createEC2Instance = async (ec2, commands, instanceType, volumeSize, diskTy
2442
2462
  // Get the AWS variables.
2443
2463
  const { amiId, instanceProfileArn } = getAWSVariables();
2444
2464
  // Parametrize the VM EC2 instance.
2465
+ console.log("\nLAUNCHING AWS EC2 INSTANCE\n");
2445
2466
  const params = {
2446
2467
  ImageId: amiId,
2447
2468
  InstanceType: instanceType,
@@ -2475,6 +2496,19 @@ const createEC2Instance = async (ec2, commands, instanceType, volumeSize, diskTy
2475
2496
  {
2476
2497
  Key: "Initialized",
2477
2498
  Value: "false"
2499
+ },
2500
+ {
2501
+ Key: "Project",
2502
+ Value: "trusted-setup"
2503
+ }
2504
+ ]
2505
+ },
2506
+ {
2507
+ ResourceType: "volume",
2508
+ Tags: [
2509
+ {
2510
+ Key: "Project",
2511
+ Value: "trusted-setup"
2478
2512
  }
2479
2513
  ]
2480
2514
  }
@@ -2658,6 +2692,7 @@ exports.completeMultiPartUpload = completeMultiPartUpload;
2658
2692
  exports.computeDiskSizeForVM = computeDiskSizeForVM;
2659
2693
  exports.computeSHA256ToHex = computeSHA256ToHex;
2660
2694
  exports.computeSmallestPowersOfTauForCircuit = computeSmallestPowersOfTauForCircuit;
2695
+ exports.contribHashRegex = contribHashRegex;
2661
2696
  exports.convertBytesOrKbToGb = convertBytesOrKbToGb;
2662
2697
  exports.convertToDoubleDigits = convertToDoubleDigits;
2663
2698
  exports.createCustomLoggerForFile = createCustomLoggerForFile;
@@ -8,6 +8,7 @@ export declare const verificationKeyAcronym = "vkey";
8
8
  export declare const verifierSmartContractAcronym = "verifier";
9
9
  export declare const ec2InstanceTag = "p0tionec2instance";
10
10
  export declare const vmBootstrapScriptFilename = "bootstrap.sh";
11
+ export declare const contribHashRegex: RegExp;
11
12
  /**
12
13
  * Define the supported VM configuration types.
13
14
  * @dev the VM configurations can be retrieved at https://aws.amazon.com/ec2/instance-types/
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/helpers/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,sBAAsB,6EAA6E,CAAA;AAEhH,eAAO,MAAM,mBAAmB,eAAe,CAAA;AAE/C,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,eAAe,UAAU,CAAA;AAEtC,eAAO,MAAM,sBAAsB,UAAU,CAAA;AAE7C,eAAO,MAAM,sBAAsB,SAAS,CAAA;AAE5C,eAAO,MAAM,4BAA4B,aAAa,CAAA;AAEtD,eAAO,MAAM,cAAc,sBAAsB,CAAA;AAEjD,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ChC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;GAiH5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+HvB,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/helpers/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,sBAAsB,6EAA6E,CAAA;AAEhH,eAAO,MAAM,mBAAmB,eAAe,CAAA;AAE/C,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,eAAe,UAAU,CAAA;AAEtC,eAAO,MAAM,sBAAsB,UAAU,CAAA;AAE7C,eAAO,MAAM,sBAAsB,SAAS,CAAA;AAE5C,eAAO,MAAM,4BAA4B,aAAa,CAAA;AAEtD,eAAO,MAAM,cAAc,sBAAsB,CAAA;AAEjD,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAEvD,eAAO,MAAM,gBAAgB,QAAgD,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ChC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;GAiH5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+HvB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/helpers/utils.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAW,EAAE,YAAY,EAAqB,MAAM,IAAI,CAAA;AACxD,OAAO,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIzC,OAAO,EACH,eAAe,EACf,YAAY,EAGZ,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MAAM,YACL,MAAM,UACR,MAAM,KACf,MAAM,MAAM,CAyBd,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,eAC9B,MAAM,uBACG,MAAM,gDACmB,MAAM,KACrD,MAAM,MAAM,CAOd,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,oBAAqB,MAAM,OAAO,MAAM,KAAG,MACuB,CAAA;AAEnG;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,QACrB,SAAS,YACJ,MAAM,EAAE,gBACJ,MAAM,cACR,MAAM,YACR,aAAa,KACxB,QAAQ,WAAW,CA8ErB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,cAAqB,SAAS,cAAc,MAAM,KAAG,QAAQ,OAAO,CAe9F,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,QAAe,SAAS,cAAc,MAAM,kBAYxE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAe,SAAS,cAAc,MAAM,kBAYvE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAe,SAAS,cAAc,MAAM,kBAc5E,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,QACtB,SAAS,cACF,MAAM,YACR,MAAM,MAAM,CAAC,KACxB,QAAQ,MAAM,CAwBhB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,QAAe,SAAS,cAAc,MAAM,aAAa,MAAM,KAAG,QAAQ,MAAM,CAiBjH,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,QAAe,SAAS,cAAc,MAAM,aAAa,MAAM,KAAG,QAAQ,MAAM,CAgBjH,CAAA"}
@@ -3,7 +3,7 @@ export { queryCollection, fromQueryToFirebaseDocumentInfo, getAllCollectionDocs,
3
3
  export { compareCeremonyArtifacts, downloadAllCeremonyArtifacts, exportVerifierAndVKey, exportVerifierContract, exportVkey, generateGROTH16Proof, generateZkeyFromScratch, verifyGROTH16Proof, verifyZKey } from "./helpers/verification";
4
4
  export { initializeFirebaseCoreServices } from "./helpers/services";
5
5
  export { signInToFirebaseWithCredentials, getCurrentFirebaseAuthUser, isCoordinator } from "./helpers/authentication";
6
- export { commonTerms, potFileDownloadMainUrl, potFilenameTemplate, genesisZkeyIndex, numExpIterations, solidityVersion, finalContributionIndex, verificationKeyAcronym, verifierSmartContractAcronym, ec2InstanceTag, vmConfigurationTypes, vmBootstrapScriptFilename, powersOfTauFiles } from "./helpers/constants";
6
+ export { commonTerms, potFileDownloadMainUrl, potFilenameTemplate, genesisZkeyIndex, numExpIterations, solidityVersion, finalContributionIndex, verificationKeyAcronym, verifierSmartContractAcronym, ec2InstanceTag, vmConfigurationTypes, vmBootstrapScriptFilename, powersOfTauFiles, contribHashRegex } from "./helpers/constants";
7
7
  export { extractPrefix, extractPoTFromFilename, extractR1CSInfoValueForGivenKey, formatZkeyIndex, autoGenerateEntropy, getCircuitBySequencePosition, convertBytesOrKbToGb, getPublicAttestationPreambleForContributor, getContributionsValidityForContributor, generateValidContributionsAttestation, createCustomLoggerForFile, getR1CSInfo, computeSmallestPowersOfTauForCircuit, convertToDoubleDigits, parseCeremonyFile } from "./helpers/utils";
8
8
  export { setupCeremony, checkParticipantForCeremony, progressToNextCircuitForContribution, resumeContributionAfterTimeoutExpiration, createS3Bucket, generateGetObjectPreSignedUrl, progressToNextContributionStep, permanentlyStoreCurrentContributionTimeAndHash, temporaryStoreCurrentContributionMultiPartUploadId, temporaryStoreCurrentContributionUploadedChunkData, generatePreSignedUrlsParts, completeMultiPartUpload, checkIfObjectExist, verifyContribution, checkAndPrepareCoordinatorForFinalization, finalizeCircuit, finalizeCeremony } from "./helpers/functions";
9
9
  export { toHex, blake512FromPath, computeSHA256ToHex, compareHashes } from "./helpers/crypto";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAA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B,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,iCAAiC,EACjC,qBAAqB,EACxB,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,wBAAwB,EACxB,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,iCAAiC,EACjC,kCAAkC,EAClC,4BAA4B,EAC5B,sBAAsB,EACzB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACH,eAAe,EACf,+BAA+B,EAC/B,oBAAoB,EACpB,sCAAsC,EACtC,eAAe,EACf,kCAAkC,EAClC,mBAAmB,EACnB,6BAA6B,EAC7B,yBAAyB,EACzB,8BAA8B,EAC9B,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACtB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACH,wBAAwB,EACxB,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,UAAU,EACV,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,UAAU,EACb,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,+BAA+B,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACrH,OAAO,EACH,WAAW,EACX,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,+BAA+B,EAC/B,eAAe,EACf,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,0CAA0C,EAC1C,sCAAsC,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BAAmB,EACnB,YAAY,EACf,MAAM,eAAe,CAAA;AACtB,OAAO,EACH,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,sCAAsC,EACtC,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,iCAAiC,EACjC,qBAAqB,EACxB,MAAM,cAAc,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtion/actions",
3
- "version": "0.0.0-9843891",
3
+ "version": "0.0.0-9d46256",
4
4
  "description": "A set of actions and helpers for CLI commands",
5
5
  "repository": "git@github.com:privacy-scaling-explorations/p0tion.git",
6
6
  "homepage": "https://github.com/privacy-scaling-explorations/p0tion",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "438c08492d7e96d2e935cb07aa26492beb79170a"
81
+ "gitHead": "db993436c57f04fae0ee535d013474a6f87f8271"
82
82
  }
@@ -1,6 +1,6 @@
1
- // Main part for the Hermez Phase 1 Trusted Setup URLs to download PoT files.
1
+ // Main part for the PPoT Phase 1 Trusted Setup URLs to download PoT files.
2
2
  export const potFileDownloadMainUrl = `https://pse-trusted-setup-ppot.s3.eu-central-1.amazonaws.com/pot28_0080/`
3
- // Main part for the Hermez Phase 1 Trusted Setup PoT files to be downloaded.
3
+ // Main part for the PPoT Phase 1 Trusted Setup PoT files to be downloaded.
4
4
  export const potFilenameTemplate = `ppot_0080_`
5
5
  // The genesis zKey index.
6
6
  export const genesisZkeyIndex = `00000`
@@ -18,6 +18,8 @@ export const verifierSmartContractAcronym = "verifier"
18
18
  export const ec2InstanceTag = "p0tionec2instance"
19
19
  // The name of the VM startup script file.
20
20
  export const vmBootstrapScriptFilename = "bootstrap.sh"
21
+ // Match hash output by snarkjs in transcript log
22
+ export const contribHashRegex = /Contribution.+Hash.+\s+.+\s+.+\s+.+\s+.+\s*/
21
23
 
22
24
  /**
23
25
  * Define the supported VM configuration types.
@@ -620,28 +620,48 @@ export const parseCeremonyFile = async (path: string, cleanup: boolean = false):
620
620
  // download the r1cs to extract the metadata
621
621
  const streamPipeline = promisify(pipeline)
622
622
 
623
- // Make the call.
624
- const responseR1CS = await fetch(artifacts.r1csStoragePath)
623
+ // Check if r1cs file already exists
624
+ let r1csExists = false
625
+ if (fs.existsSync(localR1csPath)) {
626
+ console.log(`Found existing r1cs file for circuit ${circuitData.name}. Skipping download.`)
627
+ r1csExists = true
628
+ }
629
+
630
+ if (!r1csExists) {
631
+ // Make the call to download r1cs.
632
+ const responseR1CS = await fetch(artifacts.r1csStoragePath)
625
633
 
626
- // Handle errors.
627
- if (!responseR1CS.ok && responseR1CS.status !== 200)
628
- throw new Error(
629
- `There was an error while trying to download the r1cs file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`
630
- )
634
+ // Handle errors.
635
+ if (!responseR1CS.ok && responseR1CS.status !== 200)
636
+ throw new Error(
637
+ `There was an error while trying to download the r1cs file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`
638
+ )
631
639
 
632
- await streamPipeline(responseR1CS.body!, createWriteStream(localR1csPath))
633
- // Write the file locally
640
+ // Write the file locally
641
+ await streamPipeline(responseR1CS.body!, createWriteStream(localR1csPath))
642
+ console.log(`Downloaded r1cs file for circuit ${circuitData.name}.`)
643
+ }
634
644
 
635
645
  // extract the metadata from the r1cs
636
646
  const metadata = getR1CSInfo(localR1csPath)
637
647
 
638
- // download wasm too to ensure it's available
639
- const responseWASM = await fetch(artifacts.wasmStoragePath)
640
- if (!responseWASM.ok && responseWASM.status !== 200)
641
- throw new Error(
642
- `There was an error while trying to download the WASM file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`
643
- )
644
- await streamPipeline(responseWASM.body!, createWriteStream(localWasmPath))
648
+ // Check if wasm file already exists
649
+ let wasmExists = false
650
+ if (fs.existsSync(localWasmPath)) {
651
+ console.log(`Found existing wasm file for circuit ${circuitData.name}. Skipping download.`)
652
+ wasmExists = true
653
+ }
654
+
655
+ if (!wasmExists) {
656
+ // download wasm if it's not available
657
+ const responseWASM = await fetch(artifacts.wasmStoragePath)
658
+ if (!responseWASM.ok && responseWASM.status !== 200)
659
+ throw new Error(
660
+ `There was an error while trying to download the WASM file for circuit ${circuitData.name}. Please check that the file has the correct permissions (public) set.`
661
+ )
662
+ await streamPipeline(responseWASM.body!, createWriteStream(localWasmPath))
663
+ console.log(`Downloaded wasm file for circuit ${circuitData.name}.`)
664
+ }
645
665
 
646
666
  // validate that the circuit hash and template links are valid
647
667
  const { template } = circuitData
package/src/helpers/vm.ts CHANGED
@@ -163,6 +163,7 @@ export const createEC2Instance = async (
163
163
  const { amiId, instanceProfileArn } = getAWSVariables()
164
164
 
165
165
  // Parametrize the VM EC2 instance.
166
+ console.log("\nLAUNCHING AWS EC2 INSTANCE\n")
166
167
  const params: RunInstancesCommandInput = {
167
168
  ImageId: amiId,
168
169
  InstanceType: instanceType as _InstanceType,
@@ -196,6 +197,19 @@ export const createEC2Instance = async (
196
197
  {
197
198
  Key: "Initialized",
198
199
  Value: "false"
200
+ },
201
+ {
202
+ Key: "Project",
203
+ Value: "trusted-setup"
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ ResourceType: "volume",
209
+ Tags: [
210
+ {
211
+ Key: "Project",
212
+ Value: "trusted-setup"
199
213
  }
200
214
  ]
201
215
  }
package/src/index.ts CHANGED
@@ -52,7 +52,8 @@ export {
52
52
  ec2InstanceTag,
53
53
  vmConfigurationTypes,
54
54
  vmBootstrapScriptFilename,
55
- powersOfTauFiles
55
+ powersOfTauFiles,
56
+ contribHashRegex
56
57
  } from "./helpers/constants"
57
58
  export {
58
59
  extractPrefix,