-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #918 from privacy-scaling-explorations/feat/ceremo…
…ny-params test(ceremony): test ceremony artifacts and params
- Loading branch information
Showing
10 changed files
with
451 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")" | ||
cd ../../cli | ||
|
||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js deployVkRegistry -q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js setVerifyingKeys \ | ||
--state-tree-depth 6 \ | ||
--int-state-tree-depth 2 \ | ||
--msg-tree-depth 8 \ | ||
--vote-option-tree-depth 3 \ | ||
--msg-batch-depth 2 \ | ||
--process-messages-zkey ./zkeys/processMessages_6-8-2-3.zkey \ | ||
--tally-votes-zkey ./zkeys/tallyVotes_6-2-3.zkey \ | ||
-q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js create -s 6 -q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js deployPoll \ | ||
-pk macipk.c974f4f168b79727ac98bfd53a65ea0b4e45dc2552fe73df9f8b51ebb0930330 \ | ||
--duration 30 \ | ||
--max-messages 390625 \ | ||
--max-vote-options 125 \ | ||
--int-state-tree-depth 2 \ | ||
--msg-tree-depth 8 \ | ||
--msg-batch-depth 2 \ | ||
--vote-option-tree-depth 3 \ | ||
-q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js signup \ | ||
--pubkey macipk.3e7bb2d7f0a1b7e980f1b6f363d1e3b7a12b9ae354c2cd60a9cfa9fd12917391 \ | ||
-q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \ | ||
--pubkey macipk.3e7bb2d7f0a1b7e980f1b6f363d1e3b7a12b9ae354c2cd60a9cfa9fd12917391 \ | ||
--privkey macisk.fd7aa614ec4a82716ffc219c24fd7e7b52a2b63b5afb17e81c22fe21515539c \ | ||
--state-index 1 \ | ||
--vote-option-index 0 \ | ||
--new-vote-weight 9 \ | ||
--nonce 1 \ | ||
--poll-id 0 \ | ||
-q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \ | ||
--pubkey macipk.d5788ea6ccf1ec295df99aaef859031fe7bd359e7e03acb80eb6e8a192f2ce19 \ | ||
--privkey macisk.fd7aa614ec4a82716ffc219c24fd7e7b52a2b63b5afb17e81c22fe21515539c \ | ||
--state-index 1 \ | ||
--vote-option-index 1 \ | ||
--new-vote-weight 9 \ | ||
--nonce 2 \ | ||
--poll-id 0 \ | ||
-q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js timeTravel -s 100 -q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js mergeSignups --poll-id 0 -q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js mergeMessages --poll-id 0 -q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js genProofs \ | ||
--privkey macisk.49953af3585856f539d194b46c82f4ed54ec508fb9b882940cbe68bbc57e59e \ | ||
--poll-id 0 \ | ||
--rapidsnark ~/rapidsnark/build/prover \ | ||
--process-zkey ./zkeys/processMessages_6-8-2-3.zkey \ | ||
--tally-zkey ./zkeys/tallyVotes_6-2-3.zkey \ | ||
--tally-file tally.json \ | ||
--output proofs/ \ | ||
--tally-witnessgen ./zkeys/tallyVotes_6-2-3 \ | ||
--process-witnessgen ./zkeys/processMessages_6-8-2-3 \ | ||
-q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js proveOnChain \ | ||
--poll-id 0 \ | ||
--proof-dir proofs/ \ | ||
-q true | ||
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js verify \ | ||
--poll-id 0 \ | ||
--tally-file tally.json \ | ||
-q true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")" | ||
cd .. | ||
mkdir -p ../cli/zkeys | ||
|
||
URL=https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v1.2.0/maci-ceremony-artifacts-v1.2.0.tar.gz | ||
DIR_NAME="maci_keys.tar.gz" | ||
OUT_DIR=../cli/ | ||
|
||
echo "downloading $URL" | ||
curl $URL -o "$OUT_DIR/$DIR_NAME" | ||
tar -xvf "$OUT_DIR/$DIR_NAME" -C "$OUT_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Nightly Ceremony | ||
|
||
on: | ||
schedule: | ||
- cron: 0 0 * * * | ||
|
||
jobs: | ||
test-with-ceremony-keys: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: dev | ||
|
||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --yes \ | ||
build-essential \ | ||
libgmp-dev \ | ||
libsodium-dev \ | ||
nasm \ | ||
nlohmann-json3-dev | ||
- name: Initialize Project | ||
run: | | ||
npm install | ||
npm run bootstrap | ||
npm run build | ||
- name: Compile contracts with ceremony params and run hardhat fork | ||
run: | | ||
cd contracts | ||
npm run compileSol 6 | ||
npm run hardhat & | ||
- 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 ceremony artifacts | ||
run: ./.github/scripts/download-ceremony-artifacts.sh | ||
|
||
- name: Run e2e tests | ||
run: ./.github/scripts/ceremony-param-tests-c-witness.sh | ||
|
||
- name: Stop Hardhat | ||
run: kill $(lsof -t -i:8545) |
10 changes: 10 additions & 0 deletions
10
circuits/circom/test/ceremonyParams/processMessages_test.circom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
pragma circom 2.0.0; | ||
include "../../processMessages.circom"; | ||
/* | ||
stateTreeDepth, | ||
msgTreeDepth, | ||
msgSubTreeDepth | ||
voteOptionTreeDepth, | ||
*/ | ||
|
||
component main {public [inputHash]} = ProcessMessages(6, 8, 2, 3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pragma circom 2.0.0; | ||
include "../../tallyVotes.circom"; | ||
|
||
component main {public [inputHash]} = TallyVotes(6, 2, 3); | ||
/*stateTreeDepth,*/ | ||
/*intStateTreeDepth,*/ | ||
/*voteOptionTreeDepth*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.