Skip to content

Commit

Permalink
Update prover
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Nov 9, 2024
1 parent 92199b1 commit c0d11e1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 41 deletions.
40 changes: 20 additions & 20 deletions packages/prover/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,28 @@ RUN mkdir params
WORKDIR /root/params

RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth.zkey --output ./email_auth.zkey
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth.wasm --output ./email_auth.wasm
# RUN mkdir ./email_auth_cpp
# WORKDIR /root/params/email_auth_cpp
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/email_auth --output ./email_auth
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/Makefile --output ./Makefile
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/calcwit.cpp --output ./calcwit.cpp
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/calcwit.hpp --output ./calcwit.hpp
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/calcwit.o --output ./calcwit.o
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/circom.hpp --output ./circom.hpp
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/email_auth.cpp --output ./email_auth.cpp
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/email_auth.dat --output ./email_auth.dat
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr.asm --output ./fr.asm
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr.cpp --output ./fr.cpp
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr.hpp --output ./fr.hpp
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr.o --output ./fr.o
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr_asm.o --output ./fr_asm.o
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/main.cpp --output ./main.cpp
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/main.o --output ./main.o
# RUN chmod +x ./email_auth
# RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth.wasm --output ./email_auth.wasm
RUN mkdir ./email_auth_cpp
WORKDIR /root/params/email_auth_cpp
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/email_auth --output ./email_auth
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/Makefile --output ./Makefile
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/calcwit.cpp --output ./calcwit.cpp
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/calcwit.hpp --output ./calcwit.hpp
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/calcwit.o --output ./calcwit.o
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/circom.hpp --output ./circom.hpp
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/email_auth.cpp --output ./email_auth.cpp
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/email_auth.dat --output ./email_auth.dat
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr.asm --output ./fr.asm
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr.cpp --output ./fr.cpp
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr.hpp --output ./fr.hpp
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr.o --output ./fr.o
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr_asm.o --output ./fr_asm.o
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/main.cpp --output ./main.cpp
RUN curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/main.o --output ./main.o
RUN chmod +x ./email_auth
WORKDIR /root
RUN ls params
# RUN ls params/email_auth_cpp
RUN ls params/email_auth_cpp
RUN chmod +x circom_proofgen.sh
RUN mkdir build

Expand Down
8 changes: 4 additions & 4 deletions packages/prover/circom_proofgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public_path="${buildDir}/rapidsnark_public_${circuitName}_${nonce}.json"
cd "${SCRIPT_DIR}"
echo "entered zk email path: ${SCRIPT_DIR}"

# ${paramsDir}/${circuitName}_cpp/${circuitName} "${input_path}" "${witness_path}"
echo "NODE_OPTIONS='--max-old-space-size=644000' snarkjs wc "${paramsDir}/${circuitName}.wasm" "${input_path}" "${witness_path}""
NODE_OPTIONS='--max-old-space-size=644000' snarkjs wc "${paramsDir}/${circuitName}.wasm" "${input_path}" "${witness_path}" | tee /dev/stderr
${paramsDir}/${circuitName}_cpp/${circuitName} "${input_path}" "${witness_path}"
# echo "NODE_OPTIONS='--max-old-space-size=644000' snarkjs wc "${paramsDir}/${circuitName}.wasm" "${input_path}" "${witness_path}""
# NODE_OPTIONS='--max-old-space-size=644000' snarkjs wc "${paramsDir}/${circuitName}.wasm" "${input_path}" "${witness_path}" | tee /dev/stderr
status_jswitgen=$?
echo "✓ Finished witness generation with wasm! ${status_jswitgen}"
echo "✓ Finished witness generation with c++! ${status_jswitgen}"

if [ $isLocal = 1 ]; then
# DEFAULT SNARKJS PROVER (SLOW)
Expand Down
32 changes: 16 additions & 16 deletions packages/prover/local_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ npm install -g snarkjs@latest
pip install -r requirements.txt
mkdir build && cd build
# gdown "https://drive.google.com/uc?id=1XDPFIL5YK8JzLGoTjmHLXO9zMDjSQcJH"
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.1/email_auth.zkey --output ./email_auth.zkey
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth.zkey --output ./email_auth.zkey
mkdir ./email_auth_cpp
cd ./email_auth_cpp
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth --output ./email_auth
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/Makefile --output ./Makefile
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/calcwit.cpp --output ./calcwit.cpp
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/calcwit.hpp --output ./calcwit.hpp
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/calcwit.o --output ./calcwit.o
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/circom.hpp --output ./circom.hpp
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/email_auth.cpp --output ./email_auth.cpp
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/email_auth.dat --output ./email_auth.dat
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr.asm --output ./fr.asm
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr.cpp --output ./fr.cpp
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr.hpp --output ./fr.hpp
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr.o --output ./fr.o
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/fr_asm.o --output ./fr_asm.o
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/main.cpp --output ./main.cpp
curl https://storage.googleapis.com/circom-ether-email-auth/v2.0.1-preview/email_auth_cpp/main.o --output ./main.o
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth --output ./email_auth
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/Makefile --output ./Makefile
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/calcwit.cpp --output ./calcwit.cpp
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/calcwit.hpp --output ./calcwit.hpp
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/calcwit.o --output ./calcwit.o
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/circom.hpp --output ./circom.hpp
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/email_auth.cpp --output ./email_auth.cpp
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/email_auth.dat --output ./email_auth.dat
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr.asm --output ./fr.asm
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr.cpp --output ./fr.cpp
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr.hpp --output ./fr.hpp
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr.o --output ./fr.o
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/fr_asm.o --output ./fr_asm.o
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/main.cpp --output ./main.cpp
curl https://storage.googleapis.com/circom-ether-email-auth/v1.0.2/email_auth_cpp/main.o --output ./main.o
chmod +x ./email_auth
cd ../../
# unzip params.zip
Expand Down
3 changes: 2 additions & 1 deletion packages/prover/modal_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
mounts=[
modal.Mount.from_local_python_packages("core"),
],
cpu=1,
cpu=2,
gpu="t4",
secrets=[modal.Secret.from_name("gc-ether-email-auth-prover")],
keep_warm=True,
timeout=3600,
)
@modal.wsgi_app()
def flask_app():
Expand Down

0 comments on commit c0d11e1

Please sign in to comment.