-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
838636d
commit 9b9853c
Showing
10 changed files
with
90 additions
and
30 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
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
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,16 @@ | ||
name: Create ceremony | ||
on: push | ||
jobs: | ||
compile-and-prepare: | ||
if: ${{ startsWith(github.ref, 'ceremony/') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
ref: ${{ github.ref }} | ||
- name: Checkout LFS objects | ||
run: git lfs checkout | ||
- name: Run toolkit | ||
run: make verify-locally |
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
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 @@ | ||
FROM node | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
|
||
RUN npm config set update-notifier false && \ | ||
npm install -g snarkjs | ||
|
||
CMD [ "bash", "/app/scripts/verify-contribution.sh" ] |
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
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
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
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
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,39 @@ | ||
#!/bin/bash | ||
|
||
. scripts/tools.sh | ||
|
||
check_last_contribution_env() { | ||
# get the last contribution zkey file from the contributions file | ||
if [ ! -f "$CONTRIBUTIONS_FILE" ]; then | ||
error "contribution file does not exists, is the ceremony initialized?" | ||
exit 1 | ||
else | ||
LAST_CONTRIBUTION_FILE=$(get_last_contribution_file_path) | ||
LAST_CONTRIBUTION_HASH=$(get_last_contribution_hash) | ||
fi | ||
|
||
mkdir -p $OUTPUT_PATH | ||
} | ||
|
||
verify() { | ||
if [ "$(get_file_hash "$LAST_CONTRIBUTION_FILE")" == "<check CONTRIBUTIONS.md file>" ]; then | ||
error "no contributions" | ||
exit 1 | ||
fi | ||
if [ "$(get_file_hash "$LAST_CONTRIBUTION_FILE")" != "$LAST_CONTRIBUTION_HASH" ]; then | ||
error "the last contribution file has been modified, please check the CONTRIBUTIONS.md file" | ||
exit 1 | ||
fi | ||
$SNARKJS zkey verify $CONTRIBUTIONS_PATH/$CIRCUIT_FILENAME.r1cs $INPUT_PTAU_PATH $LAST_CONTRIBUTION_FILE | ||
# prune temporally files | ||
rm -rf $OUTPUT_PATH | ||
} | ||
|
||
verify_last_contribution() { | ||
# check the environment | ||
check_last_contribution_env || error "error checking the environment" | ||
# verify the result of last contribution | ||
verify || error "verifying the last contribution" | ||
} | ||
|
||
verify_last_contribution |