-
Notifications
You must be signed in to change notification settings - Fork 97
/
Earthfile
178 lines (140 loc) · 8.28 KB
/
Earthfile
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
VERSION 0.8
acir-tests:
FROM ../build-images+from-registry
WORKDIR /usr/src/barretenberg
COPY ./acir_tests .
SAVE ARTIFACT ./*
sol:
FROM ../build-images+from-registry
WORKDIR /usr/src/barretenberg
COPY ./sol .
SAVE ARTIFACT ./*
barretenberg-acir-tests-bb:
FROM ../build-images/+from-registry
COPY ./cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb
COPY +acir-tests/ /usr/src/barretenberg/acir_tests
COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts
WORKDIR /usr/src/barretenberg/acir_tests
RUN rm -rf ./acir_tests
ENV TEST_SRC /usr/src/acir_artifacts
ENV VERBOSE=1
# Fold and verify an ACIR program stack using ClientIvc
RUN FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic
# Fold and verify an ACIR program stack using ClientIvc, then natively verify the ClientIVC proof.
RUN FLOW=prove_then_verify_client_ivc ./run_acir_tests.sh fold_basic
# Fold and verify an ACIR program stack using ClientIvc, recursively verify as part of the Tube circuit and produce and verify a Honk proof
RUN FLOW=prove_then_verify_tube ./run_acir_tests.sh fold_basic
# Run 1_mul through native bb build, all_cmds flow, to test all cli args.
RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul
barretenberg-acir-tests-bb-ultra-plonk:
FROM ../build-images/+from-registry
COPY ./cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb
COPY +acir-tests/ /usr/src/barretenberg/acir_tests
COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts
WORKDIR /usr/src/barretenberg/acir_tests
RUN rm -rf ./acir_tests
ENV TEST_SRC /usr/src/acir_artifacts
ENV VERBOSE=1
# Run every acir test through native bb build prove_then_verify flow for UltraPlonk.
# This ensures we test independent pk construction through real/garbage witness data paths.
RUN FLOW=prove_then_verify ./run_acir_tests.sh
RUN FLOW=prove_then_verify RECURSIVE=true ./run_acir_tests.sh assert_statement double_verify_proof
barretenberg-acir-tests-bb-ultra-honk:
FROM ../build-images/+from-registry
COPY ./cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb
COPY +acir-tests/ /usr/src/barretenberg/acir_tests
COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts
WORKDIR /usr/src/barretenberg/acir_tests
RUN rm -rf ./acir_tests
ENV TEST_SRC /usr/src/acir_artifacts
ENV VERBOSE=1
# Run the acir test through native bb build prove_then_verify_ultra_honk flow
# Note that the script will skip the Plonk related tests
RUN FLOW=prove_then_verify_ultra_honk HONK=true ./run_acir_tests.sh
RUN FLOW=prove_then_verify_ultra_honk HONK=true RECURSIVE=true ./run_acir_tests.sh assert_statement double_verify_honk_proof
# Construct and verify a UltraHonk proof for a single program
RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh pedersen_hash
# Construct and verify a MegaHonk proof on one non-recursive program using the new witness stack workflow
RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh merkle_insert
# Construct and separately verify a UltraHonk proof for a single program that recursively verifies a Honk proof
RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof
# Construct and verify a UltraHonk proof for a single program that recursively verifies a Honk proof
RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof
barretenberg-acir-tests-bb-mega-honk:
FROM ../build-images/+from-registry
COPY ./cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb
COPY +acir-tests/ /usr/src/barretenberg/acir_tests
COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts
WORKDIR /usr/src/barretenberg/acir_tests
RUN rm -rf ./acir_tests
ENV TEST_SRC /usr/src/acir_artifacts
ENV VERBOSE=1
# Construct and separately verify a MegaHonk proof for all acir programs
RUN FLOW=prove_then_verify_mega_honk ./run_acir_tests.sh
# Construct and verify a MegaHonk proof for a single arbitrary program
RUN FLOW=prove_and_verify_mega_honk ./run_acir_tests.sh 6_array
# Construct and verify a MegaHonk proof for all ACIR programs using the new witness stack workflow
RUN FLOW=prove_and_verify_mega_honk_program ./run_acir_tests.sh
barretenberg-acir-tests-sol:
FROM ../build-images/+from-registry
COPY ./cpp/+preset-sol/ /usr/src/barretenberg/cpp/build
COPY ./cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb
COPY ./+acir-tests/ /usr/src/barretenberg/acir_tests
COPY ./+sol/ /usr/src/barretenberg/sol
COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts
WORKDIR /usr/src/barretenberg/acir_tests
ENV TEST_SRC /usr/src/acir_artifacts
ENV VERBOSE=1
RUN (cd sol-test && yarn)
RUN PARALLEL=1 FLOW=sol ./run_acir_tests.sh assert_statement double_verify_proof double_verify_nested_proof
barretenberg-acir-tests-sol-honk:
FROM ../build-images/+from-registry
COPY ./cpp/+preset-sol/ /usr/src/barretenberg/cpp/build
COPY ./cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb
COPY ./+acir-tests/ /usr/src/barretenberg/acir_tests
COPY ./+sol/ /usr/src/barretenberg/sol
COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts
WORKDIR /usr/src/barretenberg/acir_tests
ENV TEST_SRC /usr/src/acir_artifacts
ENV VERBOSE=1
RUN (cd sol-test && yarn)
RUN PARALLEL=1 FLOW=honk_sol ./run_acir_tests.sh assert_statement 1_mul slices verify_honk_proof
barretenberg-acir-tests-bb.js:
# Playwright not supported on base image ubuntu:noble, results in unmet dependencies
FROM ../build-images/+base-slim-node
RUN apt update && apt install -y curl jq lsof
COPY ./ts/+build/build/ /usr/src/barretenberg/ts
COPY ./+acir-tests/ /usr/src/barretenberg/acir_tests
COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts
WORKDIR /usr/src/barretenberg/acir_tests
# Build/install ts apps.
RUN cd browser-test-app && yarn && yarn build
RUN cd headless-test && yarn && npx playwright install && npx playwright install-deps
RUN cd ../ts && yarn
ENV VERBOSE=1
ENV TEST_SRC /usr/src/acir_artifacts
# We have diminishing returns after 32 cores, and unnecessarily use resources
ENV HARDWARE_CONCURRENCY=32
# TODO(https://github.com/AztecProtocol/aztec-packages/issues/6672): Try to enable double_verify
# Run UltraHonk recursive verification through bb.js on chrome testing multi-threaded browser support.
# TODO: Currently headless webkit doesn't seem to have shared memory so skipping multi-threaded test.
RUN BROWSER=chrome THREAD_MODEL=mt ./run_acir_tests_browser.sh verify_honk_proof
# Run UltraHonk recursive verification through bb.js on chrome testing single-threaded browser support.
RUN BROWSER=chrome THREAD_MODEL=st ./run_acir_tests_browser.sh verify_honk_proof
# Commenting for now as fails intermittently. Unreproducable on mainframe.
# See https://github.com/AztecProtocol/aztec-packages/issues/2104
#RUN BROWSER=webkit THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul
# TODO(https://github.com/noir-lang/noir/issues/5106)
# TODO(https://github.com/AztecProtocol/aztec-packages/issues/6672)
# Run ecdsa_secp256r1_3x through bb.js on node to check 256k support.
RUN BIN=../ts/dest/node/main.js FLOW=prove_then_verify ./run_acir_tests.sh ecdsa_secp256r1_3x
# Run a single arbitrary test not involving recursion through bb.js for UltraHonk
RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh 6_array assert_statement
# Run the prove then verify flow for UltraHonk. This makes sure we have the same circuit for different witness inputs.
RUN BIN=../ts/dest/node/main.js FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh 6_array assert_statement
# Run a single arbitrary test not involving recursion through bb.js for MegaHonk
RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_mega_honk ./run_acir_tests.sh 6_array
# Run fold_basic test through bb.js which runs ClientIVC on fold basic
RUN BIN=../ts/dest/node/main.js FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic
# Run 1_mul through bb.js build, all_cmds flow, to test all cli args.
RUN BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_acir_tests.sh 1_mul