-
Notifications
You must be signed in to change notification settings - Fork 28
1400 lines (1207 loc) · 51.1 KB
/
Copy pathci.yml
File metadata and controls
1400 lines (1207 loc) · 51.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: ci
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches:
- main
- dev
env:
SUPPORT_DOCKERFILE_PATH: crates/support/Dockerfile
CIPHERNODE_DOCKERFILE_PATH: crates/Dockerfile
SUPPORT_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/e3-support
CIPHERNODE_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/ciphernode
NODE_VERSION: 22
RUST_TOOLCHAIN: 1.91.1
NOIR_TOOLCHAIN: v1.0.0-beta.26
BB_VERSION: 5.1.0
HARDHAT_VAR_MNEMONIC: 'test test test test test test test test test test test junk'
HARDHAT_VAR_INFURA_API_KEY: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
PRIVATE_KEY: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
RUST_BACKTRACE: 1
permissions:
contents: read
packages: write
jobs:
detect_changes:
timeout-minutes: 5
runs-on: 'ubuntu-latest'
outputs:
rust_unit_tests: ${{ steps.jobs.outputs.rust_unit_tests }}
rust_integration_tests: ${{ steps.jobs.outputs.rust_integration_tests }}
ciphernode_e2e: ${{ steps.jobs.outputs.ciphernode_e2e }}
crisp: ${{ steps.jobs.outputs.crisp }}
templates: ${{ steps.jobs.outputs.templates }}
zk: ${{ steps.jobs.outputs.zk }}
contracts: ${{ steps.jobs.outputs.contracts }}
docker_support: ${{ steps.jobs.outputs.docker_support }}
docker_ciphernode: ${{ steps.jobs.outputs.docker_ciphernode }}
net: ${{ steps.jobs.outputs.net }}
init: ${{ steps.jobs.outputs.init }}
build_sdk: ${{ steps.jobs.outputs.build_sdk }}
build_e3_support_dev: ${{ steps.jobs.outputs.build_e3_support_dev }}
build_circuits: ${{ steps.jobs.outputs.build_circuits }}
integration_prebuild: ${{ steps.jobs.outputs.integration_prebuild }}
zk_prover_integration: ${{ steps.jobs.outputs.zk_prover_integration }}
build_interfold_cli: ${{ steps.jobs.outputs.build_interfold_cli }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: dorny/paths-filter@6852f92c20ea7fd3b0c25de3b5112db3a98da050 # v3
id: filter
with:
filters: |
rust:
- 'crates/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain.toml'
contracts:
- 'packages/interfold-contracts/**'
# The manifest is generated from deployed_contracts.json and
# verified by `gen:manifest:check` in test_contracts. Without this
# path a hand-edited manifest never runs the drift check and
# reaches the release assets stale.
- 'deployments/**'
circuits:
- 'circuits/**'
- 'scripts/*-circuits.sh'
crisp:
- 'examples/CRISP/**'
templates:
- 'templates/**'
sdk:
- 'packages/interfold-sdk/**'
- 'packages/interfold-react/**'
- 'packages/interfold-config/**'
- 'crates/wasm/**'
integration_tests:
- 'tests/integration/**'
docker:
- 'crates/Dockerfile'
- 'crates/support/Dockerfile'
- 'crates/support/**'
ci:
- '.github/**'
- name: Compute job filters
id: jobs
run: |
RUST="${{ steps.filter.outputs.rust }}"
CONTRACTS="${{ steps.filter.outputs.contracts }}"
CIRCUITS="${{ steps.filter.outputs.circuits }}"
CRISP="${{ steps.filter.outputs.crisp }}"
TEMPLATES="${{ steps.filter.outputs.templates }}"
SDK="${{ steps.filter.outputs.sdk }}"
INTEGRATION="${{ steps.filter.outputs.integration_tests }}"
DOCKER="${{ steps.filter.outputs.docker }}"
CI="${{ steps.filter.outputs.ci }}"
FORCE="${{ github.event_name == 'workflow_dispatch' }}"
any() { for v in "$@"; do [ "$v" = "true" ] && echo "true" && return; done; echo "false"; }
echo "rust_unit_tests=$(any $FORCE $RUST $CONTRACTS $CIRCUITS $CI)" >> $GITHUB_OUTPUT
echo "rust_integration_tests=$(any $FORCE $RUST $CONTRACTS $CIRCUITS $CI)" >> $GITHUB_OUTPUT
echo "ciphernode_e2e=$(any $FORCE $RUST $CONTRACTS $CIRCUITS $INTEGRATION $CI)" >> $GITHUB_OUTPUT
echo "build_sdk=$(any $FORCE $RUST $CONTRACTS $SDK $INTEGRATION $CIRCUITS $CI $TEMPLATES)" >> $GITHUB_OUTPUT
echo "crisp=$(any $FORCE $CRISP $CONTRACTS $CIRCUITS $RUST $CI)" >> $GITHUB_OUTPUT
echo "templates=$(any $FORCE $TEMPLATES $CI)" >> $GITHUB_OUTPUT
echo "zk=$(any $FORCE $RUST $CIRCUITS $CI)" >> $GITHUB_OUTPUT
echo "contracts=$(any $FORCE $CONTRACTS $CI)" >> $GITHUB_OUTPUT
echo "docker_support=$(any $FORCE $DOCKER $CI)" >> $GITHUB_OUTPUT
echo "docker_ciphernode=$(any $FORCE $RUST $DOCKER $CI $CONTRACTS)" >> $GITHUB_OUTPUT
echo "net=$(any $FORCE $INTEGRATION $CI)" >> $GITHUB_OUTPUT
echo "init=$(any $FORCE $TEMPLATES $RUST $CONTRACTS $CI)" >> $GITHUB_OUTPUT
echo "build_e3_support_dev=$(any $FORCE $TEMPLATES $RUST $CONTRACTS $SDK $CI)" >> $GITHUB_OUTPUT
echo "build_circuits=$(any $FORCE $RUST $CIRCUITS $CI)" >> $GITHUB_OUTPUT
echo "integration_prebuild=$(any $FORCE $RUST $CONTRACTS $CIRCUITS $INTEGRATION $CI)" >> $GITHUB_OUTPUT
echo "zk_prover_integration=$(any $FORCE $RUST $CIRCUITS $CI)" >> $GITHUB_OUTPUT
echo "build_interfold_cli=$(any $FORCE $RUST $CONTRACTS $CIRCUITS $INTEGRATION $TEMPLATES $CRISP $CI)" >> $GITHUB_OUTPUT
rust_unit_tests:
needs: [detect_changes]
if: needs.detect_changes.outputs.rust_unit_tests == 'true'
timeout-minutes: 20
runs-on: 'ubuntu-latest'
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Cache Rust dependencies
uses: ./.github/actions/cache-dependencies
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1
- name: Install solc
run: |
sudo add-apt-repository ppa:ethereum/ethereum \
&& sudo apt-get update -y \
&& sudo apt-get install -y solc protobuf-compiler
- name: pnpm-setup
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
# We need to setup node in order to compile the hardhat contracts to get the artifacts
- name: 'Setup node'
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: 'Install the dependencies'
run: 'pnpm install --frozen-lockfile'
- name: Checking code format rust
run: pnpm rust:lint
- name: Compile contracts for ABI catalog tests
run: pnpm evm:build
- name: Run Unit Tests
run: 'cargo test --lib && cargo test --doc'
- name: Cancel workflow on failure
if: failure()
run: gh run cancel ${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}
rust_integration_tests:
needs: [detect_changes, integration_prebuild]
if: needs.detect_changes.outputs.rust_integration_tests == 'true'
timeout-minutes: 45
runs-on:
group: enclave-ci
labels: [enclave-ci-runner]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Cache Rust dependencies
uses: ./.github/actions/cache-dependencies
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1
- name: Install solc
run: |
sudo add-apt-repository ppa:ethereum/ethereum \
&& sudo apt-get update -y \
&& sudo apt-get install -y solc protobuf-compiler
- name: pnpm-setup
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- name: 'Setup node'
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: 'Install the dependencies'
run: 'pnpm install --frozen-lockfile'
- name: Download source-aligned ZK fixtures
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: integration-noir-artifacts
path: .ci-noir/
- name: Stage source-aligned circuit fixtures
run: |
chmod +x .ci-noir/bin/bb
mkdir -p dist/circuits/insecure-512
cp -R .ci-noir/circuits/insecure-512/minimum dist/circuits/insecure-512/
- name: Run Integration Tests
env:
CIPHERNODE_SKIP_PROOF_AGGREGATION: 'true'
E3_CUSTOM_BB: ${{ github.workspace }}/.ci-noir/bin/bb
run: 'cargo test --test integration -- --nocapture'
zk_prover_integration:
needs: [detect_changes]
if: needs.detect_changes.outputs.zk_prover_integration == 'true'
timeout-minutes: 30
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Cache Rust dependencies
uses: ./.github/actions/cache-dependencies
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Install solc
run: |
sudo add-apt-repository ppa:ethereum/ethereum \
&& sudo apt-get update -y \
&& sudo apt-get install -y solc protobuf-compiler
- name: pnpm-setup
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- name: 'Setup node'
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: 'Install the dependencies'
run: 'pnpm install --frozen-lockfile'
- name: Cache Barretenberg binary
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.bb
key: bb-${{ env.BB_VERSION }}-${{ runner.arch }}
- name: Run ZK Prover Integration Tests (with network downloads)
run: 'cargo test -p e3-zk-prover --features integration-tests --test integration_tests -- --nocapture'
build_e3_support_risc0:
needs: [detect_changes]
if: needs.detect_changes.outputs.docker_support == 'true'
timeout-minutes: 30
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Generate tags
id: tags
run: |
SHORT_SHA=$(git rev-parse --short=9 HEAD)
TAGS="${SUPPORT_IMAGE_NAME}:${SHORT_SHA}"
if [ "${GITHUB_REF}" = "refs/heads/main" ]; then
TAGS="$TAGS,${SUPPORT_IMAGE_NAME}:main"
fi
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Set up BuildKit
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: ./crates/support
file: ${{ env.SUPPORT_DOCKERFILE_PATH }}
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.tags.outputs.tags }}
cache-from: |
type=gha,scope=e3-support
cache-to: |
type=gha,mode=max,scope=e3-support
build_ciphernode_image:
needs: [detect_changes]
if: needs.detect_changes.outputs.docker_ciphernode == 'true'
timeout-minutes: 60
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Generate tags
id: tags
run: |
SHORT_SHA=$(git rev-parse --short=9 HEAD)
TAGS="${CIPHERNODE_IMAGE_NAME}:${SHORT_SHA}"
if [ "${GITHUB_REF}" = "refs/heads/main" ]; then
TAGS="$TAGS,${CIPHERNODE_IMAGE_NAME}:main"
fi
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Set up Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Log in to GitHub Container Registry
if: github.ref == 'refs/heads/main'
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build ciphernode image
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: .
file: ${{ env.CIPHERNODE_DOCKERFILE_PATH }}
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.tags.outputs.tags }}
cache-from: |
type=gha,scope=ciphernode
cache-to: |
type=gha,mode=max,scope=ciphernode
test_contracts:
needs: [detect_changes]
if: needs.detect_changes.outputs.contracts == 'true'
timeout-minutes: 15
runs-on: 'ubuntu-latest'
permissions:
contents: read
actions: write
steps:
- name: 'Check out the repo'
uses: 'actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10' # v6
- name: pnpm-setup
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- name: 'Setup node'
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: 'Install the dependencies'
run: 'pnpm install --frozen-lockfile'
- name: 'Lint the code'
run: 'pnpm evm:lint'
- name: 'Add lint summary'
run: |
echo "## Lint results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
- name: 'Enforce production contract size budget'
run: 'pnpm --filter @interfold/contracts size:check'
- name: 'Validate upgrade storage layouts'
run: 'pnpm --filter @interfold/contracts validate:upgrade'
# The manifest is what operators fetch to detect a redeploy, so it must
# never lag deployed_contracts.json.
- name: 'Check the deployment manifest is up to date'
run: 'pnpm --filter @interfold/contracts gen:manifest:check'
- name: 'Test the contracts and generate the coverage report'
run: 'pnpm coverage'
- name: 'Add test summary'
run: |
echo "## Test results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
- name: Cancel workflow on failure
if: failure()
run: gh run cancel ${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}
test_net:
needs: [detect_changes]
if: needs.detect_changes.outputs.net == 'true'
timeout-minutes: 15
runs-on: 'ubuntu-latest'
steps:
- name: 'Check out the repo'
uses: 'actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10' # v6
- name: 'Run network tests'
working-directory: tests/integration
run: './test.sh net --no-prebuild'
- name: 'Add test summary'
run: |
echo "## Network test results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
integration_prebuild:
needs: [detect_changes]
if: needs.detect_changes.outputs.integration_prebuild == 'true'
timeout-minutes: 30
runs-on: 'ubuntu-latest'
steps:
- name: 'Check out the repo'
uses: 'actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10' # v6
- name: Cache Rust dependencies
uses: ./.github/actions/cache-dependencies
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: pnpm-setup
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- name: 'Setup node'
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install Nargo
uses: noir-lang/noirup@7dbe69ccc78877f0200ffa5a40836c953d2cfd8f # v0.1.4
with:
toolchain: ${{ env.NOIR_TOOLCHAIN }}
- name: Cache Barretenberg binary
id: cache-integration-bb
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: /usr/local/bin/bb
key: bb-bin-${{ env.BB_VERSION }}-amd64-linux
- name: Install Barretenberg (bb)
if: steps.cache-integration-bb.outputs.cache-hit != 'true'
run: |
curl -fsSL "https://github.com/AztecProtocol/aztec-packages/releases/download/v${{ env.BB_VERSION }}/barretenberg-amd64-linux.tar.gz" -o bb.tar.gz
mkdir -p bb_extract && tar -xzf bb.tar.gz -C bb_extract
BB_BIN=$(find bb_extract -name bb -type f | head -n 1)
sudo mv "$BB_BIN" /usr/local/bin/bb
chmod +x /usr/local/bin/bb
- name: Install solc
run: |
sudo add-apt-repository ppa:ethereum/ethereum \
&& sudo apt-get update -y \
&& sudo apt-get install -y solc protobuf-compiler
- name: 'Install the dependencies'
run: 'pnpm install --frozen-lockfile'
- name: 'Run prebuild'
run: 'pnpm test:integration prebuild'
- name: 'Verify build artifacts exist'
run: |
echo "Checking for build artifacts:"
ls -la target/debug/fake_encrypt || echo "fake_encrypt not found"
ls -la target/debug/pack_e3_params || echo "pack_e3_params not found"
- name: 'Upload build artifacts'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: build-artifacts
path: |
target/debug/fake_encrypt
target/debug/pack_e3_params
if-no-files-found: error
- name: Upload source-aligned ZK fixtures
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: integration-noir-artifacts
include-hidden-files: true
path: tests/integration/.interfold/noir/
retention-days: 1
if-no-files-found: error
check-nix-flake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
with:
extra_nix_config: |
experimental-features = nix-command flakes
# if the following fails it means some of our git dependencies or bb has updated
# to fix this basically what you need to do here is copy the actual hashes
# into the flake.nix where those hashes are expected. if you want to do this locally
# install the nix package manager and try running the scripts below.
- run: bash ./scripts/nix-versions.sh # display bad versions when deps change
ciphernode_integration_test:
needs: [detect_changes, integration_prebuild, build_interfold_cli, build_sdk]
if: needs.detect_changes.outputs.ciphernode_e2e == 'true'
timeout-minutes: 45
runs-on:
group: enclave-ci
labels: [enclave-ci-runner]
strategy:
matrix:
test-suite: [base, persist]
fail-fast: true
steps:
- name: 'Check out the repo'
uses: 'actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10' # v6
- name: pnpm-setup
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- name: 'Setup node'
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1
- name: 'Install the dependencies'
run: 'pnpm install --frozen-lockfile'
- name: 'Download build artifacts'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: build-artifacts
path: target/debug/
- name: 'Download source-aligned ZK fixtures'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: integration-noir-artifacts
path: tests/integration/.interfold/noir/
- name: 'Download interfold binary'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: interfold-binary
path: ~/.cargo/bin/
- name: 'Download SDK artifacts'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: sdk-artifacts
path: ./
- name: 'Verify downloaded artifacts'
run: |
echo "Checking for required artifacts:"
ls -la target/debug/fake_encrypt || echo "fake_encrypt not found"
ls -la target/debug/pack_e3_params || echo "pack_e3_params not found"
ls -la ~/.cargo/bin/interfold || echo "interfold binary not found"
ls -la packages/interfold-contracts/dist || echo "SDK dist not found"
ls -la crates/wasm/dist || echo "WASM dist not found"
- name: 'Set executable permissions'
run: |
chmod +x target/debug/fake_encrypt
chmod +x target/debug/pack_e3_params
chmod +x ~/.cargo/bin/interfold
chmod +x tests/integration/.interfold/noir/bin/bb
- name: 'Run ${{ matrix.test-suite }} tests'
run: |
INTERFOLD_BIN="$HOME/.cargo/bin/interfold" \
pnpm test:integration ${{ matrix.test-suite }} --no-prebuild
- name: 'Add test summary'
run: |
echo "## Test results for ${{ matrix.test-suite }}" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
build_interfold_cli:
needs: [detect_changes]
if: needs.detect_changes.outputs.build_interfold_cli == 'true'
timeout-minutes: 20
runs-on:
group: enclave-ci
labels: [enclave-ci-runner]
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
submodules: recursive
- name: Cache Rust dependencies
uses: ./.github/actions/cache-dependencies
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Install solc
run: |
sudo add-apt-repository ppa:ethereum/ethereum \
&& sudo apt-get update -y \
&& sudo apt-get install -y solc protobuf-compiler
- name: Build interfold CLI
run: cargo install --locked --path crates/cli --bin interfold --features test-only-skip-proof-aggregation
- name: Upload interfold binary
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: interfold-binary
path: ~/.cargo/bin/interfold
retention-days: 1
- name: Cancel workflow on failure
if: failure()
run: gh run cancel ${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}
crisp_unit:
needs: [detect_changes, build_crisp_sdk]
if: needs.detect_changes.outputs.crisp == 'true'
timeout-minutes: 30
runs-on: 'ubuntu-latest'
strategy:
matrix:
include:
- test-suite: test:circuits
command: pnpm test:circuits
- test-suite: test:sdk
command: pnpm test:sdk
- test-suite: test:contracts
command: pnpm test:contracts
- test-suite: cargo test
command: cargo test
fail-fast: false
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
submodules: recursive
- name: Cache Rust dependencies
if: matrix.test-suite == 'cargo test'
uses: ./.github/actions/cache-dependencies
with:
cargo-lock-path: examples/CRISP/Cargo.lock
rust-target-path: examples/CRISP/target/
- name: Install Rust
if: matrix.test-suite == 'cargo test'
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Install Foundry
if: matrix.test-suite == 'cargo test'
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1
- name: Install solc
if: matrix.test-suite == 'cargo test'
run: |
sudo add-apt-repository ppa:ethereum/ethereum \
&& sudo apt-get update -y \
&& sudo apt-get install -y solc protobuf-compiler
- name: Install Nargo
if: matrix.test-suite == 'test:circuits'
uses: noir-lang/noirup@7dbe69ccc78877f0200ffa5a40836c953d2cfd8f # v0.1.4
with:
toolchain: ${{ env.NOIR_TOOLCHAIN }}
- name: Setup pnpm
if: matrix.test-suite != 'cargo test'
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- name: Setup Node.js
if: matrix.test-suite != 'cargo test'
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
if: matrix.test-suite != 'cargo test'
working-directory: .
run: pnpm install --frozen-lockfile
- name: Compile Interfold contracts
if: matrix.test-suite == 'test:contracts'
working-directory: .
run: pnpm evm:build
- name: Download Crisp SDK artifacts
if: matrix.test-suite == 'test:sdk' || matrix.test-suite == 'test:contracts'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: crisp-sdk-artifacts
path: .
- name: Run ${{ matrix.test-suite }}
working-directory: ./examples/CRISP
run: ${{ matrix.command }}
crisp_e2e:
needs: [detect_changes, build_interfold_cli, build_crisp_sdk]
if: needs.detect_changes.outputs.crisp == 'true'
timeout-minutes: 45
runs-on:
group: enclave-ci
labels: [enclave-ci-runner]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
submodules: recursive
- name: Cache Rust dependencies
uses: ./.github/actions/cache-dependencies
with:
cargo-lock-path: examples/CRISP/Cargo.lock
rust-target-path: examples/CRISP/target/
- name: Prepare test environment
run: |
mkdir -p $GITHUB_WORKSPACE/examples/CRISP/test-results
sudo chmod -R 777 $GITHUB_WORKSPACE/examples/CRISP/test-results
mkdir -p $GITHUB_WORKSPACE/examples/CRISP/playwright-report
sudo chmod -R 777 $GITHUB_WORKSPACE/examples/CRISP/playwright-report
mkdir -p $GITHUB_WORKSPACE/examples/CRISP/.cache-synpress
sudo chown -R $USER_UID:$USER_GID $GITHUB_WORKSPACE/examples/CRISP/.cache-synpress
sudo chmod -R 777 $GITHUB_WORKSPACE/examples/CRISP/.cache-synpress
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1
- name: Setup pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install solc
run: |
sudo add-apt-repository ppa:ethereum/ethereum \
&& sudo apt-get update -y \
&& sudo apt-get install -y solc protobuf-compiler
- name: Install yq
run: |
sudo wget -qO- https://github.com/mikefarah/yq/releases/download/v4.45.1/yq_linux_amd64.tar.gz | sudo tar xz -C /usr/local/bin --transform='s|yq_linux_amd64|yq|' --no-same-owner
- name: Install dependencies
working-directory: .
run: pnpm install --frozen-lockfile
- name: Compile Interfold contracts
working-directory: .
run: pnpm evm:build
- name: Compile Crisp contracts
working-directory: ./examples/CRISP
run: pnpm compile:contracts
- name: Copy environment variables
working-directory: ./examples/CRISP
run: |
cp server/.env.example server/.env
cp client/.env.example client/.env
cp .env.example .env
- name: Build Crisp server and CLI binaries
working-directory: ./examples/CRISP/server
run: |
cargo build --locked --bin cli
cargo build --locked --bin server
- name: Download Crisp SDK artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: crisp-sdk-artifacts
path: .
- name: Install Playwright browsers
working-directory: ./examples/CRISP
run: pnpm exec playwright install chromium
- name: Download interfold binary
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: interfold-binary
path: ~/.cargo/bin/
- name: Make binaries executable
run: |
chmod +x ~/.cargo/bin/interfold
- name: Install Nargo
uses: noir-lang/noirup@7dbe69ccc78877f0200ffa5a40836c953d2cfd8f # v0.1.4
with:
toolchain: ${{ env.NOIR_TOOLCHAIN }}
- name: Cache Barretenberg binary
id: cache-bb
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: /usr/local/bin/bb
key: bb-bin-${{ env.BB_VERSION }}-amd64-linux
- name: Install Barretenberg (bb)
if: steps.cache-bb.outputs.cache-hit != 'true'
run: |
curl -fsSL "https://github.com/AztecProtocol/aztec-packages/releases/download/v${{ env.BB_VERSION }}/barretenberg-amd64-linux.tar.gz" -o bb.tar.gz
mkdir -p bb_extract && tar -xzf bb.tar.gz -C bb_extract
BB_BIN=$(find bb_extract -name bb -type f | head -n 1)
sudo mv "$BB_BIN" /usr/local/bin/bb
chmod +x /usr/local/bin/bb
- name: Build interfold circuits
run: pnpm build:circuits --preset insecure-512 --committee minimum --skip-if-built
- name: Setup ZK prover
run: |
interfold noir setup
- name: Run Playwright tests
working-directory: ./examples/CRISP
env:
PLAYWRIGHT_WORKERS: 4
METAMASK_VERSION: 11.8.2
run: pnpm test:e2e
- name: Upload test results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: playwright-report
path: ./examples/CRISP/playwright-report/
retention-days: 30
build_circuits:
needs: [detect_changes]
if: needs.detect_changes.outputs.build_circuits == 'true'
timeout-minutes: 30
runs-on: 'ubuntu-latest'
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
submodules: recursive
- name: Install Nargo
uses: noir-lang/noirup@7dbe69ccc78877f0200ffa5a40836c953d2cfd8f # v0.1.4
with:
toolchain: ${{ env.NOIR_TOOLCHAIN }}
- name: Install protoc
run: sudo apt-get update -y && sudo apt-get install -y protobuf-compiler
- name: Cache Barretenberg binary
id: cache-bb
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: /usr/local/bin/bb
key: bb-bin-${{ env.BB_VERSION }}-amd64-linux
- name: Install Barretenberg (bb)
if: steps.cache-bb.outputs.cache-hit != 'true'
run: |
curl -fsSL "https://github.com/AztecProtocol/aztec-packages/releases/download/v${{ env.BB_VERSION }}/barretenberg-amd64-linux.tar.gz" -o bb.tar.gz
mkdir -p bb_extract && tar -xzf bb.tar.gz -C bb_extract
BB_BIN=$(find bb_extract -name bb -type f | head -n 1)
sudo mv "$BB_BIN" /usr/local/bin/bb
chmod +x /usr/local/bin/bb
- name: Verify bb
run: bb --version
- name: Check formatting
run: ./scripts/lint-circuits.sh
- name: Test Noir circuits
run: ./scripts/test-circuits.sh
- name: pnpm-setup
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build circuits
run: pnpm build:circuits
- name: Upload compiled circuit artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: compiled-circuits
path: |
circuits/bin/.active-preset.json
circuits/bin/dkg/target/
circuits/bin/threshold/target/
circuits/bin/recursive_aggregation/*/target/
retention-days: 1
if-no-files-found: error
- name: Cancel workflow on failure
if: failure()
run: gh run cancel ${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}
zk_prover_e2e:
needs: [detect_changes, build_circuits]
if: needs.detect_changes.outputs.zk == 'true'
timeout-minutes: 30
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Cache Rust dependencies
uses: ./.github/actions/cache-dependencies
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Cache Barretenberg binary
id: cache-bb
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: /usr/local/bin/bb
key: bb-bin-${{ env.BB_VERSION }}-amd64-linux
- name: Install solc
run: |
sudo add-apt-repository ppa:ethereum/ethereum \
&& sudo apt-get update -y \
&& sudo apt-get install -y solc protobuf-compiler
- name: Install Barretenberg (bb)
if: steps.cache-bb.outputs.cache-hit != 'true'
run: |
curl -fsSL "https://github.com/AztecProtocol/aztec-packages/releases/download/v${{ env.BB_VERSION }}/barretenberg-amd64-linux.tar.gz" -o bb.tar.gz
mkdir -p bb_extract && tar -xzf bb.tar.gz -C bb_extract
BB_BIN=$(find bb_extract -name bb -type f | head -n 1)
sudo mv "$BB_BIN" /usr/local/bin/bb
chmod +x /usr/local/bin/bb
- name: Verify bb