-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: use GPU for proving * chore: update Dockerfile * chore: cleanup * chore: update params.zip * chore: update circom_proofgen.sh * chore: update
- Loading branch information
Showing
7 changed files
with
74 additions
and
85 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,49 +1,66 @@ | ||
FROM python:3.10 | ||
FROM nvidia/cuda:12.4.0-devel-ubuntu22.04 | ||
|
||
RUN apt-get update && apt-get upgrade -y | ||
# Update the package list and install necessary dependencies | ||
RUN apt-get update && \ | ||
apt install -y cmake build-essential pkg-config libssl-dev libgmp-dev libsodium-dev nasm git awscli gcc nodejs npm | ||
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ | ||
cmake \ | ||
build-essential \ | ||
pkg-config \ | ||
libssl-dev \ | ||
libgmp-dev \ | ||
libffi-dev \ | ||
libsodium-dev \ | ||
nasm \ | ||
git \ | ||
awscli \ | ||
gcc \ | ||
nodejs \ | ||
npm \ | ||
curl \ | ||
m4 \ | ||
python3 \ | ||
python3-pip \ | ||
python3-dev \ | ||
wget \ | ||
software-properties-common \ | ||
unzip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set Python 3 as the default python version | ||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \ | ||
&& update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 | ||
|
||
# Node install | ||
RUN npm install -g n | ||
RUN n 18 | ||
RUN n 22 | ||
RUN npm install -g yarn snarkjs | ||
RUN git clone -b feat/body-parsing-circuit https://github.com/zkemail/ether-email-auth.git | ||
|
||
RUN git clone -b feat/gpu https://github.com/zkemail/ether-email-auth.git | ||
WORKDIR /ether-email-auth/packages/prover | ||
RUN pip install -r requirements.txt | ||
RUN cp ./circom_proofgen.sh /root | ||
WORKDIR /root | ||
RUN ls /root | ||
# RUN mkdir params | ||
# RUN cp /email-wallet/packages/prover/params/account_creation.wasm /root/params | ||
# RUN cp /email-wallet/packages/prover/params/account_init.wasm /root/params | ||
# RUN cp /email-wallet/packages/prover/params/account_transport.wasm /root/params | ||
# RUN cp /email-wallet/packages/prover/params/claim.wasm /root/params | ||
# RUN cp /email-wallet/packages/prover/params/email_sender.wasm /root/params | ||
RUN mkdir params | ||
WORKDIR /root/params | ||
RUN gdown "https://drive.google.com/uc?id=1XDPFIL5YK8JzLGoTjmHLXO9zMDjSQcJH" | ||
RUN gdown "https://drive.google.com/uc?id=1l3mNqFYv-YZc2efFlphFUkoaCnGCxFtE" | ||
RUN unzip params.zip | ||
RUN mv params/* /root/params | ||
WORKDIR /root | ||
RUN ls params | ||
# RUN mv build params | ||
# RUN curl https://email-wallet-trusted-setup-ceremony-pse-p0tion-production.s3.eu-central-1.amazonaws.com/circuits/emailwallet-account-creation/contributions/emailwallet-account-creation_00019.zkey --output ./params/account_creation.zkey | ||
# RUN curl https://email-wallet-trusted-setup-ceremony-pse-p0tion-production.s3.eu-central-1.amazonaws.com/circuits/emailwallet-account-init/contributions/emailwallet-account-init_00007.zkey --output ./params/account_init.zkey | ||
# RUN curl https://email-wallet-trusted-setup-ceremony-pse-p0tion-production.s3.eu-central-1.amazonaws.com/circuits/emailwallet-account-transport/contributions/emailwallet-account-transport_00005.zkey --output ./params/account_transport.zkey | ||
# RUN curl https://email-wallet-trusted-setup-ceremony-pse-p0tion-production.s3.eu-central-1.amazonaws.com/circuits/emailwallet-claim/contributions/emailwallet-claim_00006.zkey --output ./params/claim.zkey | ||
# RUN curl https://email-wallet-trusted-setup-ceremony-pse-p0tion-production.s3.eu-central-1.amazonaws.com/circuits/emailwallet-email-sender/contributions/emailwallet-email-sender_00006.zkey --output ./params/email_sender.zkey | ||
RUN chmod +x circom_proofgen.sh | ||
RUN mkdir build | ||
|
||
RUN git clone https://github.com/iden3/rapidsnark-old.git rapidsnark | ||
RUN git clone https://github.com/Orbiter-Finance/rapidsnark.git rapidsnark | ||
WORKDIR /root/rapidsnark | ||
RUN yarn | ||
RUN git submodule init | ||
RUN git submodule update | ||
RUN npx task createFieldSources | ||
RUN npx task buildPistache | ||
RUN npx task buildProver | ||
RUN chmod +x build/prover | ||
RUN ./build_gmp.sh host | ||
RUN mkdir build_prover | ||
WORKDIR /root/rapidsnark/build_prover | ||
RUN cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package -DNVML_LIBRARY=/usr/local/cuda-12.4/targets/x86_64-linux/lib/stubs/libnvidia-ml.so | ||
RUN make -j$(nproc) && make install | ||
RUN chmod +x ../package/bin/prover_cuda | ||
WORKDIR /root |
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