Skip to content

Finalize a test round #100

Finalize a test round

Finalize a test round #100

Workflow file for this run

name: Finalize a test round
on:
workflow_dispatch:
inputs:
clrfund_address:
description: 'Clrfund contract address'
required: true
default: '0x87790498127ff044f43b9230506833ca89113757'
maci_tx_hash:
description: 'MACI creation transaction hash'
required: false
blocks_per_batch:
description: 'Blocks of logs to fetch per batch'
required: true
default: '9000'
network:
description: 'Network'
required: true
default: 'arbitrum-sepolia'
jsonrpc_url:
description: jsonrpc url to node
required: false
env:
NODE_VERSION: 20.x
COORDINATOR_MACISK: ${{ secrets.COORDINATOR_MACI_PRIVATE_KEY }}
WALLET_PRIVATE_KEY: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_WALLET_PRIVATE_KEY }}
CIRCUIT_TYPE: micro
ZKEYS_DOWNLOAD_SCRIPT: "download-6-9-2-3.sh"
JSONRPC_HTTP_URL: ${{ github.event.inputs.jsonrpc_url }}
jobs:
finalize:
runs-on: ubuntu-22.04
steps:
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install g++ library dependencies
run: |
sudo apt update
sudo apt-get install build-essential libgmp-dev libsodium-dev nlohmann-json3-dev nasm g++ curl
- name: Checkout rapidsnark source code
uses: actions/checkout@v3
with:
repository: clrfund/rapidsnark
path: rapidsnark
- name: Install rapidsnark
run: |
cd $GITHUB_WORKSPACE/rapidsnark
npm install
git submodule init
git submodule update
./build_gmp.sh host
mkdir build_prover && cd build_prover
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package
make -j4 && make install
- name: Checkout source code
uses: actions/checkout@v3
with:
path: monorepo
- name: Download batch 64 params
run: |
ls -la $GITHUB_WORKSPACE
$GITHUB_WORKSPACE/monorepo/.github/scripts/${ZKEYS_DOWNLOAD_SCRIPT}
- name: Build
run: |
cd monorepo
# use https to avoid error: unable to connect to github.com
git config --global url."https://".insteadOf git://
yarn && yarn build
- name: Run finalize scripts
run: |
export CLRFUND_ADDRESS=${{ github.event.inputs.clrfund_address }}
export MACI_TX_HASH=${{ github.event.inputs.maci_tx_hash }}
export NETWORK=${{ github.event.inputs.network }}
export BLOCKS_PER_BATCH=${{ github.event.inputs.blocks_per_batch }}
export RAPID_SNARK="$GITHUB_WORKSPACE/rapidsnark/package/bin/prover"
export CIRCUIT_DIRECTORY=$GITHUB_WORKSPACE/params
# tally and finalize
cd monorepo/contracts
mkdir -p proof_output
yarn hardhat tally --clrfund "${CLRFUND_ADDRESS}" --network "${NETWORK}" \
--rapidsnark ${RAPID_SNARK} \
--params-dir ${CIRCUIT_DIRECTORY} \
--blocks-per-batch ${BLOCKS_PER_BATCH} \
--maci-tx-hash "${MACI_TX_HASH}" \
--proof-dir "./proof_output"
yarn hardhat --network "${NETWORK}" finalize --clrfund "${CLRFUND_ADDRESS}" \
--proof-dir "./proof_output"