@maci-protocol/coordinator 0.0.0-ci.00107eb
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/CHANGELOG.md +51 -0
- package/LICENSE +21 -0
- package/README.md +103 -0
- package/build/hardhat.config.cjs +39 -0
- package/build/hardhat.config.cjs.map +1 -0
- package/build/hardhat.config.d.cts +27 -0
- package/build/hardhat.config.d.cts.map +1 -0
- package/build/scripts/generateKeypair.d.ts +2 -0
- package/build/scripts/generateKeypair.d.ts.map +1 -0
- package/build/scripts/generateKeypair.js +25 -0
- package/build/scripts/generateKeypair.js.map +1 -0
- package/build/scripts/generateMaciKeyPair.d.ts +2 -0
- package/build/scripts/generateMaciKeyPair.d.ts.map +1 -0
- package/build/scripts/generateMaciKeyPair.js +3 -0
- package/build/scripts/generateMaciKeyPair.js.map +1 -0
- package/build/scripts/getAuthHeader.d.ts +2 -0
- package/build/scripts/getAuthHeader.d.ts.map +1 -0
- package/build/scripts/getAuthHeader.js +31 -0
- package/build/scripts/getAuthHeader.js.map +1 -0
- package/build/tests/constants.d.ts +7 -0
- package/build/tests/constants.d.ts.map +1 -0
- package/build/tests/constants.js +11 -0
- package/build/tests/constants.js.map +1 -0
- package/build/tests/e2e.deploy.test.d.ts +2 -0
- package/build/tests/e2e.deploy.test.d.ts.map +1 -0
- package/build/tests/e2e.deploy.test.js +264 -0
- package/build/tests/e2e.deploy.test.js.map +1 -0
- package/build/tests/e2e.redis.test.d.ts +2 -0
- package/build/tests/e2e.redis.test.d.ts.map +1 -0
- package/build/tests/e2e.redis.test.js +118 -0
- package/build/tests/e2e.redis.test.js.map +1 -0
- package/build/tests/utils.d.ts +20 -0
- package/build/tests/utils.d.ts.map +1 -0
- package/build/tests/utils.js +55 -0
- package/build/tests/utils.js.map +1 -0
- package/build/ts/app.module.d.ts +3 -0
- package/build/ts/app.module.d.ts.map +1 -0
- package/build/ts/app.module.js +42 -0
- package/build/ts/app.module.js.map +1 -0
- package/build/ts/auth/AccountSignatureGuard.service.d.ts +44 -0
- package/build/ts/auth/AccountSignatureGuard.service.d.ts.map +1 -0
- package/build/ts/auth/AccountSignatureGuard.service.js +96 -0
- package/build/ts/auth/AccountSignatureGuard.service.js.map +1 -0
- package/build/ts/auth/__tests__/AccountSignatureGuard.test.d.ts +2 -0
- package/build/ts/auth/__tests__/AccountSignatureGuard.test.d.ts.map +1 -0
- package/build/ts/auth/__tests__/AccountSignatureGuard.test.js +113 -0
- package/build/ts/auth/__tests__/AccountSignatureGuard.test.js.map +1 -0
- package/build/ts/common/__tests__/common.test.d.ts +2 -0
- package/build/ts/common/__tests__/common.test.d.ts.map +1 -0
- package/build/ts/common/__tests__/common.test.js +77 -0
- package/build/ts/common/__tests__/common.test.js.map +1 -0
- package/build/ts/common/accountAbstraction.d.ts +38 -0
- package/build/ts/common/accountAbstraction.d.ts.map +1 -0
- package/build/ts/common/accountAbstraction.js +83 -0
- package/build/ts/common/accountAbstraction.js.map +1 -0
- package/build/ts/common/chain.d.ts +22 -0
- package/build/ts/common/chain.d.ts.map +1 -0
- package/build/ts/common/chain.js +37 -0
- package/build/ts/common/chain.js.map +1 -0
- package/build/ts/common/coordinatorKeypair.d.ts +7 -0
- package/build/ts/common/coordinatorKeypair.d.ts.map +1 -0
- package/build/ts/common/coordinatorKeypair.js +14 -0
- package/build/ts/common/coordinatorKeypair.js.map +1 -0
- package/build/ts/common/errors.d.ts +36 -0
- package/build/ts/common/errors.d.ts.map +1 -0
- package/build/ts/common/errors.js +37 -0
- package/build/ts/common/errors.js.map +1 -0
- package/build/ts/common/http.d.ts +6 -0
- package/build/ts/common/http.d.ts.map +1 -0
- package/build/ts/common/http.js +49 -0
- package/build/ts/common/http.js.map +1 -0
- package/build/ts/common/index.d.ts +6 -0
- package/build/ts/common/index.d.ts.map +1 -0
- package/build/ts/common/index.js +6 -0
- package/build/ts/common/index.js.map +1 -0
- package/build/ts/common/networks.d.ts +10 -0
- package/build/ts/common/networks.d.ts.map +1 -0
- package/build/ts/common/networks.js +61 -0
- package/build/ts/common/networks.js.map +1 -0
- package/build/ts/common/types.d.ts +8 -0
- package/build/ts/common/types.d.ts.map +1 -0
- package/build/ts/common/types.js +2 -0
- package/build/ts/common/types.js.map +1 -0
- package/build/ts/crypto/__tests__/crypto.service.test.d.ts +2 -0
- package/build/ts/crypto/__tests__/crypto.service.test.d.ts.map +1 -0
- package/build/ts/crypto/__tests__/crypto.service.test.js +26 -0
- package/build/ts/crypto/__tests__/crypto.service.test.js.map +1 -0
- package/build/ts/crypto/crypto.module.d.ts +3 -0
- package/build/ts/crypto/crypto.module.d.ts.map +1 -0
- package/build/ts/crypto/crypto.module.js +18 -0
- package/build/ts/crypto/crypto.module.js.map +1 -0
- package/build/ts/crypto/crypto.service.d.ts +31 -0
- package/build/ts/crypto/crypto.service.d.ts.map +1 -0
- package/build/ts/crypto/crypto.service.js +68 -0
- package/build/ts/crypto/crypto.service.js.map +1 -0
- package/build/ts/deployer/__tests__/deployer.controller.test.d.ts +2 -0
- package/build/ts/deployer/__tests__/deployer.controller.test.d.ts.map +1 -0
- package/build/ts/deployer/__tests__/deployer.controller.test.js +82 -0
- package/build/ts/deployer/__tests__/deployer.controller.test.js.map +1 -0
- package/build/ts/deployer/__tests__/deployer.service.test.d.ts +2 -0
- package/build/ts/deployer/__tests__/deployer.service.test.d.ts.map +1 -0
- package/build/ts/deployer/__tests__/deployer.service.test.js +272 -0
- package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -0
- package/build/ts/deployer/__tests__/utils.d.ts +61 -0
- package/build/ts/deployer/__tests__/utils.d.ts.map +1 -0
- package/build/ts/deployer/__tests__/utils.js +122 -0
- package/build/ts/deployer/__tests__/utils.js.map +1 -0
- package/build/ts/deployer/constants.d.ts +13 -0
- package/build/ts/deployer/constants.d.ts.map +1 -0
- package/build/ts/deployer/constants.js +13 -0
- package/build/ts/deployer/constants.js.map +1 -0
- package/build/ts/deployer/deployer.controller.d.ts +34 -0
- package/build/ts/deployer/deployer.controller.d.ts.map +1 -0
- package/build/ts/deployer/deployer.controller.js +102 -0
- package/build/ts/deployer/deployer.controller.js.map +1 -0
- package/build/ts/deployer/deployer.module.d.ts +3 -0
- package/build/ts/deployer/deployer.module.d.ts.map +1 -0
- package/build/ts/deployer/deployer.module.js +23 -0
- package/build/ts/deployer/deployer.module.js.map +1 -0
- package/build/ts/deployer/deployer.service.d.ts +85 -0
- package/build/ts/deployer/deployer.service.d.ts.map +1 -0
- package/build/ts/deployer/deployer.service.js +505 -0
- package/build/ts/deployer/deployer.service.js.map +1 -0
- package/build/ts/deployer/dto.d.ts +46 -0
- package/build/ts/deployer/dto.d.ts.map +1 -0
- package/build/ts/deployer/dto.js +125 -0
- package/build/ts/deployer/dto.js.map +1 -0
- package/build/ts/deployer/types.d.ts +351 -0
- package/build/ts/deployer/types.d.ts.map +1 -0
- package/build/ts/deployer/types.js +2 -0
- package/build/ts/deployer/types.js.map +1 -0
- package/build/ts/file/__tests__/file.service.test.d.ts +2 -0
- package/build/ts/file/__tests__/file.service.test.d.ts.map +1 -0
- package/build/ts/file/__tests__/file.service.test.js +77 -0
- package/build/ts/file/__tests__/file.service.test.js.map +1 -0
- package/build/ts/file/file.module.d.ts +3 -0
- package/build/ts/file/file.module.d.ts.map +1 -0
- package/build/ts/file/file.module.js +18 -0
- package/build/ts/file/file.module.js.map +1 -0
- package/build/ts/file/file.service.d.ts +63 -0
- package/build/ts/file/file.service.d.ts.map +1 -0
- package/build/ts/file/file.service.js +121 -0
- package/build/ts/file/file.service.js.map +1 -0
- package/build/ts/file/types.d.ts +36 -0
- package/build/ts/file/types.d.ts.map +1 -0
- package/build/ts/file/types.js +2 -0
- package/build/ts/file/types.js.map +1 -0
- package/build/ts/health/__tests__/health.controller.test.d.ts +2 -0
- package/build/ts/health/__tests__/health.controller.test.d.ts.map +1 -0
- package/build/ts/health/__tests__/health.controller.test.js +52 -0
- package/build/ts/health/__tests__/health.controller.test.js.map +1 -0
- package/build/ts/health/__tests__/health.service.test.d.ts +2 -0
- package/build/ts/health/__tests__/health.service.test.d.ts.map +1 -0
- package/build/ts/health/__tests__/health.service.test.js +101 -0
- package/build/ts/health/__tests__/health.service.test.js.map +1 -0
- package/build/ts/health/health.controller.d.ts +16 -0
- package/build/ts/health/health.controller.d.ts.map +1 -0
- package/build/ts/health/health.controller.js +43 -0
- package/build/ts/health/health.controller.js.map +1 -0
- package/build/ts/health/health.module.d.ts +3 -0
- package/build/ts/health/health.module.d.ts.map +1 -0
- package/build/ts/health/health.module.js +22 -0
- package/build/ts/health/health.module.js.map +1 -0
- package/build/ts/health/health.service.d.ts +42 -0
- package/build/ts/health/health.service.d.ts.map +1 -0
- package/build/ts/health/health.service.js +176 -0
- package/build/ts/health/health.service.js.map +1 -0
- package/build/ts/health/types.d.ts +87 -0
- package/build/ts/health/types.d.ts.map +1 -0
- package/build/ts/health/types.js +2 -0
- package/build/ts/health/types.js.map +1 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts +11 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts.map +1 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js +12 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js.map +1 -0
- package/build/ts/jest/setup.d.ts +8 -0
- package/build/ts/jest/setup.d.ts.map +1 -0
- package/build/ts/jest/setup.js +2 -0
- package/build/ts/jest/setup.js.map +1 -0
- package/build/ts/jest/transform.d.ts +8 -0
- package/build/ts/jest/transform.d.ts.map +1 -0
- package/build/ts/jest/transform.js +10 -0
- package/build/ts/jest/transform.js.map +1 -0
- package/build/ts/main.d.ts +2 -0
- package/build/ts/main.d.ts.map +1 -0
- package/build/ts/main.js +46 -0
- package/build/ts/main.js.map +1 -0
- package/build/ts/proof/__tests__/proof.controller.test.d.ts +2 -0
- package/build/ts/proof/__tests__/proof.controller.test.d.ts.map +1 -0
- package/build/ts/proof/__tests__/proof.controller.test.js +90 -0
- package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -0
- package/build/ts/proof/__tests__/proof.gateway.test.d.ts +2 -0
- package/build/ts/proof/__tests__/proof.gateway.test.d.ts.map +1 -0
- package/build/ts/proof/__tests__/proof.gateway.test.js +63 -0
- package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -0
- package/build/ts/proof/__tests__/proof.service.test.d.ts +2 -0
- package/build/ts/proof/__tests__/proof.service.test.d.ts.map +1 -0
- package/build/ts/proof/__tests__/proof.service.test.js +84 -0
- package/build/ts/proof/__tests__/proof.service.test.js.map +1 -0
- package/build/ts/proof/dto.d.ts +70 -0
- package/build/ts/proof/dto.d.ts.map +1 -0
- package/build/ts/proof/dto.js +261 -0
- package/build/ts/proof/dto.js.map +1 -0
- package/build/ts/proof/proof.controller.d.ts +47 -0
- package/build/ts/proof/proof.controller.d.ts.map +1 -0
- package/build/ts/proof/proof.controller.js +158 -0
- package/build/ts/proof/proof.controller.js.map +1 -0
- package/build/ts/proof/proof.gateway.d.ts +35 -0
- package/build/ts/proof/proof.gateway.d.ts.map +1 -0
- package/build/ts/proof/proof.gateway.js +93 -0
- package/build/ts/proof/proof.gateway.js.map +1 -0
- package/build/ts/proof/proof.module.d.ts +3 -0
- package/build/ts/proof/proof.module.d.ts.map +1 -0
- package/build/ts/proof/proof.module.js +25 -0
- package/build/ts/proof/proof.module.js.map +1 -0
- package/build/ts/proof/proof.service.d.ts +52 -0
- package/build/ts/proof/proof.service.d.ts.map +1 -0
- package/build/ts/proof/proof.service.js +164 -0
- package/build/ts/proof/proof.service.js.map +1 -0
- package/build/ts/proof/types.d.ts +144 -0
- package/build/ts/proof/types.d.ts.map +1 -0
- package/build/ts/proof/types.js +11 -0
- package/build/ts/proof/types.js.map +1 -0
- package/build/ts/redis/__tests__/redis.service.test.d.ts +2 -0
- package/build/ts/redis/__tests__/redis.service.test.d.ts.map +1 -0
- package/build/ts/redis/__tests__/redis.service.test.js +148 -0
- package/build/ts/redis/__tests__/redis.service.test.js.map +1 -0
- package/build/ts/redis/redis.module.d.ts +3 -0
- package/build/ts/redis/redis.module.d.ts.map +1 -0
- package/build/ts/redis/redis.module.js +18 -0
- package/build/ts/redis/redis.module.js.map +1 -0
- package/build/ts/redis/redis.service.d.ts +53 -0
- package/build/ts/redis/redis.service.d.ts.map +1 -0
- package/build/ts/redis/redis.service.js +99 -0
- package/build/ts/redis/redis.service.js.map +1 -0
- package/build/ts/redis/types.d.ts +66 -0
- package/build/ts/redis/types.d.ts.map +1 -0
- package/build/ts/redis/types.js +2 -0
- package/build/ts/redis/types.js.map +1 -0
- package/build/ts/redis/utils.d.ts +20 -0
- package/build/ts/redis/utils.d.ts.map +1 -0
- package/build/ts/redis/utils.js +27 -0
- package/build/ts/redis/utils.js.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts +2 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.js +62 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.js.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts +2 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.js +369 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.js.map +1 -0
- package/build/ts/scheduler/dto.d.ts +41 -0
- package/build/ts/scheduler/dto.d.ts.map +1 -0
- package/build/ts/scheduler/dto.js +115 -0
- package/build/ts/scheduler/dto.js.map +1 -0
- package/build/ts/scheduler/scheduler.controller.d.ts +32 -0
- package/build/ts/scheduler/scheduler.controller.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.controller.js +118 -0
- package/build/ts/scheduler/scheduler.controller.js.map +1 -0
- package/build/ts/scheduler/scheduler.module.d.ts +3 -0
- package/build/ts/scheduler/scheduler.module.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.module.js +24 -0
- package/build/ts/scheduler/scheduler.module.js.map +1 -0
- package/build/ts/scheduler/scheduler.service.d.ts +71 -0
- package/build/ts/scheduler/scheduler.service.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.service.js +297 -0
- package/build/ts/scheduler/scheduler.service.js.map +1 -0
- package/build/ts/scheduler/types.d.ts +65 -0
- package/build/ts/scheduler/types.d.ts.map +1 -0
- package/build/ts/scheduler/types.js +2 -0
- package/build/ts/scheduler/types.js.map +1 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.d.ts +2 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.d.ts.map +1 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js +44 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js.map +1 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.d.ts +2 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.d.ts.map +1 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js +76 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js.map +1 -0
- package/build/ts/sessionKeys/__tests__/utils.d.ts +25 -0
- package/build/ts/sessionKeys/__tests__/utils.d.ts.map +1 -0
- package/build/ts/sessionKeys/__tests__/utils.js +65 -0
- package/build/ts/sessionKeys/__tests__/utils.js.map +1 -0
- package/build/ts/sessionKeys/dto.d.ts +11 -0
- package/build/ts/sessionKeys/dto.d.ts.map +1 -0
- package/build/ts/sessionKeys/dto.js +29 -0
- package/build/ts/sessionKeys/dto.js.map +1 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts +53 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts.map +1 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js +105 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js.map +1 -0
- package/build/ts/sessionKeys/sessionKeys.controller.d.ts +26 -0
- package/build/ts/sessionKeys/sessionKeys.controller.d.ts.map +1 -0
- package/build/ts/sessionKeys/sessionKeys.controller.js +74 -0
- package/build/ts/sessionKeys/sessionKeys.controller.js.map +1 -0
- package/build/ts/sessionKeys/sessionKeys.module.d.ts +3 -0
- package/build/ts/sessionKeys/sessionKeys.module.d.ts.map +1 -0
- package/build/ts/sessionKeys/sessionKeys.module.js +23 -0
- package/build/ts/sessionKeys/sessionKeys.module.js.map +1 -0
- package/build/ts/sessionKeys/sessionKeys.service.d.ts +62 -0
- package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -0
- package/build/ts/sessionKeys/sessionKeys.service.js +121 -0
- package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -0
- package/build/ts/sessionKeys/types.d.ts +11 -0
- package/build/ts/sessionKeys/types.d.ts.map +1 -0
- package/build/ts/sessionKeys/types.js +2 -0
- package/build/ts/sessionKeys/types.js.map +1 -0
- package/build/ts/subgraph/__tests__/subgraph.controller.test.d.ts +2 -0
- package/build/ts/subgraph/__tests__/subgraph.controller.test.d.ts.map +1 -0
- package/build/ts/subgraph/__tests__/subgraph.controller.test.js +50 -0
- package/build/ts/subgraph/__tests__/subgraph.controller.test.js.map +1 -0
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.d.ts +2 -0
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.d.ts.map +1 -0
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.js +83 -0
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.js.map +1 -0
- package/build/ts/subgraph/__tests__/subgraph.service.test.d.ts +2 -0
- package/build/ts/subgraph/__tests__/subgraph.service.test.d.ts.map +1 -0
- package/build/ts/subgraph/__tests__/subgraph.service.test.js +58 -0
- package/build/ts/subgraph/__tests__/subgraph.service.test.js.map +1 -0
- package/build/ts/subgraph/dto.d.ts +27 -0
- package/build/ts/subgraph/dto.d.ts.map +1 -0
- package/build/ts/subgraph/dto.js +83 -0
- package/build/ts/subgraph/dto.js.map +1 -0
- package/build/ts/subgraph/subgraph.controller.d.ts +24 -0
- package/build/ts/subgraph/subgraph.controller.d.ts.map +1 -0
- package/build/ts/subgraph/subgraph.controller.js +71 -0
- package/build/ts/subgraph/subgraph.controller.js.map +1 -0
- package/build/ts/subgraph/subgraph.gateway.d.ts +35 -0
- package/build/ts/subgraph/subgraph.gateway.d.ts.map +1 -0
- package/build/ts/subgraph/subgraph.gateway.js +93 -0
- package/build/ts/subgraph/subgraph.gateway.js.map +1 -0
- package/build/ts/subgraph/subgraph.module.d.ts +3 -0
- package/build/ts/subgraph/subgraph.module.d.ts.map +1 -0
- package/build/ts/subgraph/subgraph.module.js +23 -0
- package/build/ts/subgraph/subgraph.module.js.map +1 -0
- package/build/ts/subgraph/subgraph.service.d.ts +24 -0
- package/build/ts/subgraph/subgraph.service.d.ts.map +1 -0
- package/build/ts/subgraph/subgraph.service.js +119 -0
- package/build/ts/subgraph/subgraph.service.js.map +1 -0
- package/build/ts/subgraph/types.d.ts +93 -0
- package/build/ts/subgraph/types.d.ts.map +1 -0
- package/build/ts/subgraph/types.js +24 -0
- package/build/ts/subgraph/types.js.map +1 -0
- package/build/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +131 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Server } from "socket.io";
|
|
2
|
+
import { GenerateProofDto } from "./dto";
|
|
3
|
+
import { ProofGeneratorService } from "./proof.service";
|
|
4
|
+
/**
|
|
5
|
+
* ProofGateway is responsible for websockets integration between client and ProofGeneratorService.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ProofGateway {
|
|
8
|
+
private readonly proofGeneratorService;
|
|
9
|
+
/**
|
|
10
|
+
* Logger
|
|
11
|
+
*/
|
|
12
|
+
private readonly logger;
|
|
13
|
+
/**
|
|
14
|
+
* Websocket server
|
|
15
|
+
*/
|
|
16
|
+
server: Server;
|
|
17
|
+
/**
|
|
18
|
+
* Initialize ProofGateway
|
|
19
|
+
*
|
|
20
|
+
* @param proofGeneratorService - proof generator service
|
|
21
|
+
*/
|
|
22
|
+
constructor(proofGeneratorService: ProofGeneratorService);
|
|
23
|
+
/**
|
|
24
|
+
* Generate proofs api method.
|
|
25
|
+
* Events:
|
|
26
|
+
* 1. EProofGenerationEvents.START - trigger method call
|
|
27
|
+
* 2. EProofGenerationEvents.PROGRESS - returns generated proofs with batch info
|
|
28
|
+
* 3. EProofGenerationEvents.FINISH - returns generated proofs and tally data when available
|
|
29
|
+
* 4. EProofGenerationEvents.ERROR - triggered when exception is thrown
|
|
30
|
+
*
|
|
31
|
+
* @param args - generate proof dto
|
|
32
|
+
*/
|
|
33
|
+
generate(data: GenerateProofDto): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=proof.gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof.gateway.d.ts","sourceRoot":"","sources":["../../../ts/proof/proof.gateway.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAIxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD;;GAEG;AACH,qBAMa,YAAY;IAiBX,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IAhBlD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiC;IAExD;;OAEG;IAEH,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;OAIG;gBAC0B,qBAAqB,EAAE,qBAAqB;IAEzE;;;;;;;;;OASG;IAUG,QAAQ,CAEZ,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,IAAI,CAAC;CAcjB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
var ProofGateway_1;
|
|
14
|
+
import { Logger, UseGuards, UsePipes, ValidationPipe } from "@nestjs/common";
|
|
15
|
+
import { MessageBody, SubscribeMessage, WebSocketGateway, WebSocketServer, WsException } from "@nestjs/websockets";
|
|
16
|
+
import { AccountSignatureGuard } from "../auth/AccountSignatureGuard.service";
|
|
17
|
+
import { GenerateProofDto } from "./dto";
|
|
18
|
+
import { ProofGeneratorService } from "./proof.service";
|
|
19
|
+
import { EProofGenerationEvents } from "./types";
|
|
20
|
+
/**
|
|
21
|
+
* ProofGateway is responsible for websockets integration between client and ProofGeneratorService.
|
|
22
|
+
*/
|
|
23
|
+
let ProofGateway = ProofGateway_1 = class ProofGateway {
|
|
24
|
+
proofGeneratorService;
|
|
25
|
+
/**
|
|
26
|
+
* Logger
|
|
27
|
+
*/
|
|
28
|
+
logger = new Logger(ProofGateway_1.name);
|
|
29
|
+
/**
|
|
30
|
+
* Websocket server
|
|
31
|
+
*/
|
|
32
|
+
server;
|
|
33
|
+
/**
|
|
34
|
+
* Initialize ProofGateway
|
|
35
|
+
*
|
|
36
|
+
* @param proofGeneratorService - proof generator service
|
|
37
|
+
*/
|
|
38
|
+
constructor(proofGeneratorService) {
|
|
39
|
+
this.proofGeneratorService = proofGeneratorService;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generate proofs api method.
|
|
43
|
+
* Events:
|
|
44
|
+
* 1. EProofGenerationEvents.START - trigger method call
|
|
45
|
+
* 2. EProofGenerationEvents.PROGRESS - returns generated proofs with batch info
|
|
46
|
+
* 3. EProofGenerationEvents.FINISH - returns generated proofs and tally data when available
|
|
47
|
+
* 4. EProofGenerationEvents.ERROR - triggered when exception is thrown
|
|
48
|
+
*
|
|
49
|
+
* @param args - generate proof dto
|
|
50
|
+
*/
|
|
51
|
+
async generate(data) {
|
|
52
|
+
await this.proofGeneratorService.generate(data, {
|
|
53
|
+
onBatchComplete: (result) => {
|
|
54
|
+
this.server.emit(EProofGenerationEvents.PROGRESS, result);
|
|
55
|
+
},
|
|
56
|
+
onComplete: (proofs, tallyData) => {
|
|
57
|
+
this.server.emit(EProofGenerationEvents.FINISH, { proofs, tallyData });
|
|
58
|
+
},
|
|
59
|
+
onFail: (error) => {
|
|
60
|
+
this.logger.error(`Error:`, error);
|
|
61
|
+
this.server.emit(EProofGenerationEvents.ERROR, { message: error.message });
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
__decorate([
|
|
67
|
+
WebSocketServer(),
|
|
68
|
+
__metadata("design:type", Function)
|
|
69
|
+
], ProofGateway.prototype, "server", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
SubscribeMessage(EProofGenerationEvents.START),
|
|
72
|
+
UsePipes(new ValidationPipe({
|
|
73
|
+
transform: true,
|
|
74
|
+
exceptionFactory(validationErrors) {
|
|
75
|
+
return new WsException(validationErrors);
|
|
76
|
+
},
|
|
77
|
+
})),
|
|
78
|
+
__param(0, MessageBody()),
|
|
79
|
+
__metadata("design:type", Function),
|
|
80
|
+
__metadata("design:paramtypes", [GenerateProofDto]),
|
|
81
|
+
__metadata("design:returntype", Promise)
|
|
82
|
+
], ProofGateway.prototype, "generate", null);
|
|
83
|
+
ProofGateway = ProofGateway_1 = __decorate([
|
|
84
|
+
WebSocketGateway({
|
|
85
|
+
cors: {
|
|
86
|
+
origin: process.env.COORDINATOR_ALLOWED_ORIGINS?.split(","),
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
89
|
+
UseGuards(AccountSignatureGuard),
|
|
90
|
+
__metadata("design:paramtypes", [ProofGeneratorService])
|
|
91
|
+
], ProofGateway);
|
|
92
|
+
export { ProofGateway };
|
|
93
|
+
//# sourceMappingURL=proof.gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof.gateway.js","sourceRoot":"","sources":["../../../ts/proof/proof.gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKnH,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AAOI,IAAM,YAAY,oBAAlB,MAAM,YAAY;IAiBM;IAhB7B;;OAEG;IACc,MAAM,GAAG,IAAI,MAAM,CAAC,cAAY,CAAC,IAAI,CAAC,CAAC;IAExD;;OAEG;IAEH,MAAM,CAAU;IAEhB;;;;OAIG;IACH,YAA6B,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAG,CAAC;IAE7E;;;;;;;;;OASG;IAUG,AAAN,KAAK,CAAC,QAAQ,CAEZ,IAAsB;QAEtB,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC9C,eAAe,EAAE,CAAC,MAAgC,EAAE,EAAE;gBACpD,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AG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Module } from "@nestjs/common";
|
|
8
|
+
import { CryptoModule } from "../crypto/crypto.module";
|
|
9
|
+
import { FileModule } from "../file/file.module";
|
|
10
|
+
import { SessionKeysModule } from "../sessionKeys/sessionKeys.module";
|
|
11
|
+
import { ProofController } from "./proof.controller";
|
|
12
|
+
import { ProofGateway } from "./proof.gateway";
|
|
13
|
+
import { ProofGeneratorService } from "./proof.service";
|
|
14
|
+
let ProofModule = class ProofModule {
|
|
15
|
+
};
|
|
16
|
+
ProofModule = __decorate([
|
|
17
|
+
Module({
|
|
18
|
+
imports: [FileModule, CryptoModule, SessionKeysModule],
|
|
19
|
+
controllers: [ProofController],
|
|
20
|
+
providers: [ProofGeneratorService, ProofGateway],
|
|
21
|
+
exports: [ProofGeneratorService],
|
|
22
|
+
})
|
|
23
|
+
], ProofModule);
|
|
24
|
+
export { ProofModule };
|
|
25
|
+
//# sourceMappingURL=proof.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof.module.js","sourceRoot":"","sources":["../../../ts/proof/proof.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAQjD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IANvB,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,iBAAiB,CAAC;QACtD,WAAW,EAAE,CAAC,eAAe,CAAC;QAC9B,SAAS,EAAE,CAAC,qBAAqB,EAAE,YAAY,CAAC;QAChD,OAAO,EAAE,CAAC,qBAAqB,CAAC;KACjC,CAAC;GACW,WAAW,CAAG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type IGenerateProofsOptions } from "@maci-protocol/sdk";
|
|
2
|
+
import { IProof, ITallyData } from "@maci-protocol/sdk";
|
|
3
|
+
import type { IGenerateArgs, IGenerateData, IMergeArgs, ISubmitProofsArgs } from "./types";
|
|
4
|
+
import { FileService } from "../file/file.service";
|
|
5
|
+
import { SessionKeysService } from "../sessionKeys/sessionKeys.service";
|
|
6
|
+
/**
|
|
7
|
+
* ProofGeneratorService is responsible for generating message processing and tally proofs.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ProofGeneratorService {
|
|
10
|
+
private readonly fileService;
|
|
11
|
+
private readonly sessionKeysService;
|
|
12
|
+
/**
|
|
13
|
+
* Deployment helper
|
|
14
|
+
*/
|
|
15
|
+
private readonly deployment;
|
|
16
|
+
/**
|
|
17
|
+
* Logger
|
|
18
|
+
*/
|
|
19
|
+
private readonly logger;
|
|
20
|
+
/**
|
|
21
|
+
* Proof generator initialization
|
|
22
|
+
*/
|
|
23
|
+
constructor(fileService: FileService, sessionKeysService: SessionKeysService);
|
|
24
|
+
/**
|
|
25
|
+
* Read and parse proofs
|
|
26
|
+
* @param folder - folder path to read proofs from
|
|
27
|
+
* @param type - type of proofs to read (tally or process)
|
|
28
|
+
* @returns proofs
|
|
29
|
+
*/
|
|
30
|
+
readProofs(folder: string, type: "tally" | "process"): Promise<IProof[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Generate proofs for message processing and tally
|
|
33
|
+
*
|
|
34
|
+
* @param args - generate proofs arguments
|
|
35
|
+
* @returns - generated proofs for message processing and tally
|
|
36
|
+
*/
|
|
37
|
+
generate({ approval, sessionKeyAddress, chain, poll, maciContractAddress, mode, startBlock, endBlock, blocksPerBatch, useWasm, }: IGenerateArgs, options?: IGenerateProofsOptions): Promise<IGenerateData>;
|
|
38
|
+
/**
|
|
39
|
+
* Merge state and message trees
|
|
40
|
+
*
|
|
41
|
+
* @param args - merge arguments
|
|
42
|
+
* @returns whether the proofs were successfully merged
|
|
43
|
+
*/
|
|
44
|
+
merge({ maciContractAddress, pollId, approval, sessionKeyAddress, chain }: IMergeArgs): Promise<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Submit proofs on-chain
|
|
47
|
+
*
|
|
48
|
+
* @param args - submit proofs on-chain arguments
|
|
49
|
+
*/
|
|
50
|
+
submit({ maciContractAddress, pollId, sessionKeyAddress, approval, chain, }: ISubmitProofsArgs): Promise<ITallyData>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=proof.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof.service.d.ts","sourceRoot":"","sources":["../../../ts/proof/proof.service.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,sBAAsB,EAI5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAgC,MAAM,oBAAoB,CAAC;AAOtF,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAI3F,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE;;GAEG;AACH,qBACa,qBAAqB;IAe9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAfrC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;OAEG;gBAEgB,WAAW,EAAE,WAAW,EACxB,kBAAkB,EAAE,kBAAkB;IAOzD;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAY9E;;;;;OAKG;IACG,QAAQ,CACZ,EACE,QAAQ,EACR,iBAAiB,EACjB,KAAK,EACL,IAAI,EACJ,mBAAmB,EACnB,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,cAAc,EACd,OAAO,GACR,EAAE,aAAa,EAChB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,aAAa,CAAC;IAuEzB;;;;;OAKG;IACG,KAAK,CAAC,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAY9G;;;;OAIG;IACG,MAAM,CAAC,EACX,mBAAmB,EACnB,MAAM,EACN,iBAAiB,EACjB,QAAQ,EACR,KAAK,GACN,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC;CAiB3C"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var ProofGeneratorService_1;
|
|
11
|
+
import { PublicKey } from "@maci-protocol/domainobjs";
|
|
12
|
+
import { Deployment, EContracts, getPoll, mergeSignups, EMode, } from "@maci-protocol/sdk";
|
|
13
|
+
import { generateProofs, proveOnChain } from "@maci-protocol/sdk";
|
|
14
|
+
import { Logger, Injectable } from "@nestjs/common";
|
|
15
|
+
import hre from "hardhat";
|
|
16
|
+
import fs from "fs";
|
|
17
|
+
import path from "path";
|
|
18
|
+
import { ErrorCodes } from "../common";
|
|
19
|
+
import { getCoordinatorKeypair } from "../common/coordinatorKeypair";
|
|
20
|
+
import { FileService } from "../file/file.service";
|
|
21
|
+
import { SessionKeysService } from "../sessionKeys/sessionKeys.service";
|
|
22
|
+
/**
|
|
23
|
+
* ProofGeneratorService is responsible for generating message processing and tally proofs.
|
|
24
|
+
*/
|
|
25
|
+
let ProofGeneratorService = ProofGeneratorService_1 = class ProofGeneratorService {
|
|
26
|
+
fileService;
|
|
27
|
+
sessionKeysService;
|
|
28
|
+
/**
|
|
29
|
+
* Deployment helper
|
|
30
|
+
*/
|
|
31
|
+
deployment;
|
|
32
|
+
/**
|
|
33
|
+
* Logger
|
|
34
|
+
*/
|
|
35
|
+
logger;
|
|
36
|
+
/**
|
|
37
|
+
* Proof generator initialization
|
|
38
|
+
*/
|
|
39
|
+
constructor(fileService, sessionKeysService) {
|
|
40
|
+
this.fileService = fileService;
|
|
41
|
+
this.sessionKeysService = sessionKeysService;
|
|
42
|
+
this.deployment = Deployment.getInstance({ hre });
|
|
43
|
+
this.deployment.setHre(hre);
|
|
44
|
+
this.logger = new Logger(ProofGeneratorService_1.name);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read and parse proofs
|
|
48
|
+
* @param folder - folder path to read proofs from
|
|
49
|
+
* @param type - type of proofs to read (tally or process)
|
|
50
|
+
* @returns proofs
|
|
51
|
+
*/
|
|
52
|
+
async readProofs(folder, type) {
|
|
53
|
+
const files = await fs.promises.readdir(folder);
|
|
54
|
+
return Promise.all(files
|
|
55
|
+
.filter((f) => f.startsWith(`${type}_`) && f.endsWith(".json"))
|
|
56
|
+
.sort()
|
|
57
|
+
.map(async (file) => fs.promises.readFile(`${folder}/${file}`, "utf8").then((result) => JSON.parse(result))));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Generate proofs for message processing and tally
|
|
61
|
+
*
|
|
62
|
+
* @param args - generate proofs arguments
|
|
63
|
+
* @returns - generated proofs for message processing and tally
|
|
64
|
+
*/
|
|
65
|
+
async generate({ approval, sessionKeyAddress, chain, poll, maciContractAddress, mode, startBlock, endBlock, blocksPerBatch, useWasm, }, options) {
|
|
66
|
+
try {
|
|
67
|
+
const signer = await this.sessionKeysService.getCoordinatorSigner(chain, sessionKeyAddress, approval);
|
|
68
|
+
const pollData = await getPoll({
|
|
69
|
+
maciAddress: maciContractAddress,
|
|
70
|
+
pollId: poll,
|
|
71
|
+
signer,
|
|
72
|
+
});
|
|
73
|
+
const pollContract = await this.deployment.getContract({
|
|
74
|
+
name: EContracts.Poll,
|
|
75
|
+
address: pollData.address,
|
|
76
|
+
});
|
|
77
|
+
const publicKeyOnChain = await pollContract.coordinatorPublicKey();
|
|
78
|
+
const coordinatorPublicKeyOnChain = new PublicKey([
|
|
79
|
+
BigInt(publicKeyOnChain.x.toString()),
|
|
80
|
+
BigInt(publicKeyOnChain.y.toString()),
|
|
81
|
+
]);
|
|
82
|
+
const coordinatorKeypair = getCoordinatorKeypair();
|
|
83
|
+
if (!coordinatorKeypair.publicKey.equals(coordinatorPublicKeyOnChain)) {
|
|
84
|
+
this.logger.error(`Error: ${ErrorCodes.PRIVATE_KEY_MISMATCH}, wrong private key`);
|
|
85
|
+
throw new Error(ErrorCodes.PRIVATE_KEY_MISMATCH.toString());
|
|
86
|
+
}
|
|
87
|
+
// There are only QV and Non-QV modes available for tally circuit
|
|
88
|
+
const tally = this.fileService.getZkeyFilePaths(process.env.COORDINATOR_TALLY_ZKEY_NAME,
|
|
89
|
+
// if FULL use NON_QV because there are only VoteTallyQV and VoteTallyNonQV zkeys
|
|
90
|
+
mode === EMode.FULL ? EMode.NON_QV : mode);
|
|
91
|
+
const messageProcessor = this.fileService.getZkeyFilePaths(process.env.COORDINATOR_MESSAGE_PROCESS_ZKEY_NAME, mode);
|
|
92
|
+
const { processProofs, tallyProofs, tallyData } = await generateProofs({
|
|
93
|
+
outputDir: path.resolve("./proofs"),
|
|
94
|
+
coordinatorPrivateKey: coordinatorKeypair.privateKey.serialize(),
|
|
95
|
+
signer,
|
|
96
|
+
maciAddress: maciContractAddress,
|
|
97
|
+
pollId: BigInt(poll),
|
|
98
|
+
startBlock,
|
|
99
|
+
endBlock,
|
|
100
|
+
blocksPerBatch,
|
|
101
|
+
useWasm,
|
|
102
|
+
rapidsnark: process.env.COORDINATOR_RAPIDSNARK_EXE,
|
|
103
|
+
mode,
|
|
104
|
+
voteTallyZkey: tally.zkey,
|
|
105
|
+
voteTallyWitnessGenerator: tally.witnessGenerator,
|
|
106
|
+
voteTallyWasm: tally.wasm,
|
|
107
|
+
messageProcessorZkey: messageProcessor.zkey,
|
|
108
|
+
messageProcessorWitnessGenerator: messageProcessor.witnessGenerator,
|
|
109
|
+
messageProcessorWasm: messageProcessor.wasm,
|
|
110
|
+
tallyFile: path.resolve("./tally.json"),
|
|
111
|
+
});
|
|
112
|
+
return {
|
|
113
|
+
processProofs,
|
|
114
|
+
tallyProofs,
|
|
115
|
+
tallyData,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
options?.onFail?.(error);
|
|
120
|
+
throw error;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Merge state and message trees
|
|
125
|
+
*
|
|
126
|
+
* @param args - merge arguments
|
|
127
|
+
* @returns whether the proofs were successfully merged
|
|
128
|
+
*/
|
|
129
|
+
async merge({ maciContractAddress, pollId, approval, sessionKeyAddress, chain }) {
|
|
130
|
+
const signer = await this.sessionKeysService.getCoordinatorSigner(chain, sessionKeyAddress, approval);
|
|
131
|
+
await mergeSignups({
|
|
132
|
+
maciAddress: maciContractAddress,
|
|
133
|
+
pollId: BigInt(pollId),
|
|
134
|
+
signer,
|
|
135
|
+
});
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Submit proofs on-chain
|
|
140
|
+
*
|
|
141
|
+
* @param args - submit proofs on-chain arguments
|
|
142
|
+
*/
|
|
143
|
+
async submit({ maciContractAddress, pollId, sessionKeyAddress, approval, chain, }) {
|
|
144
|
+
const signer = await this.sessionKeysService.getCoordinatorSigner(chain, sessionKeyAddress, approval);
|
|
145
|
+
const tallyData = await proveOnChain({
|
|
146
|
+
pollId: BigInt(pollId),
|
|
147
|
+
maciAddress: maciContractAddress,
|
|
148
|
+
proofDir: "./proofs",
|
|
149
|
+
tallyFile: "./tally.json",
|
|
150
|
+
signer,
|
|
151
|
+
});
|
|
152
|
+
if (!tallyData) {
|
|
153
|
+
throw new Error("Tally data is undefined");
|
|
154
|
+
}
|
|
155
|
+
return tallyData;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
ProofGeneratorService = ProofGeneratorService_1 = __decorate([
|
|
159
|
+
Injectable(),
|
|
160
|
+
__metadata("design:paramtypes", [FileService,
|
|
161
|
+
SessionKeysService])
|
|
162
|
+
], ProofGeneratorService);
|
|
163
|
+
export { ProofGeneratorService };
|
|
164
|
+
//# sourceMappingURL=proof.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof.service.js","sourceRoot":"","sources":["../../../ts/proof/proof.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,UAAU,EACV,UAAU,EAGV,OAAO,EACP,YAAY,EACZ,KAAK,GACN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAsB,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,GAAG,MAAM,SAAS,CAAC;AAE1B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE;;GAEG;AAEI,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAeb;IACA;IAfnB;;OAEG;IACc,UAAU,CAAa;IAExC;;OAEG;IACc,MAAM,CAAS;IAEhC;;OAEG;IACH,YACmB,WAAwB,EACxB,kBAAsC;QADtC,gBAAW,GAAX,WAAW,CAAa;QACxB,uBAAkB,GAAlB,kBAAkB,CAAoB;QAEvD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,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nC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,cAAc;YACzB,MAAM;SACP,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAA;AAlLY,qBAAqB;IADjC,UAAU,EAAE;qCAgBqB,WAAW;QACJ,kBAAkB;GAhB9C,qBAAqB,CAkLjC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { ITallyData, IProof, EMode, ESupportedChains } from "@maci-protocol/sdk";
|
|
2
|
+
import type { Hex } from "viem";
|
|
3
|
+
/**
|
|
4
|
+
* WS events for proof generation
|
|
5
|
+
*/
|
|
6
|
+
export declare enum EProofGenerationEvents {
|
|
7
|
+
START = "start-generation",
|
|
8
|
+
PROGRESS = "progress-generation",
|
|
9
|
+
FINISH = "finish-generation",
|
|
10
|
+
ERROR = "exception"
|
|
11
|
+
}
|
|
12
|
+
export interface IReadProofsResults {
|
|
13
|
+
/**
|
|
14
|
+
* Process proofs list
|
|
15
|
+
*/
|
|
16
|
+
process: IProof[];
|
|
17
|
+
/**
|
|
18
|
+
* Tally proofs list
|
|
19
|
+
*/
|
|
20
|
+
tally: IProof[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Interface that represents generate proofs arguments
|
|
24
|
+
*/
|
|
25
|
+
export interface IGenerateArgs {
|
|
26
|
+
/**
|
|
27
|
+
* Approval for the session key
|
|
28
|
+
*/
|
|
29
|
+
approval?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Session key address
|
|
32
|
+
*/
|
|
33
|
+
sessionKeyAddress?: Hex;
|
|
34
|
+
/**
|
|
35
|
+
* Chain
|
|
36
|
+
*/
|
|
37
|
+
chain: ESupportedChains;
|
|
38
|
+
/**
|
|
39
|
+
* Poll id
|
|
40
|
+
*/
|
|
41
|
+
poll: number;
|
|
42
|
+
/**
|
|
43
|
+
* Maci contract address
|
|
44
|
+
*/
|
|
45
|
+
maciContractAddress: string;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to use Qv or NonQv
|
|
48
|
+
*/
|
|
49
|
+
mode: EMode;
|
|
50
|
+
/**
|
|
51
|
+
* Start block for event processing
|
|
52
|
+
*/
|
|
53
|
+
startBlock?: number;
|
|
54
|
+
/**
|
|
55
|
+
* End block for event processing
|
|
56
|
+
*/
|
|
57
|
+
endBlock?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Blocks per batch for event processing
|
|
60
|
+
*/
|
|
61
|
+
blocksPerBatch?: number;
|
|
62
|
+
useWasm?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Interface that represents generated proofs data
|
|
66
|
+
*/
|
|
67
|
+
export interface IGenerateData {
|
|
68
|
+
/**
|
|
69
|
+
* Message processing proofs
|
|
70
|
+
*/
|
|
71
|
+
processProofs: IProof[];
|
|
72
|
+
/**
|
|
73
|
+
* Tally proofs
|
|
74
|
+
*/
|
|
75
|
+
tallyProofs: IProof[];
|
|
76
|
+
/**
|
|
77
|
+
* TallyData
|
|
78
|
+
*/
|
|
79
|
+
tallyData: ITallyData;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Interface that represents zkey filepaths
|
|
83
|
+
*/
|
|
84
|
+
export interface IGetZkeyFilesData {
|
|
85
|
+
/**
|
|
86
|
+
* Zkey filepath
|
|
87
|
+
*/
|
|
88
|
+
zkey: string;
|
|
89
|
+
/**
|
|
90
|
+
* Wasm filepath
|
|
91
|
+
*/
|
|
92
|
+
wasm: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Merge arguments
|
|
96
|
+
*/
|
|
97
|
+
export interface IMergeArgs {
|
|
98
|
+
/**
|
|
99
|
+
* MACI contract address
|
|
100
|
+
*/
|
|
101
|
+
maciContractAddress: string;
|
|
102
|
+
/**
|
|
103
|
+
* Poll ID
|
|
104
|
+
*/
|
|
105
|
+
pollId: number;
|
|
106
|
+
/**
|
|
107
|
+
* Approval for the session key
|
|
108
|
+
*/
|
|
109
|
+
approval?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Session key address
|
|
112
|
+
*/
|
|
113
|
+
sessionKeyAddress?: Hex;
|
|
114
|
+
/**
|
|
115
|
+
* Chain
|
|
116
|
+
*/
|
|
117
|
+
chain: ESupportedChains;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Submit proofs on-chain arguments
|
|
121
|
+
*/
|
|
122
|
+
export interface ISubmitProofsArgs {
|
|
123
|
+
/**
|
|
124
|
+
* MACI contract address
|
|
125
|
+
*/
|
|
126
|
+
maciContractAddress: string;
|
|
127
|
+
/**
|
|
128
|
+
* Poll ID
|
|
129
|
+
*/
|
|
130
|
+
pollId: number;
|
|
131
|
+
/**
|
|
132
|
+
* Approval for the session key
|
|
133
|
+
*/
|
|
134
|
+
approval?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Session key address
|
|
137
|
+
*/
|
|
138
|
+
sessionKeyAddress?: Hex;
|
|
139
|
+
/**
|
|
140
|
+
* Chain
|
|
141
|
+
*/
|
|
142
|
+
chain: ESupportedChains;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../ts/proof/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;GAEG;AACH,oBAAY,sBAAsB;IAChC,KAAK,qBAAqB;IAC1B,QAAQ,wBAAwB;IAChC,MAAM,sBAAsB;IAC5B,KAAK,cAAc;CAC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MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC;IAExB;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC;CACzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WS events for proof generation
|
|
3
|
+
*/
|
|
4
|
+
export var EProofGenerationEvents;
|
|
5
|
+
(function (EProofGenerationEvents) {
|
|
6
|
+
EProofGenerationEvents["START"] = "start-generation";
|
|
7
|
+
EProofGenerationEvents["PROGRESS"] = "progress-generation";
|
|
8
|
+
EProofGenerationEvents["FINISH"] = "finish-generation";
|
|
9
|
+
EProofGenerationEvents["ERROR"] = "exception";
|
|
10
|
+
})(EProofGenerationEvents || (EProofGenerationEvents = {}));
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../ts/proof/types.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAN,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,oDAA0B,CAAA;IAC1B,0DAAgC,CAAA;IAChC,sDAA4B,CAAA;IAC5B,6CAAmB,CAAA;AACrB,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis.service.test.d.ts","sourceRoot":"","sources":["../../../../ts/redis/__tests__/redis.service.test.ts"],"names":[],"mappings":""}
|