Skip to content

Commit bbb122d

Browse files
feat: lazy pkey downloader (#1977)
* feat: move proving keys management into cli * keys downloader * refactor: integrate dynamic proving key management * fix: update artifact path in prover-test workflow * fix: update artifact path in prover-test workflow * fix: add read permissions to prover-test workflow * fix: update Go setup and add linux/arm64 support in prover-release workflow * refactor: remove buildProver script and integrate dynamic prover binary management in CLI * feat: add utility to download prover binary * fix: update getProverNameByArch * fix: correct getProverNameByArch implementation * fix: add missing commas in downloadProverBinary and processProverServer * feat: lazy prover # Conflicts: # sdk-libs/program-test/src/program_test/config.rs * update prover version to 1.0.1 * fix * remove prover configuration from local test validator * feat: implement thread-safe checksum cache management * fix * preload keys for lazy test * preload test keys for lazy test * preload test keys for lazy test * fix * fix * increase default max wait time to 900 seconds * start queue workers for redis queue * bump prover version to 1.0.2 * restore download_keys.sh * chmod +x download_keys.sh * remove ProverConfig * remove build-ci & test-ci workflow cmds * use go key downloader * refactor key path construction to use filepath * add error handling for directory change in download-gnark-keys.sh * add redirect handling with limit in downloadFile function * add error handling for gnark keys download in download-gnark-keys.sh * update preload-keys * bump prover version * remove unused run mode handling * bump prover version
1 parent 7aeb921 commit bbb122d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1850
-1156
lines changed

.github/actions/setup-and-build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ runs:
118118
uses: actions/cache@v4
119119
with:
120120
path: prover/server/proving-keys
121-
key: ${{ runner.os }}-proving-keys-${{ inputs.cache-suffix }}${{ inputs.cache-suffix && '-' || '' }}${{ hashFiles('prover/server/scripts/download_keys.sh') }}
121+
key: ${{ runner.os }}-proving-keys-${{ inputs.cache-suffix }}${{ inputs.cache-suffix && '-' || '' }}${{ hashFiles('prover/server/prover/common/key_downloader.go', 'prover/server/prover/common/proving_keys_utils.go') }}
122122

123123
- name: Download proving keys
124124
if: "!contains(inputs.skip-components, 'proving-keys') && steps.cache-keys.outputs.cache-hit != 'true'"

.github/workflows/cli-v1.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ jobs:
4949
skip-components: "redis,disk-cleanup"
5050
cache-suffix: "js"
5151

52-
- name: Build CLI with V1 (CI mode - Linux x64 only)
52+
- name: Build CLI
5353
run: |
54-
npx nx build-ci @lightprotocol/zk-compression-cli
54+
npx nx build @lightprotocol/zk-compression-cli
5555
5656
- name: Run CLI tests with V1
5757
run: |
58-
npx nx test-ci @lightprotocol/zk-compression-cli
58+
npx nx test @lightprotocol/zk-compression-cli
5959
6060
- name: Display prover logs on failure
6161
if: failure()

.github/workflows/cli-v2.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ jobs:
5959
cd js/compressed-token
6060
pnpm build:v2
6161
62-
- name: Build CLI with V2 (CI mode - Linux x64 only)
62+
- name: Build CLI with V2
6363
run: |
64-
npx nx build-ci @lightprotocol/zk-compression-cli
64+
npx nx build @lightprotocol/zk-compression-cli
6565
6666
- name: Run CLI tests with V2
6767
run: |
68-
npx nx test-ci @lightprotocol/zk-compression-cli
68+
npx nx test @lightprotocol/zk-compression-cli
6969
7070
- name: Display prover logs on failure
7171
if: failure()

.github/workflows/forester-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ jobs:
7474
df -h /
7575
du -sh /home/runner/work/* | sort -hr | head -n 10
7676
77-
- name: Build CLI (CI mode - Linux x64 only)
78-
run: npx nx build-ci @lightprotocol/zk-compression-cli
77+
- name: Build CLI
78+
run: npx nx build @lightprotocol/zk-compression-cli
7979

8080
- name: Test
8181
run: cargo test --package forester e2e_test -- --nocapture

.github/workflows/js-v2.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ jobs:
5959
cd js/compressed-token
6060
pnpm build:v2
6161
62-
- name: Build CLI (CI mode - Linux x64 only)
62+
- name: Build CLI
6363
run: |
64-
npx nx build-ci @lightprotocol/zk-compression-cli
64+
npx nx build @lightprotocol/zk-compression-cli
6565
6666
- name: Run stateless.js tests with V2
6767
run: |
6868
echo "Running stateless.js tests with retry logic (max 2 attempts)..."
6969
attempt=1
7070
max_attempts=2
71-
until npx nx test-ci @lightprotocol/stateless.js; do
71+
until npx nx test @lightprotocol/stateless.js; do
7272
attempt=$((attempt + 1))
7373
if [ $attempt -gt $max_attempts ]; then
7474
echo "Tests failed after $max_attempts attempts"
@@ -84,7 +84,7 @@ jobs:
8484
echo "Running compressed-token tests with retry logic (max 2 attempts)..."
8585
attempt=1
8686
max_attempts=2
87-
until npx nx test-ci @lightprotocol/compressed-token; do
87+
until npx nx test @lightprotocol/compressed-token; do
8888
attempt=$((attempt + 1))
8989
if [ $attempt -gt $max_attempts ]; then
9090
echo "Tests failed after $max_attempts attempts"

.github/workflows/js.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ jobs:
5959
cd js/compressed-token
6060
pnpm build:v1
6161
62-
- name: Build CLI (CI mode - Linux x64 only)
62+
- name: Build CLI
6363
run: |
64-
npx nx build-ci @lightprotocol/zk-compression-cli
64+
npx nx build @lightprotocol/zk-compression-cli
6565
6666
- name: Run stateless.js tests with V1
6767
run: |
6868
echo "Running stateless.js tests with retry logic (max 2 attempts)..."
6969
attempt=1
7070
max_attempts=2
71-
until npx nx test-ci @lightprotocol/stateless.js; do
71+
until npx nx test @lightprotocol/stateless.js; do
7272
attempt=$((attempt + 1))
7373
if [ $attempt -gt $max_attempts ]; then
7474
echo "Tests failed after $max_attempts attempts"
@@ -84,7 +84,7 @@ jobs:
8484
echo "Running compressed-token tests with retry logic (max 2 attempts)..."
8585
attempt=1
8686
max_attempts=2
87-
until npx nx test-ci @lightprotocol/compressed-token; do
87+
until npx nx test @lightprotocol/compressed-token; do
8888
attempt=$((attempt + 1))
8989
if [ $attempt -gt $max_attempts ]; then
9090
echo "Tests failed after $max_attempts attempts"

.github/workflows/light-system-programs-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ jobs:
8484
skip-components: "redis,disk-cleanup"
8585
cache-suffix: "system-programs"
8686

87-
- name: Build CLI (CI mode - Linux x64 only)
87+
- name: Build CLI
8888
run: |
89-
npx nx build-ci @lightprotocol/zk-compression-cli
89+
npx nx build @lightprotocol/zk-compression-cli
9090
9191
- name: ${{ matrix.program }}
9292
run: |

.github/workflows/prover-release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,23 @@ jobs:
1414
- name: Set up Go
1515
uses: actions/setup-go@v6
1616
with:
17-
go-version: 1.21
17+
go-version-file: "./prover/server/go.mod"
1818

1919
- name: Build artifacts
2020
run: |
2121
cd prover/server
22-
for cfgstr in "darwin amd64" "darwin arm64" "linux amd64" "windows amd64"; do
22+
for cfgstr in "darwin amd64" "darwin arm64" "linux amd64" "linux arm64" "windows amd64"; do
2323
IFS=' ' read -r -a cfg <<< "$cfgstr"
2424
export GOOS="${cfg[0]}"
2525
export GOARCH="${cfg[1]}"
2626
export CGO_ENABLED=0
27-
go build -o prover-"$GOOS"-"$GOARCH"
27+
28+
ext=""
29+
if [ "$GOOS" = "windows" ]; then
30+
ext=".exe"
31+
fi
32+
33+
go build -o prover-"$GOOS"-"$GOARCH""$ext"
2834
done
2935
3036
- name: Create Release
@@ -34,4 +40,5 @@ jobs:
3440
prover/server/prover-darwin-amd64
3541
prover/server/prover-darwin-arm64
3642
prover/server/prover-linux-amd64
37-
prover/server/prover-windows-amd64
43+
prover/server/prover-linux-arm64
44+
prover/server/prover-windows-amd64.exe

0 commit comments

Comments
 (0)