@aztec/end-to-end 0.0.1-commit.2f68f620 → 0.0.1-commit.3100065
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +215 -27
- package/dest/automine/automine_test_context.d.ts +85 -0
- package/dest/automine/automine_test_context.d.ts.map +1 -0
- package/dest/automine/automine_test_context.js +98 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.d.ts +1 -1
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts +48 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts +19 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +141 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.js +18 -40
- package/dest/automine/token/token_contract_test.d.ts +40 -0
- package/dest/automine/token/token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_token_contract → automine/token}/token_contract_test.js +22 -39
- package/dest/automine/token/token_test_helpers.d.ts +73 -0
- package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
- package/dest/automine/token/token_test_helpers.js +97 -0
- package/dest/bench/client_flows/benchmark.d.ts +1 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +3 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +4 -4
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +31 -19
- package/dest/bench/utils.d.ts +3 -3
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +95 -6
- package/dest/composed/ha/ha_full_setup.d.ts +77 -0
- package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
- package/dest/composed/ha/ha_full_setup.js +383 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
- package/dest/fixtures/e2e_prover_test.d.ts +12 -9
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +48 -28
- package/dest/fixtures/fixtures.d.ts +17 -9
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +21 -8
- package/dest/fixtures/ha_setup.d.ts +3 -3
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +4 -1
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -0
- package/dest/fixtures/setup.d.ts +46 -41
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +194 -229
- package/dest/fixtures/setup_p2p_test.d.ts +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +3 -3
- package/dest/fixtures/standard_contracts_genesis.d.ts +16 -0
- package/dest/fixtures/standard_contracts_genesis.d.ts.map +1 -0
- package/dest/fixtures/standard_contracts_genesis.js +25 -0
- package/dest/fixtures/timing.d.ts +42 -0
- package/dest/fixtures/timing.d.ts.map +1 -0
- package/dest/fixtures/timing.js +72 -0
- package/dest/fixtures/token_utils.d.ts +22 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +21 -1
- package/dest/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- package/dest/fixtures/wait_helpers.d.ts +135 -0
- package/dest/fixtures/wait_helpers.d.ts.map +1 -0
- package/dest/fixtures/wait_helpers.js +154 -0
- package/dest/forward-compatibility/wallet_service.js +3 -3
- package/dest/multi-node/block-production/setup.d.ts +97 -0
- package/dest/multi-node/block-production/setup.d.ts.map +1 -0
- package/dest/multi-node/block-production/setup.js +158 -0
- package/dest/multi-node/governance/setup.d.ts +67 -0
- package/dest/multi-node/governance/setup.d.ts.map +1 -0
- package/dest/multi-node/governance/setup.js +126 -0
- package/dest/multi-node/multi_node_test_context.d.ts +212 -0
- package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
- package/dest/multi-node/multi_node_test_context.js +347 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/inactivity_setup.js +111 -0
- package/dest/multi-node/slashing/setup.d.ts +167 -0
- package/dest/multi-node/slashing/setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/setup.js +275 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +10 -2
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.js +41 -16
- package/dest/p2p/reqresp/utils.d.ts +19 -0
- package/dest/p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/reqresp/utils.js +4 -17
- package/dest/p2p/shared.d.ts +72 -0
- package/dest/p2p/shared.d.ts.map +1 -0
- package/dest/p2p/shared.js +212 -0
- package/dest/shared/cross_chain_test_harness.d.ts +3 -3
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +24 -16
- package/dest/shared/gas_portal_test_harness.d.ts +1 -1
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +8 -5
- package/dest/shared/submit-transactions.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +12 -5
- package/dest/shared/timing_env.d.js +5 -0
- package/dest/shared/timing_env.js +365 -0
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +1 -6
- package/dest/shared/wait_for_l1_to_l2_message.js +1 -1
- package/dest/simulators/lending_simulator.js +1 -1
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
- package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
- package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +17 -4
- package/dest/single-node/fees/fees_test.d.ts +95 -0
- package/dest/single-node/fees/fees_test.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/fees_test.js +126 -60
- package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
- package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
- package/dest/single-node/l1-reorgs/setup.js +57 -0
- package/dest/single-node/partial-proofs/setup.d.ts +5 -0
- package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
- package/dest/single-node/partial-proofs/setup.js +5 -0
- package/dest/single-node/proving/setup.d.ts +5 -0
- package/dest/single-node/proving/setup.d.ts.map +1 -0
- package/dest/single-node/proving/setup.js +5 -0
- package/dest/single-node/recovery/setup.d.ts +5 -0
- package/dest/single-node/recovery/setup.d.ts.map +1 -0
- package/dest/single-node/recovery/setup.js +5 -0
- package/dest/single-node/setup.d.ts +49 -0
- package/dest/single-node/setup.d.ts.map +1 -0
- package/dest/single-node/setup.js +56 -0
- package/dest/single-node/single_node_test_context.d.ts +373 -0
- package/dest/single-node/single_node_test_context.d.ts.map +1 -0
- package/dest/single-node/single_node_test_context.js +845 -0
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +19 -9
- package/dest/spartan/tx_metrics.d.ts +10 -1
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +32 -0
- package/dest/test-wallet/test_wallet.d.ts +23 -3
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +54 -7
- package/dest/test-wallet/utils.d.ts +36 -1
- package/dest/test-wallet/utils.d.ts.map +1 -1
- package/dest/test-wallet/utils.js +64 -4
- package/dest/test-wallet/wallet_worker_script.js +5 -2
- package/dest/test-wallet/worker_wallet.d.ts +5 -5
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet.js +2 -2
- package/dest/test-wallet/worker_wallet_schema.d.ts +3 -159
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.js +2 -1
- package/package.json +41 -41
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -0
- package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +213 -0
- package/src/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +20 -57
- package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +24 -57
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +3 -1
- package/src/bench/client_flows/client_flows_benchmark.ts +45 -26
- package/src/bench/utils.ts +109 -6
- package/src/composed/ha/ha_full_setup.ts +466 -0
- package/src/fixtures/e2e_prover_test.ts +60 -47
- package/src/fixtures/fixtures.ts +23 -8
- package/src/fixtures/ha_setup.ts +7 -3
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/setup.ts +243 -289
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/fixtures/standard_contracts_genesis.ts +28 -0
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +39 -4
- package/src/fixtures/utils.ts +0 -3
- package/src/fixtures/wait_helpers.ts +333 -0
- package/src/forward-compatibility/wallet_service.ts +6 -4
- package/src/guides/up_quick_start.sh +5 -0
- package/src/infra/README.md +12 -0
- package/src/multi-node/README.md +96 -0
- package/src/multi-node/block-production/setup.ts +272 -0
- package/src/multi-node/governance/setup.ts +172 -0
- package/src/multi-node/multi_node_test_context.ts +447 -0
- package/src/multi-node/slashing/inactivity_setup.ts +139 -0
- package/src/multi-node/slashing/setup.ts +433 -0
- package/src/p2p/README.md +78 -0
- package/src/{e2e_p2p → p2p}/p2p_network.ts +40 -13
- package/src/{e2e_p2p → p2p}/reqresp/utils.ts +5 -16
- package/src/p2p/shared.ts +329 -0
- package/src/shared/cross_chain_test_harness.ts +22 -13
- package/src/shared/gas_portal_test_harness.ts +13 -5
- package/src/shared/submit-transactions.ts +13 -5
- package/src/shared/timing_env.d.mts +39 -0
- package/src/shared/timing_env.mjs +363 -0
- package/src/shared/uniswap_l1_l2.ts +1 -8
- package/src/shared/wait_for_l1_to_l2_message.ts +1 -1
- package/src/simulators/lending_simulator.ts +1 -1
- package/src/single-node/README.md +66 -0
- package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
- package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
- package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +19 -5
- package/src/{e2e_fees → single-node/fees}/fees_test.ts +143 -70
- package/src/single-node/l1-reorgs/setup.ts +93 -0
- package/src/single-node/partial-proofs/setup.ts +8 -0
- package/src/single-node/proving/setup.ts +15 -0
- package/src/single-node/recovery/setup.ts +8 -0
- package/src/single-node/setup.ts +63 -0
- package/src/single-node/single_node_test_context.ts +1054 -0
- package/src/spartan/setup_test_wallets.ts +24 -9
- package/src/spartan/tx_metrics.ts +26 -0
- package/src/test-wallet/test_wallet.ts +58 -8
- package/src/test-wallet/utils.ts +102 -5
- package/src/test-wallet/wallet_worker_script.ts +6 -3
- package/src/test-wallet/worker_wallet.ts +5 -9
- package/src/test-wallet/worker_wallet_schema.ts +3 -2
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -56
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -58
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -161
- package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -37
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
- package/dest/e2e_deploy_contract/deploy_test.js +0 -51
- package/dest/e2e_epochs/epochs_test.d.ts +0 -125
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -460
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -91
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.d.ts +0 -11
- package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.js +0 -56
- package/dest/e2e_multi_validator/utils.d.ts +0 -12
- package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -26
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +0 -55
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +0 -137
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/reqresp/utils.d.ts +0 -22
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.d.ts +0 -75
- package/dest/e2e_p2p/shared.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.js +0 -217
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +0 -2
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +0 -1
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +0 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +0 -44
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -231
- package/src/e2e_deploy_contract/deploy_test.ts +0 -86
- package/src/e2e_epochs/epochs_test.ts +0 -575
- package/src/e2e_l1_publisher/write_json.ts +0 -77
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -77
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -180
- package/src/e2e_p2p/shared.ts +0 -332
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.js +0 -0
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.js +0 -0
- /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof.json +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.ts +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.ts +0 -0
- /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
package/src/fixtures/setup.ts
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr';
|
|
2
1
|
import { type InitialAccountData, generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
3
|
-
import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
4
|
-
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
2
|
+
import { type AztecNodeConfig, AztecNodeService, createAztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
3
|
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
6
|
-
import {
|
|
7
|
-
BatchCall,
|
|
8
|
-
type ContractFunctionInteraction,
|
|
9
|
-
type ContractMethod,
|
|
10
|
-
type DeployOptions,
|
|
11
|
-
type InteractionWaitOptions,
|
|
12
|
-
getContractClassFromArtifact,
|
|
13
|
-
waitForProven,
|
|
14
|
-
} from '@aztec/aztec.js/contracts';
|
|
4
|
+
import type { ContractMethod } from '@aztec/aztec.js/contracts';
|
|
15
5
|
import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
|
|
16
6
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
17
7
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
18
8
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
19
9
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
20
|
-
import {
|
|
10
|
+
import { CheatCodes } from '@aztec/aztec/testing';
|
|
21
11
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
22
12
|
import { isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
23
13
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
@@ -32,15 +22,15 @@ import {
|
|
|
32
22
|
deployAztecL1Contracts,
|
|
33
23
|
} from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
34
24
|
import type { Delayer } from '@aztec/ethereum/l1-tx-utils';
|
|
35
|
-
import { EthCheatCodes, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
25
|
+
import { EthCheatCodes, EthCheatCodesWithState, startAnvil, warmBlobKzg } from '@aztec/ethereum/test';
|
|
36
26
|
import type { Anvil } from '@aztec/ethereum/test';
|
|
27
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
37
28
|
import { BlockNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
38
29
|
import { SecretValue } from '@aztec/foundation/config';
|
|
39
30
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
40
31
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
41
32
|
import { withLoggerBindings } from '@aztec/foundation/log/server';
|
|
42
33
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
43
|
-
import { sleep } from '@aztec/foundation/sleep';
|
|
44
34
|
import { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
|
|
45
35
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
46
36
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
@@ -66,7 +56,7 @@ import {
|
|
|
66
56
|
initTelemetryClient,
|
|
67
57
|
} from '@aztec/telemetry-client';
|
|
68
58
|
import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
69
|
-
import {
|
|
59
|
+
import { createFundedInitializerlessAccounts } from '@aztec/wallets/testing';
|
|
70
60
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
71
61
|
|
|
72
62
|
import fs from 'fs/promises';
|
|
@@ -87,6 +77,8 @@ import { MNEMONIC, TEST_MAX_PENDING_TX_POOL_COUNT, TEST_PEER_CHECK_INTERVAL_MS }
|
|
|
87
77
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
88
78
|
import { getBBConfig } from './get_bb_config.js';
|
|
89
79
|
import { isMetricsLoggingRequested, setupMetricsLogger } from './logging.js';
|
|
80
|
+
import { getStandardContractGenesisNullifiers } from './standard_contracts_genesis.js';
|
|
81
|
+
import { testSpan } from './timing.js';
|
|
90
82
|
import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
|
|
91
83
|
|
|
92
84
|
export { startAnvil };
|
|
@@ -119,6 +111,8 @@ export async function setupSharedBlobStorage(config: { dataDirectory?: string }
|
|
|
119
111
|
/**
|
|
120
112
|
* Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
|
|
121
113
|
* @param aztecNode - An instance of Aztec Node.
|
|
114
|
+
* @param nodeDebug - The node's debug API, used to register public function signatures for named traces; pass
|
|
115
|
+
* `undefined` when the node does not expose it.
|
|
122
116
|
* @param opts - Partial configuration for the PXE.
|
|
123
117
|
* @param logger - The logger to be used.
|
|
124
118
|
* @param actor - Actor label to include in log output (e.g., 'pxe-test').
|
|
@@ -126,6 +120,7 @@ export async function setupSharedBlobStorage(config: { dataDirectory?: string }
|
|
|
126
120
|
*/
|
|
127
121
|
export async function setupPXEAndGetWallet(
|
|
128
122
|
aztecNode: AztecNode,
|
|
123
|
+
nodeDebug: AztecNodeDebug | undefined,
|
|
129
124
|
opts: Partial<PXEConfig> = {},
|
|
130
125
|
logger = getLogger(),
|
|
131
126
|
actor?: string,
|
|
@@ -146,7 +141,10 @@ export async function setupPXEAndGetWallet(
|
|
|
146
141
|
|
|
147
142
|
const teardown = configuredDataDirectory ? () => Promise.resolve() : () => tryRmDir(PXEConfig.dataDirectory!);
|
|
148
143
|
|
|
149
|
-
const wallet = await TestWallet.create(aztecNode, PXEConfig, {
|
|
144
|
+
const wallet = await TestWallet.create(aztecNode, PXEConfig, {
|
|
145
|
+
loggerActorLabel: actor,
|
|
146
|
+
nodeDebug,
|
|
147
|
+
});
|
|
150
148
|
|
|
151
149
|
return {
|
|
152
150
|
wallet,
|
|
@@ -156,7 +154,7 @@ export async function setupPXEAndGetWallet(
|
|
|
156
154
|
}
|
|
157
155
|
|
|
158
156
|
/** Options for the e2e tests setup */
|
|
159
|
-
export type SetupOptions = {
|
|
157
|
+
export type SetupOptions<TDeployExtraL1ContractsReturnType = unknown> = {
|
|
160
158
|
/** State load */
|
|
161
159
|
stateLoad?: string;
|
|
162
160
|
/** Whether to enable metrics collection, if undefined, metrics collection is disabled */
|
|
@@ -165,10 +163,11 @@ export type SetupOptions = {
|
|
|
165
163
|
deployL1ContractsValues?: DeployAztecL1ContractsReturnType;
|
|
166
164
|
/** Initial fee juice for default accounts */
|
|
167
165
|
initialAccountFeeJuice?: Fr;
|
|
168
|
-
/**
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Extra accounts to fund at genesis beyond the `numberOfAccounts` initializerless accounts that setup
|
|
168
|
+
* creates. Setup funds these but does NOT create or deploy them — the test creates/deploys them itself
|
|
169
|
+
*/
|
|
170
|
+
additionallyFundedAccounts?: InitialAccountData[];
|
|
172
171
|
/** An initial set of validators */
|
|
173
172
|
initialValidators?: (Operator & { privateKey: `0x${string}` })[];
|
|
174
173
|
/** Anvil Start time */
|
|
@@ -187,11 +186,26 @@ export type SetupOptions = {
|
|
|
187
186
|
mockGossipSubNetwork?: boolean;
|
|
188
187
|
/** Whether to add simulated latency to the mock gossipsub network (in ms) */
|
|
189
188
|
mockGossipSubNetworkLatency?: number;
|
|
190
|
-
/**
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
/**
|
|
190
|
+
* Whether to mine the L1 setup txs (Multicall3 + rollup contract deployment) under anvil automine
|
|
191
|
+
* instead of waiting on the block interval. Defaults to `true` (set in `setupInner`); only suites
|
|
192
|
+
* that assert on genesis-relative L1 timing need to opt out with `false`.
|
|
193
|
+
*/
|
|
194
194
|
automineL1Setup?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Hook invoked after the Aztec L1 rollup contracts are deployed but BEFORE the node/sequencer
|
|
197
|
+
* start, while anvil automine is still enabled (when `automineL1Setup` is true, the default).
|
|
198
|
+
* Deploy extra L1 contracts a test needs here (e.g. a cross-chain token portal + ERC20) so they
|
|
199
|
+
* mine instantly under automine instead of paying the L1 block interval once the node is running
|
|
200
|
+
* (and racing the live sequencer/archiver). The resolved value is exposed on the returned context
|
|
201
|
+
* as `extraL1DeployResult`. The hook receives setup's L1 deployer client (the same one used to
|
|
202
|
+
* deploy Multicall3).
|
|
203
|
+
*/
|
|
204
|
+
deployExtraL1Contracts?: (deps: {
|
|
205
|
+
l1Client: ExtendedViemWalletClient;
|
|
206
|
+
deployL1ContractsValues: DeployAztecL1ContractsReturnType;
|
|
207
|
+
logger: Logger;
|
|
208
|
+
}) => Promise<TDeployExtraL1ContractsReturnType>;
|
|
195
209
|
/** How many accounts to seed and unlock in anvil. */
|
|
196
210
|
anvilAccounts?: number;
|
|
197
211
|
/** Port to start anvil (defaults to 8545) */
|
|
@@ -207,8 +221,14 @@ export type SetupOptions = {
|
|
|
207
221
|
zkPassportArgs?: ZKPassportArgs;
|
|
208
222
|
/** Whether to fund the sponsored FPC in genesis (defaults to false). */
|
|
209
223
|
fundSponsoredFPC?: boolean;
|
|
210
|
-
/**
|
|
211
|
-
|
|
224
|
+
/**
|
|
225
|
+
* Compute extra addresses to fund at genesis from the accounts setup just generated (passed as the
|
|
226
|
+
* argument). Runs after the default accounts are created and before genesis values are computed, so a
|
|
227
|
+
* test can genesis-fund a contract whose address derives from a default account (e.g. an FPC whose
|
|
228
|
+
* admin is the first account) instead of bridging fee juice to it during setup. Each returned address
|
|
229
|
+
* is funded with the same fee juice as an initial account and included in the L1 portal `fundingNeeded`.
|
|
230
|
+
*/
|
|
231
|
+
computeExtraGenesisFundedAddresses?: (defaultAccounts: InitialAccountData[]) => Promise<AztecAddress[]>;
|
|
212
232
|
/** L1 contracts deployment arguments. */
|
|
213
233
|
l1ContractsArgs?: Partial<DeployAztecL1ContractsArgs>;
|
|
214
234
|
/** Wallet minimum fee padding multiplier */
|
|
@@ -224,7 +244,7 @@ export type SetupOptions = {
|
|
|
224
244
|
} & Partial<AztecNodeConfig>;
|
|
225
245
|
|
|
226
246
|
/** Context for an end-to-end test as returned by the `setup` function */
|
|
227
|
-
export type EndToEndContext = {
|
|
247
|
+
export type EndToEndContext<TDeployExtraL1ContractsReturnType = unknown> = {
|
|
228
248
|
/** The Anvil instance (only set if anvil was started locally). */
|
|
229
249
|
anvil: Anvil | undefined;
|
|
230
250
|
/** The Aztec Node service or client a connected to it. */
|
|
@@ -243,8 +263,8 @@ export type EndToEndContext = {
|
|
|
243
263
|
config: AztecNodeConfig;
|
|
244
264
|
/** The Aztec Node configuration (alias for config for backward compatibility). */
|
|
245
265
|
aztecNodeConfig: AztecNodeConfig;
|
|
246
|
-
/**
|
|
247
|
-
|
|
266
|
+
/** Data for the extra accounts funded at genesis but not created by setup (the test creates/deploys them). */
|
|
267
|
+
additionallyFundedAccounts: InitialAccountData[];
|
|
248
268
|
/** The wallet to be used. */
|
|
249
269
|
wallet: TestWallet;
|
|
250
270
|
/** The wallets to be used. */
|
|
@@ -255,8 +275,6 @@ export type EndToEndContext = {
|
|
|
255
275
|
cheatCodes: CheatCodes;
|
|
256
276
|
/** The cheat codes for L1 */
|
|
257
277
|
ethCheatCodes: EthCheatCodes;
|
|
258
|
-
/** The anvil test watcher. */
|
|
259
|
-
watcher: AnvilTestWatcher;
|
|
260
278
|
/** Allows tweaking current system time, used by the epoch cache only. */
|
|
261
279
|
dateProvider: TestDateProvider;
|
|
262
280
|
/** Telemetry client */
|
|
@@ -269,6 +287,8 @@ export type EndToEndContext = {
|
|
|
269
287
|
proverDelayer: Delayer | undefined;
|
|
270
288
|
/** Genesis data used for setting up nodes. */
|
|
271
289
|
genesis: GenesisData | undefined;
|
|
290
|
+
/** Resolved value of the `deployExtraL1Contracts` setup hook, if one was provided. */
|
|
291
|
+
extraL1DeployResult: TDeployExtraL1ContractsReturnType;
|
|
272
292
|
/** ACVM config (only set if running locally). */
|
|
273
293
|
acvmConfig: Awaited<ReturnType<typeof getACVMConfig>>;
|
|
274
294
|
/** BB config (only set if running locally). */
|
|
@@ -311,17 +331,43 @@ function assertContractArtifactsVersion() {
|
|
|
311
331
|
* @param opts - Options to pass to the node initialization and to the setup script.
|
|
312
332
|
* @param pxeOpts - Options to pass to the PXE initialization.
|
|
313
333
|
*/
|
|
314
|
-
export
|
|
334
|
+
export function setup<TDeployExtraL1ContractsReturnType = unknown>(
|
|
315
335
|
numberOfAccounts = 1,
|
|
316
|
-
opts: SetupOptions = {},
|
|
336
|
+
opts: SetupOptions<TDeployExtraL1ContractsReturnType> = {},
|
|
317
337
|
pxeOpts: Partial<PXEConfig> = {},
|
|
318
338
|
chain: Chain = foundry,
|
|
319
|
-
): Promise<EndToEndContext
|
|
339
|
+
): Promise<EndToEndContext<TDeployExtraL1ContractsReturnType>> {
|
|
340
|
+
// Tag the top-level env spin-up with the prover mode (none → fake → real), the largest config-driven
|
|
341
|
+
// swing in setup cost, so the three factories are comparable on the span leaderboard. The internals
|
|
342
|
+
// (anvil / l1-deploy / sequencer-start / pxe / wallet:create) decompose this further.
|
|
343
|
+
const proverMode = opts.realProofs ? 'real' : opts.startProverNode ? 'fake' : 'none';
|
|
344
|
+
return testSpan(`setup:env:${proverMode}`, async () => {
|
|
345
|
+
const ctx = await setupInner(numberOfAccounts, opts, pxeOpts, chain);
|
|
346
|
+
if (process.env.EXIT_E2E_AFTER_SETUP) {
|
|
347
|
+
ctx.logger.info('EXIT_E2E_AFTER_SETUP is set; aborting before the test body runs');
|
|
348
|
+
throw new Error('EXIT_E2E_AFTER_SETUP');
|
|
349
|
+
}
|
|
350
|
+
return ctx;
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
async function setupInner<TDeployExtraL1ContractsReturnType = unknown>(
|
|
355
|
+
numberOfAccounts: number,
|
|
356
|
+
opts: SetupOptions<TDeployExtraL1ContractsReturnType>,
|
|
357
|
+
pxeOpts: Partial<PXEConfig>,
|
|
358
|
+
chain: Chain,
|
|
359
|
+
): Promise<EndToEndContext<TDeployExtraL1ContractsReturnType>> {
|
|
320
360
|
assertContractArtifactsVersion();
|
|
361
|
+
const logger = getLogger();
|
|
321
362
|
let anvil: Anvil | undefined;
|
|
322
363
|
try {
|
|
323
364
|
opts.aztecTargetCommitteeSize ??= 0;
|
|
324
365
|
opts.slasherEnabled ??= false;
|
|
366
|
+
// Mine the L1 setup txs (Multicall3 + rollup contract deployment) immediately instead of
|
|
367
|
+
// waiting on anvil's block interval — this is the dominant cost of e2e setup. Suites that
|
|
368
|
+
// assert on genesis-relative L1 timing can opt out by passing `automineL1Setup: false`.
|
|
369
|
+
opts.automineL1Setup ??= true;
|
|
370
|
+
logger.trace('Starting e2e test setup');
|
|
325
371
|
|
|
326
372
|
const config: AztecNodeConfig & SetupOptions = { ...getConfigEnvVars(), ...opts };
|
|
327
373
|
// use initialValidators for the node config
|
|
@@ -331,16 +377,12 @@ export async function setup(
|
|
|
331
377
|
config.maxPendingTxCount = opts.maxPendingTxCount ?? TEST_MAX_PENDING_TX_POOL_COUNT;
|
|
332
378
|
// For tests we only want proving enabled if specifically requested
|
|
333
379
|
config.realProofs = !!opts.realProofs;
|
|
334
|
-
// Only enforce the time table if requested
|
|
335
|
-
config.enforceTimeTable = !!opts.enforceTimeTable;
|
|
336
380
|
// Enable the tx delayer for tests (default config has it disabled, so we force-enable it here)
|
|
337
381
|
config.enableDelayer = true;
|
|
338
382
|
config.listenAddress = '127.0.0.1';
|
|
339
383
|
|
|
340
384
|
config.minTxPoolAgeMs = opts.minTxPoolAgeMs ?? 0;
|
|
341
385
|
|
|
342
|
-
const logger = getLogger();
|
|
343
|
-
|
|
344
386
|
// Create a temp directory for any services that need it and cleanup later
|
|
345
387
|
const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
346
388
|
await fs.mkdir(directoryToCleanup, { recursive: true });
|
|
@@ -354,16 +396,19 @@ export async function setup(
|
|
|
354
396
|
if (!isAnvilTestChain(chain.id)) {
|
|
355
397
|
throw new Error(`No ETHEREUM_HOSTS set but non anvil chain requested`);
|
|
356
398
|
}
|
|
357
|
-
const res = await
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
399
|
+
const res = await testSpan('setup:env:anvil', () =>
|
|
400
|
+
startAnvil({
|
|
401
|
+
l1BlockTime: opts.ethereumSlotDuration,
|
|
402
|
+
accounts: opts.anvilAccounts,
|
|
403
|
+
port: opts.anvilPort ?? (process.env.ANVIL_PORT ? parseInt(process.env.ANVIL_PORT) : undefined),
|
|
404
|
+
slotsInAnEpoch: opts.anvilSlotsInAnEpoch,
|
|
405
|
+
dateProvider,
|
|
406
|
+
}),
|
|
407
|
+
);
|
|
364
408
|
anvil = res.anvil;
|
|
365
409
|
config.l1RpcUrls = [res.rpcUrl];
|
|
366
410
|
}
|
|
411
|
+
logger.trace('Started anvil and L1 RPC client');
|
|
367
412
|
|
|
368
413
|
// Enable logging metrics to a local file named after the test suite
|
|
369
414
|
if (isMetricsLoggingRequested()) {
|
|
@@ -380,6 +425,7 @@ export async function setup(
|
|
|
380
425
|
if (opts.l1StartTime) {
|
|
381
426
|
await ethCheatCodes.warp(opts.l1StartTime, { resetBlockInterval: true });
|
|
382
427
|
}
|
|
428
|
+
logger.trace('Initialized L1 cheat codes and applied state/time overrides');
|
|
383
429
|
|
|
384
430
|
let publisherPrivKeyHex: `0x${string}` | undefined = undefined;
|
|
385
431
|
let publisherHdAccount: HDAccount | PrivateKeyAccount | undefined = undefined;
|
|
@@ -407,12 +453,14 @@ export async function setup(
|
|
|
407
453
|
if (config.coinbase === undefined) {
|
|
408
454
|
config.coinbase = EthAddress.fromString(publisherHdAccount.address);
|
|
409
455
|
}
|
|
456
|
+
logger.trace('Resolved L1 publisher account');
|
|
410
457
|
|
|
411
|
-
//
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
const
|
|
458
|
+
// The accounts setup creates itself: `numberOfAccounts` initializerless accounts, generated here and
|
|
459
|
+
// funded at genesis so they are immediately usable.
|
|
460
|
+
const defaultAccounts = await generateSchnorrAccounts(numberOfAccounts);
|
|
461
|
+
// Extra accounts the test wants funded at genesis but will create/deploy itself.
|
|
462
|
+
const additionallyFundedAccounts = opts.additionallyFundedAccounts ?? [];
|
|
463
|
+
const addressesToFund = [...defaultAccounts, ...additionallyFundedAccounts].map(a => a.address);
|
|
416
464
|
|
|
417
465
|
// Optionally fund the sponsored FPC
|
|
418
466
|
if (opts.fundSponsoredFPC) {
|
|
@@ -420,13 +468,29 @@ export async function setup(
|
|
|
420
468
|
addressesToFund.push(sponsoredFPCAddress);
|
|
421
469
|
}
|
|
422
470
|
|
|
471
|
+
// Fund any extra addresses whose value depends on the just-generated accounts (e.g. an FPC admin'd
|
|
472
|
+
// by a default account), so a test can genesis-fund them instead of bridging fee juice during setup.
|
|
473
|
+
if (opts.computeExtraGenesisFundedAddresses) {
|
|
474
|
+
addressesToFund.push(...(await opts.computeExtraGenesisFundedAddresses(defaultAccounts)));
|
|
475
|
+
}
|
|
476
|
+
logger.trace('Generated test accounts to fund at genesis');
|
|
477
|
+
|
|
478
|
+
// Preload the standard contracts (AuthRegistry, PublicChecks, HandshakeRegistry) so their `ensure*Published` setup
|
|
479
|
+
// helpers short-circuit their publish txs. The archiver flag seeds the bytecode/instance into every spawned node's
|
|
480
|
+
// contract store; the genesis nullifiers make the AVM's deployment-nullifier check pass when they are called. Both
|
|
481
|
+
// must go together (flag alone would recreate the publish-collision bug), so the flag lives here beside the seeding.
|
|
482
|
+
config.testPreloadStandardContracts = true;
|
|
483
|
+
const standardContractNullifiers = await getStandardContractGenesisNullifiers();
|
|
484
|
+
|
|
423
485
|
const genesisTimestamp = BigInt(Math.floor(Date.now() / 1000));
|
|
424
486
|
const { genesisArchiveRoot, genesis, fundingNeeded } = await getGenesisValues(
|
|
425
487
|
addressesToFund,
|
|
426
488
|
opts.initialAccountFeeJuice,
|
|
427
489
|
opts.genesisPublicData,
|
|
428
490
|
genesisTimestamp,
|
|
491
|
+
standardContractNullifiers,
|
|
429
492
|
);
|
|
493
|
+
logger.trace('Computed genesis values');
|
|
430
494
|
|
|
431
495
|
const wasAutomining = await ethCheatCodes.isAutoMining();
|
|
432
496
|
const enableAutomine = opts.automineL1Setup && !wasAutomining && isAnvilTestChain(chain.id);
|
|
@@ -436,18 +500,21 @@ export async function setup(
|
|
|
436
500
|
|
|
437
501
|
const l1Client = createExtendedL1Client(config.l1RpcUrls, publisherHdAccount!, chain);
|
|
438
502
|
|
|
503
|
+
// Warm both KZG trusted setups (ours + anvil's) in parallel
|
|
504
|
+
if (anvil && isAnvilTestChain(chain.id)) {
|
|
505
|
+
await warmBlobKzg(l1Client, logger);
|
|
506
|
+
}
|
|
507
|
+
|
|
439
508
|
// Deploy Multicall3 if running locally
|
|
440
509
|
await deployMulticall3(l1Client, logger);
|
|
441
510
|
|
|
442
511
|
// Force viem to refresh its nonce cache to avoid "nonce too low" errors in subsequent transactions
|
|
443
512
|
// This is necessary because deployMulticall3 sends multiple transactions and viem may cache a stale nonce
|
|
444
513
|
await l1Client.getTransactionCount({ address: l1Client.account.address });
|
|
514
|
+
logger.trace('Deployed Multicall3');
|
|
445
515
|
|
|
446
|
-
const deployL1ContractsValues: DeployAztecL1ContractsReturnType = await
|
|
447
|
-
config.l1RpcUrls[0],
|
|
448
|
-
publisherPrivKeyHex!,
|
|
449
|
-
chain.id,
|
|
450
|
-
{
|
|
516
|
+
const deployL1ContractsValues: DeployAztecL1ContractsReturnType = await testSpan('setup:env:l1-deploy', () =>
|
|
517
|
+
deployAztecL1Contracts(config.l1RpcUrls[0], publisherPrivKeyHex!, chain.id, {
|
|
451
518
|
...getL1ContractsConfigEnvVars(),
|
|
452
519
|
...opts,
|
|
453
520
|
...opts.l1ContractsArgs,
|
|
@@ -457,7 +524,7 @@ export async function setup(
|
|
|
457
524
|
initialValidators: opts.initialValidators,
|
|
458
525
|
feeJuicePortalInitialBalance: fundingNeeded,
|
|
459
526
|
realVerifier: false,
|
|
460
|
-
},
|
|
527
|
+
}),
|
|
461
528
|
);
|
|
462
529
|
|
|
463
530
|
Object.assign(config, deployL1ContractsValues.l1ContractAddresses);
|
|
@@ -481,14 +548,28 @@ export async function setup(
|
|
|
481
548
|
}
|
|
482
549
|
}
|
|
483
550
|
|
|
551
|
+
// Deploy any test-specific L1 contracts while automine is still on and before the node starts,
|
|
552
|
+
// so they mine instantly rather than paying the L1 block interval once the sequencer is live.
|
|
553
|
+
let extraL1DeployResult: TDeployExtraL1ContractsReturnType = undefined as TDeployExtraL1ContractsReturnType;
|
|
554
|
+
if (opts.deployExtraL1Contracts) {
|
|
555
|
+
logger.trace('Running deployExtraL1Contracts hook');
|
|
556
|
+
extraL1DeployResult = await opts.deployExtraL1Contracts({
|
|
557
|
+
l1Client,
|
|
558
|
+
deployL1ContractsValues,
|
|
559
|
+
logger,
|
|
560
|
+
});
|
|
561
|
+
// The hook reused `l1Client` to send deploy txs, so refresh viem's nonce cache to avoid a
|
|
562
|
+
// stale cached nonce for later transactions on the publisher account.
|
|
563
|
+
await l1Client.getTransactionCount({ address: l1Client.account.address });
|
|
564
|
+
}
|
|
565
|
+
|
|
484
566
|
if (enableAutomine) {
|
|
485
|
-
await ethCheatCodes.
|
|
486
|
-
await ethCheatCodes.setIntervalMining(config.ethereumSlotDuration);
|
|
567
|
+
await ethCheatCodes.startIntervalMiningWithFreshBlock(config.ethereumSlotDuration);
|
|
487
568
|
}
|
|
488
569
|
|
|
489
570
|
// In compose mode (no local anvil), sync dateProvider to L1 time since it may have drifted
|
|
490
|
-
// ahead of system time
|
|
491
|
-
//
|
|
571
|
+
// ahead of system time. When running with a local anvil, the dateProvider is kept in sync via
|
|
572
|
+
// the stdout listener.
|
|
492
573
|
if (!anvil) {
|
|
493
574
|
dateProvider.setTime((await ethCheatCodes.lastBlockTimestamp()) * 1000);
|
|
494
575
|
}
|
|
@@ -496,38 +577,34 @@ export async function setup(
|
|
|
496
577
|
if (opts.l2StartTime) {
|
|
497
578
|
await ethCheatCodes.warp(opts.l2StartTime, { resetBlockInterval: true });
|
|
498
579
|
}
|
|
580
|
+
logger.trace('Deployed L1 rollup contracts');
|
|
581
|
+
|
|
582
|
+
// These boot steps are independent and write disjoint config keys, so run them concurrently:
|
|
583
|
+
// telemetry returns a client (no config write), shared blob storage writes blobFileStore* keys,
|
|
584
|
+
// and the ACVM/BB config resolvers write their own acvm*/bb* keys.
|
|
585
|
+
const [telemetryClient, , acvmConfig, bbConfig] = await Promise.all([
|
|
586
|
+
// Use metricsPort-based telemetry if provided, otherwise use the regular telemetry client
|
|
587
|
+
opts.metricsPort ? getEndToEndTestTelemetryClient(opts.metricsPort) : getTelemetryClient(opts.telemetryConfig),
|
|
588
|
+
setupSharedBlobStorage(config),
|
|
589
|
+
getACVMConfig(logger),
|
|
590
|
+
getBBConfig(logger),
|
|
591
|
+
]);
|
|
592
|
+
logger.trace('Created telemetry client');
|
|
593
|
+
logger.trace('Set up shared blob storage');
|
|
499
594
|
|
|
500
|
-
const watcher = new AnvilTestWatcher(
|
|
501
|
-
new EthCheatCodesWithState(config.l1RpcUrls, dateProvider),
|
|
502
|
-
deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
503
|
-
deployL1ContractsValues.l1Client,
|
|
504
|
-
dateProvider,
|
|
505
|
-
opts.anvilTestWatcherOpts,
|
|
506
|
-
);
|
|
507
|
-
if (!opts.disableAnvilTestWatcher) {
|
|
508
|
-
await watcher.start();
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
// Use metricsPort-based telemetry if provided, otherwise use the regular telemetry client
|
|
512
|
-
const telemetryClient = opts.metricsPort
|
|
513
|
-
? await getEndToEndTestTelemetryClient(opts.metricsPort)
|
|
514
|
-
: await getTelemetryClient(opts.telemetryConfig);
|
|
515
|
-
|
|
516
|
-
await setupSharedBlobStorage(config);
|
|
517
|
-
|
|
518
|
-
logger.verbose('Creating and synching an aztec node', config);
|
|
519
|
-
|
|
520
|
-
const acvmConfig = await getACVMConfig(logger);
|
|
521
595
|
if (acvmConfig) {
|
|
522
596
|
config.acvmWorkingDirectory = acvmConfig.acvmWorkingDirectory;
|
|
523
597
|
config.acvmBinaryPath = acvmConfig.acvmBinaryPath;
|
|
524
598
|
}
|
|
599
|
+
logger.trace('Resolved ACVM config');
|
|
525
600
|
|
|
526
|
-
const bbConfig = await getBBConfig(logger);
|
|
527
601
|
if (bbConfig) {
|
|
528
602
|
config.bbBinaryPath = bbConfig.bbBinaryPath;
|
|
529
603
|
config.bbWorkingDirectory = bbConfig.bbWorkingDirectory;
|
|
530
604
|
}
|
|
605
|
+
logger.trace('Resolved Barretenberg config');
|
|
606
|
+
|
|
607
|
+
logger.verbose('Creating and synching an aztec node', config);
|
|
531
608
|
|
|
532
609
|
let mockGossipSubNetwork: MockGossipSubNetwork | undefined;
|
|
533
610
|
let p2pClientDeps: P2PClientDeps | undefined = undefined;
|
|
@@ -537,27 +614,6 @@ export async function setup(
|
|
|
537
614
|
p2pClientDeps = { p2pServiceFactory: getMockPubSubP2PServiceFactory(mockGossipSubNetwork) };
|
|
538
615
|
}
|
|
539
616
|
|
|
540
|
-
// Transactions built against the genesis state must be included in block 1, otherwise they are dropped.
|
|
541
|
-
// To avoid test failures from dropped transactions, we ensure progression beyond genesis before proceeding.
|
|
542
|
-
// For account deployments, we set minTxsPerBlock=1 and deploy accounts sequentially for guaranteed success.
|
|
543
|
-
// If no accounts need deployment, we await an empty block to confirm network progression.
|
|
544
|
-
const originalMinTxsPerBlock = config.minTxsPerBlock;
|
|
545
|
-
if (originalMinTxsPerBlock === undefined) {
|
|
546
|
-
throw new Error('minTxsPerBlock is undefined in e2e test setup');
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
// Whether we're deploying accounts (and therefore need reliable block inclusion past genesis)
|
|
550
|
-
const shouldDeployAccounts = numberOfAccounts > 0 && !opts.skipAccountDeployment;
|
|
551
|
-
// Only set minTxsPerBlock=0 if we need an empty block (no accounts at all, not skipped deployment)
|
|
552
|
-
const needsEmptyBlock = numberOfAccounts === 0 && !opts.skipAccountDeployment;
|
|
553
|
-
// Pipelining is always on: the proposer builds during slot N-1 for slot N. A tx submitted at
|
|
554
|
-
// slot N start arrives after that build, so forcing minTxsPerBlock=1 would stall the chain on
|
|
555
|
-
// alternating slots -- hence empty checkpoints are allowed (minTxsPerBlock=0) for account
|
|
556
|
-
// deployment. Automine is unaffected: its runBuild clamps mempool builds to
|
|
557
|
-
// Math.max(minTxsPerBlock ?? 1, 1) and still requires minValidTxs: 1.
|
|
558
|
-
const accountsDeployMinTxs = 0;
|
|
559
|
-
config.minTxsPerBlock = shouldDeployAccounts ? accountsDeployMinTxs : needsEmptyBlock ? 0 : originalMinTxsPerBlock;
|
|
560
|
-
|
|
561
617
|
config.p2pEnabled = opts.mockGossipSubNetwork || config.p2pEnabled;
|
|
562
618
|
config.p2pIp = opts.p2pIp ?? config.p2pIp ?? '127.0.0.1';
|
|
563
619
|
|
|
@@ -577,15 +633,19 @@ export async function setup(
|
|
|
577
633
|
...(opts.mockGossipSubNetwork ? {} : { p2pEnabled: false, bootstrapNodes: [] as string[] }),
|
|
578
634
|
}
|
|
579
635
|
: config;
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
636
|
+
logger.trace('Prepared aztec node config');
|
|
637
|
+
|
|
638
|
+
const aztecNodeService = await testSpan('setup:env:sequencer-start', () =>
|
|
639
|
+
withLoggerBindings({ actor: 'node-0' }, () =>
|
|
640
|
+
createAztecNodeService(
|
|
641
|
+
initialNodeConfig,
|
|
642
|
+
{ dateProvider, telemetry: telemetryClient, p2pClientDeps },
|
|
643
|
+
{ genesis, dontStartSequencer: opts.skipInitialSequencer },
|
|
644
|
+
),
|
|
586
645
|
),
|
|
587
646
|
);
|
|
588
647
|
const sequencerClient = aztecNodeService.getSequencer();
|
|
648
|
+
logger.trace('Created and synced aztec node');
|
|
589
649
|
|
|
590
650
|
let proverNode: AztecNodeService | undefined = undefined;
|
|
591
651
|
if (opts.startProverNode) {
|
|
@@ -599,16 +659,19 @@ export async function setup(
|
|
|
599
659
|
rpcTxProviders: [aztecNodeService],
|
|
600
660
|
};
|
|
601
661
|
|
|
602
|
-
({ proverNode } = await
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
662
|
+
({ proverNode } = await testSpan('setup:env:prover-node', () =>
|
|
663
|
+
createAndSyncProverNode(
|
|
664
|
+
proverNodePrivateKeyHex,
|
|
665
|
+
config,
|
|
666
|
+
{
|
|
667
|
+
...config.proverNodeConfig,
|
|
668
|
+
dataDirectory: proverNodeDataDirectory,
|
|
669
|
+
},
|
|
670
|
+
{ dateProvider, p2pClientDeps, telemetry: telemetryClient },
|
|
671
|
+
{ genesis },
|
|
672
|
+
),
|
|
611
673
|
));
|
|
674
|
+
logger.trace('Created prover node');
|
|
612
675
|
}
|
|
613
676
|
|
|
614
677
|
const sequencerDelayer = sequencerClient?.getDelayer();
|
|
@@ -619,21 +682,22 @@ export async function setup(
|
|
|
619
682
|
pxeConfig.dataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
620
683
|
// For tests we only want proving enabled if specifically requested
|
|
621
684
|
pxeConfig.proverEnabled = !!pxeOpts.proverEnabled;
|
|
622
|
-
const wallet = await
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
685
|
+
const wallet = await testSpan('setup:env:pxe', () =>
|
|
686
|
+
TestWallet.create(aztecNodeService, pxeConfig, {
|
|
687
|
+
loggerActorLabel: 'pxe-0',
|
|
688
|
+
// In-process node implements the debug API, so register public function signatures for named traces.
|
|
689
|
+
nodeDebug: aztecNodeService,
|
|
690
|
+
...opts.pxeCreationOptions,
|
|
691
|
+
}),
|
|
692
|
+
);
|
|
626
693
|
|
|
627
694
|
if (opts.walletMinFeePadding !== undefined) {
|
|
628
695
|
wallet.setMinFeePadding(opts.walletMinFeePadding);
|
|
629
696
|
}
|
|
697
|
+
logger.trace('Created PXE and test wallet');
|
|
630
698
|
|
|
631
|
-
const cheatCodes = await CheatCodes.create(
|
|
632
|
-
|
|
633
|
-
aztecNodeService,
|
|
634
|
-
dateProvider,
|
|
635
|
-
aztecNodeService.getAutomineSequencer(),
|
|
636
|
-
);
|
|
699
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, aztecNodeService, dateProvider);
|
|
700
|
+
logger.trace('Created cheat codes');
|
|
637
701
|
|
|
638
702
|
if (
|
|
639
703
|
(opts.aztecTargetCommitteeSize && opts.aztecTargetCommitteeSize > 0) ||
|
|
@@ -647,71 +711,48 @@ export async function setup(
|
|
|
647
711
|
);
|
|
648
712
|
await cheatCodes.rollup.setupEpoch();
|
|
649
713
|
await cheatCodes.rollup.debugRollup();
|
|
714
|
+
logger.trace('Advanced chain to set up validator committee');
|
|
650
715
|
}
|
|
651
716
|
|
|
652
717
|
let accounts: AztecAddress[] = [];
|
|
653
718
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
logger.info(
|
|
658
|
-
|
|
659
|
-
);
|
|
660
|
-
const accountsData = initialFundedAccounts.slice(0, numberOfAccounts);
|
|
661
|
-
const accountManagers = await deployFundedSchnorrAccounts(wallet, accountsData);
|
|
662
|
-
accounts = accountManagers.map(accountManager => accountManager.address);
|
|
663
|
-
} else if (needsEmptyBlock) {
|
|
664
|
-
logger.info('No accounts are being deployed, waiting for an empty block 1 to be mined');
|
|
665
|
-
// AutomineSequencer only builds on tx arrival; explicitly request an empty block.
|
|
666
|
-
const automine = aztecNodeService.getAutomineSequencer();
|
|
667
|
-
if (automine) {
|
|
668
|
-
await automine.buildEmptyBlock();
|
|
669
|
-
}
|
|
670
|
-
while ((await aztecNodeService.getBlockNumber()) === 0) {
|
|
671
|
-
await sleep(2000);
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
// If skipAccountDeployment is true, we don't deploy or wait - tests will handle account deployment later
|
|
675
|
-
|
|
676
|
-
// Now we restore the original minTxsPerBlock setting if we changed it.
|
|
677
|
-
if (sequencerClient && config.minTxsPerBlock !== originalMinTxsPerBlock) {
|
|
678
|
-
sequencerClient.getSequencer().updateConfig({ minTxsPerBlock: originalMinTxsPerBlock });
|
|
719
|
+
// Create the default accounts. They are initializerless, so this is a PXE-side operation (registration
|
|
720
|
+
// + a simulated store call) with no on-chain tx, independent of the sequencer.
|
|
721
|
+
if (numberOfAccounts > 0) {
|
|
722
|
+
logger.info(`Creating ${numberOfAccounts} initializerless test accounts`);
|
|
723
|
+
await testSpan('wallet:create', () => createFundedInitializerlessAccounts(wallet, defaultAccounts));
|
|
724
|
+
accounts = defaultAccounts.map(a => a.address);
|
|
679
725
|
}
|
|
726
|
+
logger.trace('Created funded test accounts');
|
|
680
727
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
728
|
+
const teardown = () =>
|
|
729
|
+
testSpan('teardown:env', async () => {
|
|
730
|
+
try {
|
|
731
|
+
await tryStop(wallet, logger);
|
|
732
|
+
await tryStop(aztecNodeService, logger);
|
|
733
|
+
await tryStop(proverNode, logger);
|
|
686
734
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
await tryStop(aztecNodeService, logger);
|
|
691
|
-
await tryStop(proverNode, logger);
|
|
735
|
+
if (acvmConfig?.cleanup) {
|
|
736
|
+
await acvmConfig.cleanup();
|
|
737
|
+
}
|
|
692
738
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
739
|
+
if (bbConfig?.cleanup) {
|
|
740
|
+
await bbConfig.cleanup();
|
|
741
|
+
}
|
|
696
742
|
|
|
697
|
-
|
|
698
|
-
await bbConfig.cleanup();
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
await tryStop(watcher, logger);
|
|
702
|
-
await tryStop(anvil, logger);
|
|
743
|
+
await tryStop(anvil, logger);
|
|
703
744
|
|
|
704
|
-
|
|
705
|
-
} catch (err) {
|
|
706
|
-
logger.error(`Error during e2e test teardown`, err);
|
|
707
|
-
} finally {
|
|
708
|
-
try {
|
|
709
|
-
await telemetryClient.stop();
|
|
745
|
+
await tryRmDir(directoryToCleanup, logger);
|
|
710
746
|
} catch (err) {
|
|
711
|
-
logger.error(`Error during
|
|
747
|
+
logger.error(`Error during e2e test teardown`, err);
|
|
748
|
+
} finally {
|
|
749
|
+
try {
|
|
750
|
+
await telemetryClient.stop();
|
|
751
|
+
} catch (err) {
|
|
752
|
+
logger.error(`Error during telemetry client stop`, err);
|
|
753
|
+
}
|
|
712
754
|
}
|
|
713
|
-
}
|
|
714
|
-
};
|
|
755
|
+
});
|
|
715
756
|
|
|
716
757
|
return {
|
|
717
758
|
anvil,
|
|
@@ -724,10 +765,11 @@ export async function setup(
|
|
|
724
765
|
aztecNodeConfig: config,
|
|
725
766
|
dateProvider,
|
|
726
767
|
deployL1ContractsValues,
|
|
727
|
-
|
|
768
|
+
additionallyFundedAccounts,
|
|
728
769
|
logger,
|
|
729
770
|
mockGossipSubNetwork,
|
|
730
771
|
genesis,
|
|
772
|
+
extraL1DeployResult,
|
|
731
773
|
proverNode,
|
|
732
774
|
sequencerDelayer,
|
|
733
775
|
proverDelayer,
|
|
@@ -736,7 +778,6 @@ export async function setup(
|
|
|
736
778
|
telemetryClient,
|
|
737
779
|
wallet,
|
|
738
780
|
accounts,
|
|
739
|
-
watcher,
|
|
740
781
|
acvmConfig,
|
|
741
782
|
bbConfig,
|
|
742
783
|
directoryToCleanup,
|
|
@@ -803,7 +844,12 @@ export async function registerSponsoredFPC(wallet: Wallet): Promise<void> {
|
|
|
803
844
|
await wallet.registerContract(await getSponsoredFPCInstance(), SponsoredFPCContract.artifact);
|
|
804
845
|
}
|
|
805
846
|
|
|
806
|
-
export async function waitForProvenChain(
|
|
847
|
+
export async function waitForProvenChain(
|
|
848
|
+
node: AztecNode,
|
|
849
|
+
targetBlock?: BlockNumber,
|
|
850
|
+
timeoutSec = 60,
|
|
851
|
+
intervalSec = 0.25,
|
|
852
|
+
) {
|
|
807
853
|
targetBlock ??= await node.getBlockNumber();
|
|
808
854
|
|
|
809
855
|
await retryUntil(
|
|
@@ -830,7 +876,7 @@ export function createAndSyncProverNode(
|
|
|
830
876
|
options: { genesis?: GenesisData; dontStart?: boolean },
|
|
831
877
|
): Promise<{ proverNode: AztecNodeService }> {
|
|
832
878
|
return withLoggerBindings({ actor: 'prover-0' }, async () => {
|
|
833
|
-
const proverNode = await
|
|
879
|
+
const proverNode = await createAztecNodeService(
|
|
834
880
|
{
|
|
835
881
|
...baseConfig,
|
|
836
882
|
...configOverrides,
|
|
@@ -905,14 +951,16 @@ export async function expectMappingDelta<K, V extends number | bigint>(
|
|
|
905
951
|
* surface as generic "Assertion failed:" and tests that match on the real message fail).
|
|
906
952
|
*/
|
|
907
953
|
export async function ensureAuthRegistryPublished(wallet: Wallet, from: AztecAddress) {
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
await
|
|
914
|
-
|
|
915
|
-
|
|
954
|
+
await testSpan('setup:auth-registry', async () => {
|
|
955
|
+
const { instance, contractClass } = await getStandardAuthRegistry();
|
|
956
|
+
if (!(await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
|
|
957
|
+
await (await publishContractClass(wallet, AuthRegistryArtifact)).send({ from });
|
|
958
|
+
}
|
|
959
|
+
if (!(await wallet.getContractMetadata(instance.address)).isContractPublished) {
|
|
960
|
+
await publishInstance(wallet, instance).send({ from });
|
|
961
|
+
}
|
|
962
|
+
await wallet.registerContract(instance, AuthRegistryArtifact);
|
|
963
|
+
});
|
|
916
964
|
}
|
|
917
965
|
|
|
918
966
|
/**
|
|
@@ -948,100 +996,6 @@ export async function ensureHandshakeRegistryPublished(wallet: Wallet, from: Azt
|
|
|
948
996
|
await wallet.registerContract(instance, HandshakeRegistryArtifact);
|
|
949
997
|
}
|
|
950
998
|
|
|
951
|
-
/**
|
|
952
|
-
* Registers the contract class used for test accounts and publicly deploys the instances requested.
|
|
953
|
-
* Use this when you need to make a public call to an account contract, such as for requesting a public authwit.
|
|
954
|
-
*/
|
|
955
|
-
export async function ensureAccountContractsPublished(wallet: Wallet, accountsToDeploy: AztecAddress[]) {
|
|
956
|
-
const accountsAndAddresses = await Promise.all(
|
|
957
|
-
accountsToDeploy.map(async address => {
|
|
958
|
-
return {
|
|
959
|
-
address,
|
|
960
|
-
deployed: (await wallet.getContractMetadata(address)).isContractPublished,
|
|
961
|
-
};
|
|
962
|
-
}),
|
|
963
|
-
);
|
|
964
|
-
const instances = (
|
|
965
|
-
await Promise.all(
|
|
966
|
-
accountsAndAddresses
|
|
967
|
-
.filter(({ deployed }) => !deployed)
|
|
968
|
-
.map(({ address }) => wallet.getContractMetadata(address)),
|
|
969
|
-
)
|
|
970
|
-
).map(contractMetadata => contractMetadata.instance);
|
|
971
|
-
const contractClass = await getContractClassFromArtifact(SchnorrAccountContractArtifact);
|
|
972
|
-
if (!(await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
|
|
973
|
-
await (await publishContractClass(wallet, SchnorrAccountContractArtifact)).send({ from: accountsToDeploy[0] });
|
|
974
|
-
}
|
|
975
|
-
const requests = instances.map(instance => publishInstance(wallet, instance!));
|
|
976
|
-
const batch = new BatchCall(wallet, requests);
|
|
977
|
-
await batch.send({ from: accountsToDeploy[0] });
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
/**
|
|
981
|
-
* Helper function to deploy accounts.
|
|
982
|
-
* Returns deployed account data that can be used by tests.
|
|
983
|
-
*/
|
|
984
|
-
export const deployAccounts =
|
|
985
|
-
(numberOfAccounts: number, logger: Logger, deployOptions?: Partial<DeployOptions<InteractionWaitOptions>>) =>
|
|
986
|
-
async ({ wallet, initialFundedAccounts }: { wallet: TestWallet; initialFundedAccounts: InitialAccountData[] }) => {
|
|
987
|
-
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
988
|
-
throw new Error(`Cannot deploy more than ${initialFundedAccounts.length} initial accounts.`);
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
logger.verbose('Deploying accounts funded with fee juice...');
|
|
992
|
-
const deployedAccounts = initialFundedAccounts.slice(0, numberOfAccounts);
|
|
993
|
-
// Serial due to https://github.com/AztecProtocol/aztec-packages/issues/12045
|
|
994
|
-
for (let i = 0; i < deployedAccounts.length; i++) {
|
|
995
|
-
const accountManager = await wallet.createSchnorrAccount(
|
|
996
|
-
deployedAccounts[i].secret,
|
|
997
|
-
deployedAccounts[i].salt,
|
|
998
|
-
deployedAccounts[i].signingKey,
|
|
999
|
-
);
|
|
1000
|
-
const deployMethod = await accountManager.getDeployMethod();
|
|
1001
|
-
await deployMethod.send({
|
|
1002
|
-
from: NO_FROM,
|
|
1003
|
-
skipClassPublication: i !== 0, // Publish the contract class at most once.
|
|
1004
|
-
...deployOptions,
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
return { deployedAccounts };
|
|
1009
|
-
};
|
|
1010
|
-
|
|
1011
|
-
/**
|
|
1012
|
-
* Registers the contract class used for test accounts and publicly deploys the instances requested.
|
|
1013
|
-
* Use this when you need to make a public call to an account contract, such as for requesting a public authwit.
|
|
1014
|
-
*/
|
|
1015
|
-
export async function publicDeployAccounts(
|
|
1016
|
-
wallet: Wallet,
|
|
1017
|
-
accountsToDeploy: AztecAddress[],
|
|
1018
|
-
waitUntilProven = false,
|
|
1019
|
-
node?: AztecNode,
|
|
1020
|
-
) {
|
|
1021
|
-
const instances = (await Promise.all(accountsToDeploy.map(account => wallet.getContractMetadata(account)))).map(
|
|
1022
|
-
metadata => metadata.instance,
|
|
1023
|
-
);
|
|
1024
|
-
|
|
1025
|
-
const contractClass = await getContractClassFromArtifact(SchnorrAccountContractArtifact);
|
|
1026
|
-
const alreadyRegistered = (await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered;
|
|
1027
|
-
|
|
1028
|
-
const calls: ContractFunctionInteraction[] = await Promise.all([
|
|
1029
|
-
...(!alreadyRegistered ? [publishContractClass(wallet, SchnorrAccountContractArtifact)] : []),
|
|
1030
|
-
...instances.map(instance => publishInstance(wallet, instance!)),
|
|
1031
|
-
]);
|
|
1032
|
-
|
|
1033
|
-
const batch = new BatchCall(wallet, calls);
|
|
1034
|
-
|
|
1035
|
-
const { receipt: txReceipt } = await batch.send({ from: accountsToDeploy[0] });
|
|
1036
|
-
if (waitUntilProven) {
|
|
1037
|
-
if (!node) {
|
|
1038
|
-
throw new Error('Need to provide an AztecNode to wait for proven.');
|
|
1039
|
-
} else {
|
|
1040
|
-
await waitForProven(node, txReceipt);
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
999
|
/**
|
|
1046
1000
|
* Destroys the current context.
|
|
1047
1001
|
*/
|