From 9b224cf2caf379546565e71ed9549ea901fa47d6 Mon Sep 17 00:00:00 2001 From: benbierens Date: Thu, 29 Feb 2024 11:00:06 +0100 Subject: [PATCH 1/3] attempt to zip required circuit files before upload --- .github/workflows/generate.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 8fa5d88..f2d52c0 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -48,6 +48,9 @@ env: ceremony_source: https://storage.googleapis.com/zkevm/ptau/powersOfTau28_hez_final_21.ptau s3_bucket_path: proving-key circuit_file: workflow/build/proof_main.zkey + constraints_file: workflow/build/proof_main.r1cs + wasm_file: workflow/build/proof_main.wasm + zip_file: workflow/build/proof_circuit.zip storage_url: https://circuit.codex.storage jobs: @@ -132,12 +135,14 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} run: | + # Zip + zip ${{ env.zip_file }} ${{ env.circuit_file }} ${{ env.constraints_file }} ${{ env.wasm_file }} # Variables - hash=($(shasum -a 256 ${{ env.circuit_file }})) + hash=($(shasum -a 256 ${{ env.zip_file }})) [[ -z "${{ env.s3_bucket_path}}" ]] && storage_file="${hash}" || storage_file="${{ env.s3_bucket_path}}/${hash}" echo "storage_file=${storage_file}" >>$GITHUB_ENV # Upload - aws s3 cp ${{ env.circuit_file }} s3://${{ env.s3_bucket }}/${storage_file} --endpoint-url ${{ env.s3_endpoint }} + aws s3 cp ${{ env.zip_file }} s3://${{ env.s3_bucket }}/${storage_file} --endpoint-url ${{ env.s3_endpoint }} # Add hash to the assets echo "\"${hash}\"" > workflow/build/zkey_hash.json From d92db4d6d6cf8a7a54a0364b8381eb67d0f63dc5 Mon Sep 17 00:00:00 2001 From: benbierens Date: Thu, 29 Feb 2024 11:13:44 +0100 Subject: [PATCH 2/3] attempt to fix wasm path --- .github/workflows/generate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index f2d52c0..664f942 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -49,7 +49,7 @@ env: s3_bucket_path: proving-key circuit_file: workflow/build/proof_main.zkey constraints_file: workflow/build/proof_main.r1cs - wasm_file: workflow/build/proof_main.wasm + wasm_file: workflow/build/proof_main_js/proof_main.wasm zip_file: workflow/build/proof_circuit.zip storage_url: https://circuit.codex.storage @@ -136,7 +136,7 @@ jobs: AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} run: | # Zip - zip ${{ env.zip_file }} ${{ env.circuit_file }} ${{ env.constraints_file }} ${{ env.wasm_file }} + zip -q ${{ env.zip_file }} ${{ env.circuit_file }} ${{ env.constraints_file }} ${{ env.wasm_file }} # Variables hash=($(shasum -a 256 ${{ env.zip_file }})) [[ -z "${{ env.s3_bucket_path}}" ]] && storage_file="${hash}" || storage_file="${{ env.s3_bucket_path}}/${hash}" From c9f56c77c8a55dab27dc0c91e35d9f27ca116a34 Mon Sep 17 00:00:00 2001 From: benbierens Date: Thu, 29 Feb 2024 11:23:07 +0100 Subject: [PATCH 3/3] exclude paths from zip --- .github/workflows/generate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 664f942..ea7fae6 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -136,7 +136,7 @@ jobs: AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} run: | # Zip - zip -q ${{ env.zip_file }} ${{ env.circuit_file }} ${{ env.constraints_file }} ${{ env.wasm_file }} + zip -qj ${{ env.zip_file }} ${{ env.circuit_file }} ${{ env.constraints_file }} ${{ env.wasm_file }} # Variables hash=($(shasum -a 256 ${{ env.zip_file }})) [[ -z "${{ env.s3_bucket_path}}" ]] && storage_file="${hash}" || storage_file="${{ env.s3_bucket_path}}/${hash}"