Skip to content

Commit

Permalink
test(stress): add stress test with ceremony params
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 committed Jan 12, 2024
1 parent dcca295 commit 978dc10
Show file tree
Hide file tree
Showing 6 changed files with 434 additions and 81 deletions.
71 changes: 0 additions & 71 deletions .github/scripts/ceremony-param-tests-c-witness.sh

This file was deleted.

11 changes: 6 additions & 5 deletions .github/workflows/nightly-ceremony.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Nightly Ceremony

on:
schedule:
- cron: 0 0 * * *
push:
branches:
- test/stress-test

env:
STATE_TREE_DEPTH: ${{ vars.STATE_TREE_DEPTH }}
Expand All @@ -14,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: dev
ref: test/stress-test
- uses: pnpm/action-setup@v2
with:
version: latest
Expand Down Expand Up @@ -57,8 +58,8 @@ jobs:
- name: Download ceremony artifacts
run: ./.github/scripts/download-ceremony-artifacts.sh

- name: Run e2e tests
run: ./.github/scripts/ceremony-param-tests-c-witness.sh
- name: Run stress tests
run: pnpm run test:stress

- name: Stop Hardhat
if: always()
Expand Down
5 changes: 3 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build": "tsc -p tsconfig.build.json",
"postbuild": "cp package.json ./build",
"types": "tsc -p tsconfig.json --noEmit",
"test": "nyc ts-mocha --exit tests/**/*.test.ts",
"test": "nyc ts-mocha --exit tests/e2e/*.test.ts tests/unit/*.test.ts",
"test:e2e": "ts-mocha --exit tests/e2e.test.ts",
"test:e2e-subsidy": "ts-mocha --exit tests/e2e.subsidy.test.ts",
"test:keyChange": "ts-mocha --exit tests/keyChange.test.ts",
Expand All @@ -24,7 +24,8 @@
"test:genKeypair": "ts-mocha --exit tests/unit/genKeyPair.test.ts",
"test:timeTravel": "ts-mocha --exit tests/unit/timeTravel.test.ts",
"test:fundWallet": "ts-mocha --exit tests/unit/fundWallet.test.ts",
"test:utils": "ts-mocha --exit tests/unit/utils.test.ts"
"test:utils": "ts-mocha --exit tests/unit/utils.test.ts",
"test:stress": "ts-mocha --exit tests/stress/*.test.ts"
},
"dependencies": {
"@commander-js/extra-typings": "^11.1.0",
Expand Down
17 changes: 14 additions & 3 deletions cli/tests/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ import { Keypair } from "maci-domainobjs";

import { homedir } from "os";

// config params
export const STATE_TREE_DEPTH = 10;
export const INT_STATE_TREE_DEPTH = 1;
export const MSG_TREE_DEPTH = 2;
export const VOTE_OPTION_TREE_DEPTH = 2;
export const MSG_BATCH_DEPTH = 1;
export const pollDuration = 90;
export const maxMessages = 25;
export const maxVoteOptions = 25;

// coordinator keypair
const coordinatorKeypair = new Keypair();
export const coordinatorPubKey = coordinatorKeypair.pubKey.serialize();
export const coordinatorPrivKey = coordinatorKeypair.privKey.serialize();

// local paths to zkeys, wasm, and witnesses
export const processMessageTestZkeyPath = "./zkeys/ProcessMessages_10-2-1-2_test.0.zkey";
export const tallyVotesTestZkeyPath = "./zkeys/TallyVotes_10-1-2_test.0.zkey";
export const subsidyTestZkeyPath = "./zkeys/SubsidyPerBatch_10-1-2_test.0.zkey";
Expand All @@ -24,6 +32,9 @@ export const testProcessMessagesWasmPath =
export const testTallyVotesWasmPath = "./zkeys/TallyVotes_10-1-2_test_js/TallyVotes_10-1-2_test.wasm";
export const testSubsidyWasmPath = "./zkeys/SubsidyPerBatch_10-1-2_test_js/SubsidyPerBatch_10-1-2_test.wasm";
export const testRapidsnarkPath = `${homedir()}/rapidsnark/build/prover`;
export const pollDuration = 90;
export const maxMessages = 25;
export const maxVoteOptions = 25;
export const ceremonyProcessMessageZkeyPath = "./zkeys/processMessages_6-8-2-3.zkey";
export const ceremonyTallyVotesZkeyPath = "./zkeys/tallyVotes_6-2-3.zkey";
export const cermeonyProcessMessagesWitnessPath = "./zkeys/processMessages_6-8-2-3";
export const ceremonyTallyVotesWitnessPath = "./zkeys/tallyVotes_6-2-3";
export const ceremonyProcessMessagesWasmPath = "./zkeys/processMessages_6-8-2-3.wasm";
export const ceremonyTallyVotesWasmPath = "./zkeys/tallyVotes_6-2-3.wasm";
Loading

0 comments on commit 978dc10

Please sign in to comment.