-
Notifications
You must be signed in to change notification settings - Fork 308
/
Copy pathEarthfile
327 lines (255 loc) · 10.9 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
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
VERSION 0.8
E2E_COMPOSE_TEST:
FUNCTION
ARG test
ARG compose_file=./scripts/docker-compose.yml
ARG debug="aztec:*"
ARG hardware_concurrency=""
LOCALLY
ENV TEST=$test
ENV DEBUG=$debug
ENV HARDWARE_CONCURRENCY=$hardware_concurrency
LET project_name=$(echo $test | sed 's/\./_/g' | sed 's/\//_/g')
IF docker compose > /dev/null 2>&1
LET CMD="docker compose"
ELSE
LET CMD="docker-compose"
END
# Let docker compose know about the pushed tags above
ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD)
# Optimize to not cause serial behavior if image already exists
IF ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/aztec:$AZTEC_DOCKER_TAG" || \
! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"
WAIT
BUILD ../+export-e2e-test-images
END
END
# Run our docker compose, ending whenever sandbox ends, filtering out noisy eth_getLogs
ENV JOB_NAME=$project_name
RUN $CMD -p $project_name -f $compose_file up --exit-code-from=end-to-end --force-recreate
E2E_TEST:
FUNCTION
ARG hardware_concurrency=""
ARG test
ARG allow_fail=false
LOCALLY
# Let docker compose know about the pushed tags above
ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD)
# Optimize to not cause serial behavior if image already exists
IF ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"
WAIT
BUILD ../+export-end-to-end
END
END
RUN docker run -e HARDWARE_CONCURRENCY=$hardware_concurrency --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG $test || $allow_fail
E2E_TEST_PUBLIC_TESTNET:
FUNCTION
ARG hardware_concurrency=""
ARG test
ARG allow_fail=false
ARG seq_private_key
ARG prover_private_key
ARG ethereum_host
ARG l1_chain_id
LOCALLY
# Let docker compose know about the pushed tags above
ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD)
# Optimize to not cause serial behavior if image already exists
IF ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"
WAIT
BUILD ../+export-end-to-end
END
END
RUN docker run -e L1_CHAIN_ID=$l1_chain_id -e ETHEREUM_HOST=$ethereum_host -e SEQ_PUBLISHER_PRIVATE_KEY=$seq_private_key -e PROVER_PUBLISHER_PRIVATE_KEY=$prover_private_key -e HARDWARE_CONCURRENCY=$hardware_concurrency --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG $test || $allow_fail
NETWORK_TEST:
FUNCTION
ARG values_file="default.yaml"
ARG namespace
ARG test
ARG chaos_values
ARG fresh_install
ARG force_build
LOCALLY
# Let docker compose know about the pushed tags above
ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD)
IF [ "$force_build" = "true" ] || \
! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/aztec:$AZTEC_DOCKER_TAG" || \
! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"
WAIT
BUILD ../+export-e2e-test-images
END
END
# load the docker image into kind
RUN kind load docker-image aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG
RUN kind load docker-image aztecprotocol/aztec:$AZTEC_DOCKER_TAG
# if fresh_install is true, delete the namespace
IF [ "$fresh_install" = "true" ]
RUN kubectl delete namespace $namespace --ignore-not-found=true --wait=true --now --timeout=10m
END
RUN helm install spartan ../../spartan/aztec-network/ \
--namespace $namespace \
--create-namespace \
--values ../../spartan/aztec-network/values/$values_file \
--set images.test.image="aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG" \
--set images.aztec.image="aztecprotocol/aztec:$AZTEC_DOCKER_TAG" \
--set test="$test" \
--wait \
--wait-for-jobs=true \
--timeout=10m
RUN kubectl wait pod -l app==pxe --for=condition=Ready -n $namespace --timeout=10m
RUN helm test spartan --namespace $namespace --timeout 30m
e2e-p2p:
DO +E2E_TEST --test=./src/e2e_p2p_network.test.ts
e2e-l1-with-wall-time:
DO +E2E_TEST --test=./src/e2e_l1_with_wall_time.test.ts
e2e-2-pxes:
DO +E2E_TEST --test=./src/e2e_2_pxes.test.ts
e2e-nft:
DO +E2E_TEST --test=./src/e2e_nft.test.ts
e2e-prover-full:
DO +E2E_TEST --test=./src/e2e_prover/full --hardware_concurrency=${HARDWARE_CONCURRENCY:-32}
e2e-prover-with-padding:
DO +E2E_TEST --test=./src/e2e_prover/with_padding --hardware_concurrency=${HARDWARE_CONCURRENCY:-32}
e2e-account-contracts:
DO +E2E_TEST --test=./src/e2e_account_contracts.test.ts
e2e-authwit:
DO +E2E_TEST --test=./src/e2e_authwit.test.ts
e2e-avm-simulator:
DO +E2E_TEST --test=./src/e2e_avm_simulator.test.ts
e2e-blacklist-token-contract:
DO +E2E_TEST --test=./src/e2e_blacklist_token_contract
e2e-block-building:
DO +E2E_TEST --test=./src/e2e_block_building.test.ts
e2e-bot:
DO +E2E_TEST --test=./src/e2e_bot.test.ts
e2e-card-game:
DO +E2E_TEST --test=./src/e2e_card_game.test.ts
e2e-cheat-codes:
DO +E2E_TEST --test=./src/e2e_cheat_codes.test.ts
e2e-crowdfunding-and-claim:
DO +E2E_TEST --test=./src/e2e_crowdfunding_and_claim.test.ts
e2e-delegate-calls:
DO +E2E_TEST --test=./src/e2e_delegate_calls
e2e-deploy-contract:
DO +E2E_TEST --test=./src/e2e_deploy_contract
e2e-encryption:
DO +E2E_TEST --test=./src/e2e_encryption.test.ts
e2e-escrow-contract:
DO +E2E_TEST --test=./src/e2e_escrow_contract.test.ts
e2e-keys:
DO +E2E_TEST --test=./src/e2e_keys.test.ts
e2e-lending-contract:
DO +E2E_TEST --test=./src/e2e_lending_contract.test.ts
e2e-max-block-number:
DO +E2E_TEST --test=./src/e2e_max_block_number.test.ts
e2e-multiple-accounts-1-enc-key:
DO +E2E_TEST --test=./src/e2e_multiple_accounts_1_enc_key.test.ts
e2e-nested-contract:
DO +E2E_TEST --test=./src/e2e_nested_contract
e2e-non-contract-account:
DO +E2E_TEST --test=./src/e2e_non_contract_account.test.ts
e2e-note-getter:
DO +E2E_TEST --test=./src/e2e_note_getter.test.ts
e2e-ordering:
DO +E2E_TEST --test=./src/e2e_ordering.test.ts
e2e-outbox:
DO +E2E_TEST --test=./src/e2e_outbox.test.ts
e2e-pending-note-hashes-contract:
DO +E2E_TEST --test=./src/e2e_pending_note_hashes_contract.test.ts
e2e-private-voting-contract:
DO +E2E_TEST --test=./src/e2e_private_voting_contract.test.ts
e2e-prover-node:
DO +E2E_TEST --test=./src/e2e_prover_node.test.ts
e2e-fees-private-payments:
DO +E2E_TEST --test=./src/e2e_fees/private_payments.test.ts
e2e-fees-private-refunds:
DO +E2E_TEST --test=./src/e2e_fees/private_refunds.test.ts
e2e-fees-gas-estimation:
DO +E2E_TEST --test=./src/e2e_fees/gas_estimation.test.ts
e2e-fees-dapp-subscription:
DO +E2E_TEST --test=./src/e2e_fees/dapp_subscription.test.ts
e2e-fees-failures:
DO +E2E_TEST --test=./src/e2e_fees/failures.test.ts
e2e-fees-fee-juice-payments:
DO +E2E_TEST --test=./src/e2e_fees/fee_juice_payments.test.ts
e2e-fees-account-init:
DO +E2E_TEST --test=./src/e2e_fees/account_init.test.ts
e2e-cross-chain-messaging:
DO +E2E_TEST --test=./src/e2e_cross_chain_messaging
e2e-state-vars:
DO +E2E_TEST --test=./src/e2e_state_vars.test.ts
e2e-logs:
DO +E2E_TEST --test=./src/e2e_event_logs.test.ts
e2e-static-calls:
DO +E2E_TEST --test=./src/e2e_static_calls.test.ts
e2e-token-contract:
DO +E2E_TEST --test=./src/e2e_token_contract
e2e-public-testnet:
ARG L1_CHAIN_ID="31337"
ARG ETHEREUM_HOST
ARG SEQ_PUBLISHER_PRIVATE_KEY
ARG PROVER_PUBLISHER_PRIVATE_KEY
DO +E2E_TEST_PUBLIC_TESTNET --test=./src/public-testnet --seq_private_key=${SEQ_PUBLISHER_PRIVATE_KEY:-} --prover_private_key=${PROVER_PUBLISHER_PRIVATE_KEY:-} --ethereum_host=${ETHEREUM_HOST:-} --l1_chain_id=${L1_CHAIN_ID:-}
flakey-e2e-tests:
DO +E2E_TEST --test=./src/flakey --allow_fail=true
e2e-sandbox-example:
DO +E2E_COMPOSE_TEST --test=e2e_sandbox_example.test.ts
uniswap-trade-on-l1-from-l2:
DO +E2E_COMPOSE_TEST --test=uniswap_trade_on_l1_from_l2.test.ts
integration-l1-publisher:
DO +E2E_COMPOSE_TEST --test=integration_l1_publisher.test.ts
# Disabled, TODO https://github.com/AztecProtocol/aztec-packages/issues/6624
# integration-proof-verification:
# DO +E2E_COMPOSE_TEST --compose_file=./scripts/docker-compose-no-sandbox.yml --test=integration_proof_verification.test.ts
e2e-browser:
DO +E2E_COMPOSE_TEST --test=e2e_aztec_js_browser.test.ts
pxe:
DO +E2E_COMPOSE_TEST --test=pxe.test.ts
e2e-docs-examples:
DO +E2E_COMPOSE_TEST --test=docs_examples.test.ts
guides-writing-an-account-contract:
DO +E2E_COMPOSE_TEST --test=guides/writing_an_account_contract.test.ts
guides-dapp-testing:
DO +E2E_COMPOSE_TEST --test=guides/dapp_testing.test.ts
# TODO intermittent failure
# guides-sample-dapp:
# DO +E2E_COMPOSE_TEST --test=sample-dapp
# TODO currently hangs for hour+
# guides-up-quick-start:
# DO +E2E_COMPOSE_TEST --test=guides/up_quick_start.test.ts
bench-publish-rollup:
ARG PULL_REQUEST
ARG BRANCH
ARG COMMIT_HASH
DO +E2E_COMPOSE_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml
DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH
bench-process-history:
ARG PULL_REQUEST
ARG BRANCH
ARG COMMIT_HASH
DO +E2E_COMPOSE_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml
DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH
bench-tx-size:
ARG PULL_REQUEST
ARG BRANCH
ARG COMMIT_HASH
DO +E2E_COMPOSE_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml
DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH
bench-prover:
ARG PULL_REQUEST
ARG BRANCH
ARG COMMIT_HASH
DO +E2E_COMPOSE_TEST --test=bench_prover --debug="aztec:benchmarks:*,aztec:prover*,aztec:bb*,aztec:pxe*" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml --hardware_concurrency=${HARDWARE_CONCURRENCY:-32}
DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH
e2e-devnet-smoke:
DO +E2E_COMPOSE_TEST --test=devnet/e2e_smoke.test.ts --compose_file=scripts/docker-compose-devnet.yml
e2e-cli-wallet:
DO +E2E_COMPOSE_TEST --test=e2e_cli_wallet --compose_file=scripts/docker-compose-wallet.yml
network-smoke:
ARG force_build
ARG values_file="default.yaml"
DO +NETWORK_TEST --test=./src/spartan/smoke.test.ts --namespace=smoke --fresh_install=true --force_build=$force_build --values_file=$values_file
network-transfer:
ARG force_build
ARG values_file="default.yaml"
DO +NETWORK_TEST --test=./src/spartan/transfer.test.ts --namespace=transfer --fresh_install=true --force_build=$force_build --values_file=$values_file