mirror of
https://github.com/selfxyz/self.git
synced 2026-01-09 14:48:06 -05:00
Custom build circuit (#1242)
* feat: add serbia dsc to build * feat: add run-id to download artifacts * fix: circom dep import path
This commit is contained in:
12
.github/workflows/circuits-build.yml
vendored
12
.github/workflows/circuits-build.yml
vendored
@@ -20,6 +20,11 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
run-id:
|
||||
description: 'Run ID to download artifacts .'
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
concurrency:
|
||||
group: circuits-build-${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -30,6 +35,7 @@ jobs:
|
||||
runs-on: ["128ram"]
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
env:
|
||||
CIRCOM_VERSION: "2.1.9"
|
||||
CIRCOM_SHA256: "e5575829252d763b7818049df9de2ef9304df834697de77fa63ce7babc23c967"
|
||||
@@ -151,12 +157,12 @@ jobs:
|
||||
run: circom --version
|
||||
|
||||
- name: Download previous artifacts
|
||||
if: github.event_name == 'workflow_dispatch' && (inputs.circuit-type != '' || inputs.circuit-name != '')
|
||||
uses: actions/download-artifact@v4
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.run-id != ''
|
||||
uses: dawidd6/action-download-artifact@v6
|
||||
with:
|
||||
name: circuits
|
||||
path: output/
|
||||
continue-on-error: true
|
||||
run_id: ${{ inputs.run-id }}
|
||||
|
||||
- name: Build cpp circuits
|
||||
run: |
|
||||
|
||||
@@ -105,6 +105,7 @@ DSC_CIRCUITS=(
|
||||
"dsc_sha512_ecdsa_secp521r1:true"
|
||||
"dsc_sha512_rsa_65537_4096:true"
|
||||
"dsc_sha512_rsapss_65537_64_4096:true"
|
||||
"dsc_sha384_rsapss_65537_48_3072:true"
|
||||
)
|
||||
|
||||
if [[ $1 == "register" ]]; then
|
||||
@@ -163,9 +164,9 @@ for item in "${allowed_circuits[@]}"; do
|
||||
circuit_name="${filename%.*}"
|
||||
(
|
||||
circom $filepath \
|
||||
-l "node_modules" \
|
||||
-l "node_modules/@zk-kit/binary-merkle-root.circom/src" \
|
||||
-l "node_modules/circomlib/circuits" \
|
||||
-l "circuits/node_modules" \
|
||||
-l "circuits/node_modules/@zk-kit/binary-merkle-root.circom/src" \
|
||||
-l "circuits/node_modules/circomlib/circuits" \
|
||||
--O1 -c --output $output && \
|
||||
cd $output/${circuit_name}_cpp && \
|
||||
make
|
||||
|
||||
@@ -92,6 +92,7 @@ DSC_CIRCUITS=(
|
||||
"dsc_sha512_ecdsa_secp521r1:true"
|
||||
"dsc_sha512_rsa_65537_4096:true"
|
||||
"dsc_sha512_rsapss_65537_64_4096:true"
|
||||
"dsc_sha384_rsapss_65537_48_3072:true"
|
||||
)
|
||||
|
||||
if [[ $1 == "register" ]]; then
|
||||
|
||||
@@ -141,6 +141,7 @@ DSC_CIRCUITS=(
|
||||
"dsc_sha512_ecdsa_secp521r1"
|
||||
"dsc_sha512_rsa_65537_4096"
|
||||
"dsc_sha512_rsapss_65537_64_4096"
|
||||
"dsc_sha384_rsapss_65537_48_3072"
|
||||
)
|
||||
|
||||
# Extract circuit type
|
||||
@@ -226,9 +227,9 @@ fi
|
||||
|
||||
# Compile circuit and C++ code
|
||||
circom "$filepath" \
|
||||
-l "node_modules" \
|
||||
-l "node_modules/@zk-kit/binary-merkle-root.circom/src" \
|
||||
-l "node_modules/circomlib/circuits" \
|
||||
-l "circuits/node_modules" \
|
||||
-l "circuits/node_modules/@zk-kit/binary-merkle-root.circom/src" \
|
||||
-l "circuits/node_modules/circomlib/circuits" \
|
||||
--O1 -c --output "$output" && \
|
||||
cd "$output/${CIRCUIT_NAME}_cpp" && \
|
||||
make
|
||||
|
||||
Reference in New Issue
Block a user