maci
maci copied to clipboard
Couldn't deploy MACI on goerli network
Deploying MACI to other networks (e.g. Arbitrum testnet, local hardhat network, ephemeral geth network) succeed, but failed to deploy to goerli network with following error:
node build/index.js create --vk-registry "$VK_REGISTRY_ADDRESS"
Deploying InitialVoiceCreditProxy
Deploying Poseidon contracts
/home/ubuntu/maci/cli/node_modules/@ethersproject/logger/src.ts/index.ts:225
const error: any = new Error(message);
^
Error: replacement fee too low (error={"name":"ProviderError","code":-32000,"_isProviderError":true}, method="sendTransaction", transaction=undefined, code=REPLACEMENT_UNDERPRICED, version=providers/5.5.3)
at Logger.makeError (/home/ubuntu/maci/cli/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
at Logger.throwError (/home/ubuntu/maci/cli/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
at checkError (/home/ubuntu/maci/cli/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:67:16)
at /home/ubuntu/maci/cli/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:215:24
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Reproduce
You should first configure hardhat.config.js
file to goerli network be used in following commands. And then run following commands:
git config --global url."https://github.com/".insteadOf git://github.com/
git clone https://github.com/appliedzkp/maci
cd maci
git checkout v1
# To prevent `npm install` failure of circuit package,
# it has to checkout manually because version of `circomlib` has pinned to a specific commit
mkdir -p circuits/node_modules
cd circuits/node_modules
git init circomlib
cd circomlib
git remote add origin https://github.com/weijiekoh/circomlib
git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin ac85e82c1914d47789e2032fb11ceb2cfdd38a2b
git checkout --progress --force ac85e82c1914d47789e2032fb11ceb2cfdd38a2b
rm -rf ./.git
# Setup maci repo
cd ../../..
npm install
npx lerna bootstrap --no-ci
npm run build
# Compile contracts
cd contracts
npm run compileSol
RAPIDSNARK_LINK=https://maci-devops-zkeys.s3.ap-northeast-2.amazonaws.com/rapidsnark-linux-amd64-1c137
RAPIDSNARK_PATH=~/rapidsnark/build
echo 'Install rapidsnark (1c137)'
# Download rapidsnark (1c137)
mkdir -p "$RAPIDSNARK_PATH"
wget -qO "$RAPIDSNARK_PATH"/prover "$RAPIDSNARK_LINK"
chmod +x "$RAPIDSNARK_PATH"/prover
ZKEYS_LINK=https://maci-devops.s3.ap-northeast-2.amazonaws.com/zkeys_glibc-211.tar.gz
ZKEYS_FILE_NAME=zkeys.tar.gz
ZKEYS_PARAMS='10-2-1-2'
ZKEYS_GLIBC='2.11'
echo 'Download zkeys. params: "$ZKEYS_PARAMS", GLIBC version: "$ZKEYS_GLIBC"'
# Download zkeys (development parameter)
# stateTreeDepth: 10
# msgTreeDepth: 2
# msgBatchDepth: 1
# voteOptionTreeDepth: 2
#
cd ../cli
wget -qO "$ZKEYS_FILE_NAME" "$ZKEYS_LINK"
tar -xzvf "$ZKEYS_FILE_NAME"
node build/index.js deployVkRegistry
# export VkRegistry address to env var to run following commands:
node build/index.js setVerifyingKeys -s 10 -i 1 -m 2 -v 2 -b 1 \
-p ./zkeys/ProcessMessages_10-2-1-2_test.0.zkey \
-t ./zkeys/TallyVotes_10-1-2_test.0.zkey \
--vk_registry "$VK_REGISTRY_ADDRESS"
node build/index.js create \
--vk-registry "$VK_REGISTRY_ADDRESS"