Skip to content

Commit

Permalink
chore(zkeys): use ts to download zkey artifacts and simplify repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 committed May 23, 2024
1 parent 9cb775f commit b840a8d
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 69 deletions.
15 changes: 0 additions & 15 deletions .github/scripts/download-ceremony-artifacts.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .github/scripts/download-zkeys-1-3.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/nightly-ceremony.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
chmod +x ~/rapidsnark/build/prover
- name: Download ceremony artifacts
run: ./.github/scripts/download-ceremony-artifacts.sh
run: pnpm download:ceremony-zkeys

- name: Run e2e tests
run: pnpm test:cli-ceremony
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Download zkeys
if: ${{ env.CHANGED == 'false' }}
run: |
pnpm download:test-zkeys-1-3
pnpm download:test-zkeys
- name: ${{ matrix.command }}
run: pnpm run ${{ matrix.command }}
Expand Down
8 changes: 0 additions & 8 deletions cli/scripts/gen_zkey.sh

This file was deleted.

1 change: 1 addition & 0 deletions coordinator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"test:coverage": "jest --coverage",
"types": "tsc -p tsconfig.json --noEmit",
"download-zkeys:test": "ts-node ./scripts/downloadZkeys.ts test",
"download-zkeys:prod": "ts-node ./scripts/downloadZkeys.ts prod",
"generate-keypair": "ts-node ./scripts/generateKeypair.ts"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion coordinator/scripts/downloadZkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dotenv.config({ path: [path.resolve(__dirname, "../.env"), path.resolve(__dirnam
const ZKEY_PATH = path.resolve(process.env.COORDINATOR_ZKEY_PATH!);
const ZKEYS_URLS = {
test: "https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v1.3.0/maci_artifacts_10-2-1-2_test.tar.gz",
prod: "https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v1.2.0/maci_artifacts_6-9-2-3_prod.tar.gz",
};
const ARCHIVE_NAME = path.resolve(ZKEY_PATH, "maci_keys.tar.gz");

Expand All @@ -34,7 +35,7 @@ export async function downloadZkeys(): Promise<void> {
.on("finish", () => {
file.close();

tar.x({ f: ARCHIVE_NAME }).then(() => fs.promises.rm(ARCHIVE_NAME));
tar.x({ f: ARCHIVE_NAME, C: ZKEY_PATH }).then(() => fs.promises.rm(ARCHIVE_NAME));
})
.on("error", () => fs.promises.unlink(ARCHIVE_NAME));
})
Expand Down
3 changes: 1 addition & 2 deletions integrationTests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"types": "tsc -p tsconfig.json --noEmit",
"test": "ts-mocha --exit ./ts/__tests__/**.test.ts",
"test:integration": "NODE_OPTIONS=--max-old-space-size=4096 ts-mocha --exit ./ts/__tests__/integration.test.ts",
"test:maciKeys": "ts-mocha --exit ./ts/__tests__/maci-keys.test.ts",
"download-zkeys": "./scripts/download_zkeys.sh"
"test:maciKeys": "ts-mocha --exit ./ts/__tests__/maci-keys.test.ts"
},
"devDependencies": {
"@types/chai": "^4.3.11",
Expand Down
14 changes: 0 additions & 14 deletions integrationTests/scripts/download_zkeys.sh

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
"setup:zkeys": "NODE_OPTIONS=--max-old-space-size=4096 lerna run gen-zkeys --scope \"maci-circuits\"",
"clean": "lerna exec -- rm -rf node_modules build && rm -rf node_modules",
"commit": "git cz",
"download:test-zkeys-1-2": "lerna run download-zkeys --scope \"maci-integrationtests\"",
"download:test-zkeys-1-3": "bash .github/scripts/download-zkeys-1-3.sh",
"download:ceremony-zkeys": "bash .github/scripts/download-ceremony-artifacts.sh",
"download:test-zkeys": "export COORDINATOR_ZKEY_PATH=../cli && lerna run download-zkeys:test --scope \"maci-coordinator\"",
"download:ceremony-zkeys": "export COORDINATOR_ZKEY_PATH=../cli && lerna run download-zkeys:prod --scope \"maci-coordinator\"",
"prettier": "prettier -c .",
"prettier:fix": "prettier -w .",
"lint:ts": "eslint './**/**/*.ts' './**/**/*.tsx'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,15 @@ Note the locations of the `.zkey` files as the CLI requires them as command-line
If using the latest dev updates:
```bash
pnpm download:test-zkeys-1-3
pnpm download:test-zkeys
```
If using **1.2.1**

```bash
pnpm download:test-zkeys-1-2
```

Note that the below will work up until **1.2.1**

**Download ceremony artifacts**

:::info
Currently, the ceremony artifacts work with MACI version up to 1.2.2.
:::

```bash
pnpm download:ceremony-zkeys
```

0 comments on commit b840a8d

Please sign in to comment.