Skip to content

Commit

Permalink
test(benchmarks): add benchmarks for e2e actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 committed Jan 22, 2024
1 parent 77a424d commit 256fe63
Show file tree
Hide file tree
Showing 8 changed files with 407 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,21 @@ jobs:
run: |
pnpm build
- name: Download rapidsnark (1c137)
run: |
mkdir -p ~/rapidsnark/build
wget -qO ~/rapidsnark/build/prover https://maci-devops-zkeys.s3.ap-northeast-2.amazonaws.com/rapidsnark-linux-amd64-1c137
chmod +x ~/rapidsnark/build/prover
- name: Download circom Binary v2.1.6
run: |
wget -qO ${{ github.workspace }}/circom https://github.com/iden3/circom/releases/download/v2.1.6/circom-linux-amd64
chmod +x ${{ github.workspace }}/circom
sudo mv ${{ github.workspace }}/circom /bin/circom
- name: Download zkeys
run: |
pnpm download:test-zkeys
- name: Benchmarks
run: pnpm benchmarks
4 changes: 4 additions & 0 deletions circuits/ts/proofs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export const genProof = async ({
}

const { proof, publicSignals } = await groth16.fullProve(inputs, wasmPath, zkeyPath);

// ensure we clean up all threads spawned by snarkjs
await cleanThreads();

return { proof, publicSignals };
}

Expand Down
1 change: 1 addition & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"scripts": {
"watch": "tsc --watch",
"benchmarks": "ts-node tests/benchmarks/benchmarks.ts",
"build": "tsc -p tsconfig.build.json",
"postbuild": "cp package.json ./build && mkdir -p ./zkeys",
"types": "tsc -p tsconfig.json --noEmit",
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/e2e/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ describe("e2e tests", function test() {
});
});

describe("5 signups, 1 message", () => {
describe("9 signups, 1 message", () => {
after(() => {
cleanVanilla();
});
Expand Down
2 changes: 2 additions & 0 deletions integrationTests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"scripts": {
"watch": "tsc --watch",
"build": "tsc",
"benchmarks": "ts-node ts/__benchmarks__/benchmarks.ts",
"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",
Expand All @@ -22,6 +23,7 @@
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.2",
"benny": "^3.7.1",
"chai": "^4.3.10",
"chai-as-promised": "^7.1.1",
"hardhat": "^2.19.2",
Expand Down
Loading

0 comments on commit 256fe63

Please sign in to comment.