@aztec/end-to-end 0.0.1-commit.3469e52 → 0.0.1-commit.35158ae7e
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/dest/bench/client_flows/client_flows_benchmark.d.ts +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +49 -26
- package/dest/bench/client_flows/config.d.ts +2 -2
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +18 -0
- package/dest/bench/utils.d.ts +5 -4
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +13 -8
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +4 -2
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +27 -18
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +2 -2
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +3 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts +17 -7
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +90 -40
- package/dest/e2e_fees/bridging_race.notest.js +1 -1
- package/dest/e2e_fees/fees_test.d.ts +2 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +24 -17
- package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +1 -7
- package/dest/e2e_nested_contract/nested_contract_test.js +4 -6
- package/dest/e2e_p2p/p2p_network.d.ts +5 -4
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +29 -8
- package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/e2e_p2p/reqresp/utils.js +190 -0
- package/dest/e2e_p2p/shared.d.ts +26 -6
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +46 -18
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
- package/dest/e2e_token_contract/token_contract_test.d.ts +4 -2
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +20 -10
- package/dest/fixtures/authwit_proxy.d.ts +15 -0
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.js +30 -0
- package/dest/fixtures/e2e_prover_test.d.ts +7 -6
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +44 -50
- package/dest/fixtures/elu_monitor.d.ts +21 -0
- package/dest/fixtures/elu_monitor.d.ts.map +1 -0
- package/dest/fixtures/elu_monitor.js +102 -0
- package/dest/fixtures/fixtures.d.ts +5 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +6 -0
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/ha_setup.d.ts +71 -0
- package/dest/fixtures/ha_setup.d.ts.map +1 -0
- package/dest/fixtures/ha_setup.js +116 -0
- 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 +48 -25
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +97 -172
- package/dest/fixtures/setup_p2p_test.d.ts +16 -9
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +40 -29
- package/dest/fixtures/token_utils.d.ts +2 -2
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +12 -8
- package/dest/shared/cross_chain_test_harness.d.ts +3 -4
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +24 -24
- package/dest/shared/gas_portal_test_harness.js +3 -3
- package/dest/shared/index.d.ts +2 -1
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/index.js +1 -0
- package/dest/shared/jest_setup.js +41 -1
- package/dest/shared/mock_state_view.d.ts +86 -0
- package/dest/shared/mock_state_view.d.ts.map +1 -0
- package/dest/shared/mock_state_view.js +186 -0
- package/dest/shared/submit-transactions.d.ts +4 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +9 -11
- 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 +27 -28
- package/dest/simulators/lending_simulator.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +6 -6
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +3 -24
- package/dest/spartan/setup_test_wallets.d.ts +12 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +162 -41
- package/dest/spartan/tx_metrics.d.ts +38 -2
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +179 -5
- package/dest/spartan/utils/bot.d.ts +28 -0
- package/dest/spartan/utils/bot.d.ts.map +1 -0
- package/dest/spartan/utils/bot.js +142 -0
- package/dest/spartan/utils/chaos.d.ts +79 -0
- package/dest/spartan/utils/chaos.d.ts.map +1 -0
- package/dest/spartan/utils/chaos.js +142 -0
- package/dest/spartan/utils/clients.d.ts +39 -0
- package/dest/spartan/utils/clients.d.ts.map +1 -0
- package/dest/spartan/utils/clients.js +90 -0
- package/dest/spartan/utils/config.d.ts +45 -0
- package/dest/spartan/utils/config.d.ts.map +1 -0
- package/dest/spartan/utils/config.js +23 -0
- package/dest/spartan/utils/health.d.ts +63 -0
- package/dest/spartan/utils/health.d.ts.map +1 -0
- package/dest/spartan/utils/health.js +202 -0
- package/dest/spartan/utils/helm.d.ts +15 -0
- package/dest/spartan/utils/helm.d.ts.map +1 -0
- package/dest/spartan/utils/helm.js +47 -0
- package/dest/spartan/utils/index.d.ts +11 -0
- package/dest/spartan/utils/index.d.ts.map +1 -0
- package/dest/spartan/utils/index.js +22 -0
- package/dest/spartan/utils/k8s.d.ts +128 -0
- package/dest/spartan/utils/k8s.d.ts.map +1 -0
- package/dest/spartan/utils/k8s.js +381 -0
- package/dest/spartan/utils/nodes.d.ts +40 -0
- package/dest/spartan/utils/nodes.d.ts.map +1 -0
- package/dest/spartan/utils/nodes.js +461 -0
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -0
- package/dest/spartan/utils/scripts.d.ts +30 -0
- package/dest/spartan/utils/scripts.d.ts.map +1 -0
- package/dest/spartan/utils/scripts.js +81 -0
- package/dest/spartan/utils.d.ts +2 -260
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -942
- package/dest/test-wallet/test_wallet.d.ts +76 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +213 -0
- package/dest/test-wallet/utils.d.ts +41 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +71 -0
- package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
- package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
- package/dest/test-wallet/wallet_worker_script.js +48 -0
- package/dest/test-wallet/worker_wallet.d.ts +52 -0
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet.js +151 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts +274 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet_schema.js +10 -0
- package/package.json +45 -43
- package/src/bench/client_flows/client_flows_benchmark.ts +50 -58
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/utils.ts +15 -8
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +33 -23
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +7 -8
- package/src/e2e_deploy_contract/deploy_test.ts +3 -3
- package/src/e2e_epochs/epochs_test.ts +139 -91
- package/src/e2e_fees/bridging_race.notest.ts +2 -5
- package/src/e2e_fees/fees_test.ts +28 -40
- package/src/e2e_l1_publisher/write_json.ts +3 -8
- package/src/e2e_nested_contract/nested_contract_test.ts +7 -7
- package/src/e2e_p2p/inactivity_slash_test.ts +4 -4
- package/src/e2e_p2p/p2p_network.ts +50 -18
- package/src/e2e_p2p/reqresp/utils.ts +256 -0
- package/src/e2e_p2p/shared.ts +76 -23
- package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
- package/src/e2e_token_contract/token_contract_test.ts +27 -12
- package/src/fixtures/authwit_proxy.ts +50 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +48 -63
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +10 -0
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +186 -0
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/setup.ts +131 -235
- package/src/fixtures/setup_p2p_test.ts +40 -44
- package/src/fixtures/token_utils.ts +10 -6
- package/src/guides/up_quick_start.sh +3 -3
- package/src/shared/cross_chain_test_harness.ts +24 -34
- package/src/shared/gas_portal_test_harness.ts +2 -2
- package/src/shared/index.ts +1 -0
- package/src/shared/jest_setup.ts +51 -1
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +11 -16
- package/src/shared/uniswap_l1_l2.ts +49 -51
- package/src/simulators/lending_simulator.ts +10 -6
- package/src/simulators/token_simulator.ts +6 -30
- package/src/spartan/setup_test_wallets.ts +205 -26
- package/src/spartan/tx_metrics.ts +153 -8
- package/src/spartan/utils/bot.ts +188 -0
- package/src/spartan/utils/chaos.ts +253 -0
- package/src/spartan/utils/clients.ts +100 -0
- package/src/spartan/utils/config.ts +29 -0
- package/src/spartan/utils/health.ts +255 -0
- package/src/spartan/utils/helm.ts +84 -0
- package/src/spartan/utils/index.ts +71 -0
- package/src/spartan/utils/k8s.ts +535 -0
- package/src/spartan/utils/nodes.ts +543 -0
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/spartan/utils/scripts.ts +99 -0
- package/src/spartan/utils.ts +1 -1246
- package/src/test-wallet/test_wallet.ts +301 -0
- package/src/test-wallet/utils.ts +112 -0
- package/src/test-wallet/wallet_worker_script.ts +60 -0
- package/src/test-wallet/worker_wallet.ts +213 -0
- package/src/test-wallet/worker_wallet_schema.ts +13 -0
package/src/fixtures/setup.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr';
|
|
2
|
-
import { type InitialAccountData, generateSchnorrAccounts
|
|
3
|
-
import { type Archiver, createArchiver } from '@aztec/archiver';
|
|
2
|
+
import { type InitialAccountData, generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
4
3
|
import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
4
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
5
5
|
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
6
6
|
import {
|
|
7
7
|
BatchCall,
|
|
@@ -13,10 +13,9 @@ import {
|
|
|
13
13
|
import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
|
|
14
14
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
15
15
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
16
|
-
import {
|
|
16
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
17
17
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
18
18
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
19
|
-
import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
20
19
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
21
20
|
import { isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
22
21
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
@@ -30,35 +29,28 @@ import {
|
|
|
30
29
|
type ZKPassportArgs,
|
|
31
30
|
deployAztecL1Contracts,
|
|
32
31
|
} from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
EthCheatCodesWithState,
|
|
37
|
-
createDelayedL1TxUtilsFromViemWallet,
|
|
38
|
-
startAnvil,
|
|
39
|
-
} from '@aztec/ethereum/test';
|
|
32
|
+
import type { Delayer } from '@aztec/ethereum/l1-tx-utils';
|
|
33
|
+
import { EthCheatCodes, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
34
|
+
import type { Anvil } from '@aztec/ethereum/test';
|
|
40
35
|
import { BlockNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
41
36
|
import { SecretValue } from '@aztec/foundation/config';
|
|
42
37
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
43
38
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
44
|
-
import {
|
|
39
|
+
import { withLoggerBindings } from '@aztec/foundation/log/server';
|
|
45
40
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
46
41
|
import { sleep } from '@aztec/foundation/sleep';
|
|
47
42
|
import { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
|
|
48
|
-
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
49
43
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
50
44
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
51
45
|
import type { P2PClientDeps } from '@aztec/p2p';
|
|
52
46
|
import { MockGossipSubNetwork, getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
53
47
|
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
54
|
-
import
|
|
48
|
+
import type { ProverNodeConfig } from '@aztec/prover-node';
|
|
55
49
|
import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
56
50
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
57
|
-
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
58
51
|
import { type ContractInstanceWithAddress, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
59
52
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
60
53
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
61
|
-
import type { P2PClientType } from '@aztec/stdlib/p2p';
|
|
62
54
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
63
55
|
import {
|
|
64
56
|
type TelemetryClient,
|
|
@@ -67,10 +59,9 @@ import {
|
|
|
67
59
|
initTelemetryClient,
|
|
68
60
|
} from '@aztec/telemetry-client';
|
|
69
61
|
import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
70
|
-
import {
|
|
62
|
+
import { deployFundedSchnorrAccounts } from '@aztec/wallets/testing';
|
|
71
63
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
72
64
|
|
|
73
|
-
import type { Anvil } from '@viem/anvil';
|
|
74
65
|
import fs from 'fs/promises';
|
|
75
66
|
import { tmpdir } from 'os';
|
|
76
67
|
import path from 'path';
|
|
@@ -84,6 +75,7 @@ import {
|
|
|
84
75
|
} from 'viem/accounts';
|
|
85
76
|
import { type Chain, foundry } from 'viem/chains';
|
|
86
77
|
|
|
78
|
+
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
87
79
|
import { MNEMONIC, TEST_MAX_PENDING_TX_POOL_COUNT, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
88
80
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
89
81
|
import { getBBConfig } from './get_bb_config.js';
|
|
@@ -92,9 +84,6 @@ import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
|
|
|
92
84
|
|
|
93
85
|
export { startAnvil };
|
|
94
86
|
|
|
95
|
-
const { AZTEC_NODE_URL = '' } = process.env;
|
|
96
|
-
const getAztecUrl = () => AZTEC_NODE_URL;
|
|
97
|
-
|
|
98
87
|
let telemetry: TelemetryClient | undefined = undefined;
|
|
99
88
|
async function getTelemetryClient(partialConfig: Partial<TelemetryClientConfig> & { benchmark?: boolean } = {}) {
|
|
100
89
|
if (!telemetry) {
|
|
@@ -125,14 +114,14 @@ export async function setupSharedBlobStorage(config: { dataDirectory?: string }
|
|
|
125
114
|
* @param aztecNode - An instance of Aztec Node.
|
|
126
115
|
* @param opts - Partial configuration for the PXE.
|
|
127
116
|
* @param logger - The logger to be used.
|
|
128
|
-
* @param
|
|
117
|
+
* @param actor - Actor label to include in log output (e.g., 'pxe-test').
|
|
129
118
|
* @returns A test wallet, logger and teardown function.
|
|
130
119
|
*/
|
|
131
120
|
export async function setupPXEAndGetWallet(
|
|
132
121
|
aztecNode: AztecNode,
|
|
133
122
|
opts: Partial<PXEConfig> = {},
|
|
134
123
|
logger = getLogger(),
|
|
135
|
-
|
|
124
|
+
actor?: string,
|
|
136
125
|
): Promise<{
|
|
137
126
|
wallet: TestWallet;
|
|
138
127
|
logger: Logger;
|
|
@@ -150,9 +139,7 @@ export async function setupPXEAndGetWallet(
|
|
|
150
139
|
|
|
151
140
|
const teardown = configuredDataDirectory ? () => Promise.resolve() : () => tryRmDir(PXEConfig.dataDirectory!);
|
|
152
141
|
|
|
153
|
-
const wallet = await TestWallet.create(aztecNode, PXEConfig, {
|
|
154
|
-
useLogSuffix,
|
|
155
|
-
});
|
|
142
|
+
const wallet = await TestWallet.create(aztecNode, PXEConfig, { loggerActorLabel: actor });
|
|
156
143
|
|
|
157
144
|
return {
|
|
158
145
|
wallet,
|
|
@@ -199,6 +186,11 @@ export type SetupOptions = {
|
|
|
199
186
|
anvilAccounts?: number;
|
|
200
187
|
/** Port to start anvil (defaults to 8545) */
|
|
201
188
|
anvilPort?: number;
|
|
189
|
+
/**
|
|
190
|
+
* Number of slots per epoch for Anvil's finality simulation.
|
|
191
|
+
* Anvil reports `finalized = latest - slotsInAnEpoch * 2`.
|
|
192
|
+
*/
|
|
193
|
+
anvilSlotsInAnEpoch?: number;
|
|
202
194
|
/** Key to use for publishing L1 contracts */
|
|
203
195
|
l1PublisherKey?: SecretValue<`0x${string}`>;
|
|
204
196
|
/** ZkPassport configuration (domain, scope, mock verifier) */
|
|
@@ -209,6 +201,8 @@ export type SetupOptions = {
|
|
|
209
201
|
skipAccountDeployment?: boolean;
|
|
210
202
|
/** L1 contracts deployment arguments. */
|
|
211
203
|
l1ContractsArgs?: Partial<DeployAztecL1ContractsArgs>;
|
|
204
|
+
/** Wallet minimum fee padding multiplier (defaults to 0.5, which is 50% padding). */
|
|
205
|
+
walletMinFeePadding?: number;
|
|
212
206
|
} & Partial<AztecNodeConfig>;
|
|
213
207
|
|
|
214
208
|
/** Context for an end-to-end test as returned by the `setup` function */
|
|
@@ -217,13 +211,13 @@ export type EndToEndContext = {
|
|
|
217
211
|
anvil: Anvil | undefined;
|
|
218
212
|
/** The Aztec Node service or client a connected to it. */
|
|
219
213
|
aztecNode: AztecNode;
|
|
220
|
-
/** The Aztec Node as a service
|
|
221
|
-
aztecNodeService: AztecNodeService
|
|
222
|
-
/** Client to the Aztec Node admin interface
|
|
223
|
-
aztecNodeAdmin: AztecNodeAdmin
|
|
224
|
-
/** The prover node
|
|
225
|
-
proverNode:
|
|
226
|
-
/** A client to the sequencer service
|
|
214
|
+
/** The Aztec Node as a service. */
|
|
215
|
+
aztecNodeService: AztecNodeService;
|
|
216
|
+
/** Client to the Aztec Node admin interface. */
|
|
217
|
+
aztecNodeAdmin: AztecNodeAdmin;
|
|
218
|
+
/** The aztec node running the prover node subsystem (only set if startProverNode is true). */
|
|
219
|
+
proverNode: AztecNodeService | undefined;
|
|
220
|
+
/** A client to the sequencer service. */
|
|
227
221
|
sequencer: SequencerClient | undefined;
|
|
228
222
|
/** Return values from deployAztecL1Contracts function. */
|
|
229
223
|
deployL1ContractsValues: DeployAztecL1ContractsReturnType;
|
|
@@ -243,14 +237,18 @@ export type EndToEndContext = {
|
|
|
243
237
|
cheatCodes: CheatCodes;
|
|
244
238
|
/** The cheat codes for L1 */
|
|
245
239
|
ethCheatCodes: EthCheatCodes;
|
|
246
|
-
/** The anvil test watcher
|
|
247
|
-
watcher: AnvilTestWatcher
|
|
248
|
-
/** Allows tweaking current system time, used by the epoch cache only
|
|
249
|
-
dateProvider: TestDateProvider
|
|
240
|
+
/** The anvil test watcher. */
|
|
241
|
+
watcher: AnvilTestWatcher;
|
|
242
|
+
/** Allows tweaking current system time, used by the epoch cache only. */
|
|
243
|
+
dateProvider: TestDateProvider;
|
|
250
244
|
/** Telemetry client */
|
|
251
|
-
telemetryClient: TelemetryClient
|
|
245
|
+
telemetryClient: TelemetryClient;
|
|
252
246
|
/** Mock gossip sub network used for gossipping messages (only if mockGossipSubNetwork was set to true in opts) */
|
|
253
247
|
mockGossipSubNetwork: MockGossipSubNetwork | undefined;
|
|
248
|
+
/** Delayer for sequencer L1 txs (only when enableDelayer is true). */
|
|
249
|
+
sequencerDelayer: Delayer | undefined;
|
|
250
|
+
/** Delayer for prover node L1 txs (only when enableDelayer and startProverNode are true). */
|
|
251
|
+
proverDelayer: Delayer | undefined;
|
|
254
252
|
/** Prefilled public data used for setting up nodes. */
|
|
255
253
|
prefilledPublicData: PublicDataTreeLeaf[] | undefined;
|
|
256
254
|
/** ACVM config (only set if running locally). */
|
|
@@ -258,82 +256,11 @@ export type EndToEndContext = {
|
|
|
258
256
|
/** BB config (only set if running locally). */
|
|
259
257
|
bbConfig: Awaited<ReturnType<typeof getBBConfig>>;
|
|
260
258
|
/** Directory to cleanup on teardown. */
|
|
261
|
-
directoryToCleanup: string
|
|
259
|
+
directoryToCleanup: string;
|
|
262
260
|
/** Function to stop the started services. */
|
|
263
261
|
teardown: () => Promise<void>;
|
|
264
262
|
};
|
|
265
263
|
|
|
266
|
-
/**
|
|
267
|
-
* Function to setup the test against a remote deployment. It is assumed that L1 contract are already deployed
|
|
268
|
-
*/
|
|
269
|
-
async function setupWithRemoteEnvironment(
|
|
270
|
-
account: HDAccount | PrivateKeyAccount,
|
|
271
|
-
config: AztecNodeConfig,
|
|
272
|
-
logger: Logger,
|
|
273
|
-
numberOfAccounts: number,
|
|
274
|
-
): Promise<EndToEndContext> {
|
|
275
|
-
const aztecNodeUrl = getAztecUrl();
|
|
276
|
-
logger.verbose(`Creating Aztec Node client to remote host ${aztecNodeUrl}`);
|
|
277
|
-
const aztecNode = createAztecNodeClient(aztecNodeUrl);
|
|
278
|
-
await waitForNode(aztecNode, logger);
|
|
279
|
-
logger.verbose('JSON RPC client connected to Aztec Node');
|
|
280
|
-
logger.verbose(`Retrieving contract addresses from ${aztecNodeUrl}`);
|
|
281
|
-
const { l1ContractAddresses, rollupVersion } = await aztecNode.getNodeInfo();
|
|
282
|
-
|
|
283
|
-
const l1Client = createExtendedL1Client(config.l1RpcUrls, account, foundry);
|
|
284
|
-
|
|
285
|
-
const deployL1ContractsValues: DeployAztecL1ContractsReturnType = {
|
|
286
|
-
l1ContractAddresses,
|
|
287
|
-
l1Client,
|
|
288
|
-
rollupVersion,
|
|
289
|
-
};
|
|
290
|
-
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls, new DateProvider());
|
|
291
|
-
const wallet = await TestWallet.create(aztecNode);
|
|
292
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, aztecNode, new DateProvider());
|
|
293
|
-
const teardown = () => Promise.resolve();
|
|
294
|
-
|
|
295
|
-
logger.verbose('Populating wallet from already registered accounts...');
|
|
296
|
-
const initialFundedAccounts = await getInitialTestAccountsData();
|
|
297
|
-
|
|
298
|
-
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
299
|
-
throw new Error(`Required ${numberOfAccounts} accounts. Found ${initialFundedAccounts.length}.`);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
const testAccounts = await Promise.all(
|
|
303
|
-
initialFundedAccounts.slice(0, numberOfAccounts).map(async account => {
|
|
304
|
-
const accountManager = await wallet.createSchnorrAccount(account.secret, account.salt, account.signingKey);
|
|
305
|
-
return accountManager.address;
|
|
306
|
-
}),
|
|
307
|
-
);
|
|
308
|
-
|
|
309
|
-
return {
|
|
310
|
-
anvil: undefined,
|
|
311
|
-
aztecNode,
|
|
312
|
-
aztecNodeService: undefined,
|
|
313
|
-
aztecNodeAdmin: undefined,
|
|
314
|
-
sequencer: undefined,
|
|
315
|
-
proverNode: undefined,
|
|
316
|
-
deployL1ContractsValues,
|
|
317
|
-
config,
|
|
318
|
-
aztecNodeConfig: config,
|
|
319
|
-
initialFundedAccounts,
|
|
320
|
-
wallet,
|
|
321
|
-
accounts: testAccounts,
|
|
322
|
-
logger,
|
|
323
|
-
cheatCodes,
|
|
324
|
-
ethCheatCodes,
|
|
325
|
-
prefilledPublicData: undefined,
|
|
326
|
-
mockGossipSubNetwork: undefined,
|
|
327
|
-
watcher: undefined,
|
|
328
|
-
dateProvider: undefined,
|
|
329
|
-
telemetryClient: undefined,
|
|
330
|
-
acvmConfig: undefined,
|
|
331
|
-
bbConfig: undefined,
|
|
332
|
-
directoryToCleanup: undefined,
|
|
333
|
-
teardown,
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
|
|
337
264
|
/**
|
|
338
265
|
* Sets up the environment for the end-to-end tests.
|
|
339
266
|
* @param numberOfAccounts - The number of new accounts to be created once the PXE is initiated.
|
|
@@ -361,8 +288,12 @@ export async function setup(
|
|
|
361
288
|
config.realProofs = !!opts.realProofs;
|
|
362
289
|
// Only enforce the time table if requested
|
|
363
290
|
config.enforceTimeTable = !!opts.enforceTimeTable;
|
|
291
|
+
// Enable the tx delayer for tests (default config has it disabled, so we force-enable it here)
|
|
292
|
+
config.enableDelayer = true;
|
|
364
293
|
config.listenAddress = '127.0.0.1';
|
|
365
294
|
|
|
295
|
+
config.minTxPoolAgeMs = opts.minTxPoolAgeMs ?? 0;
|
|
296
|
+
|
|
366
297
|
const logger = getLogger();
|
|
367
298
|
|
|
368
299
|
// Create a temp directory for any services that need it and cleanup later
|
|
@@ -372,20 +303,18 @@ export async function setup(
|
|
|
372
303
|
config.dataDirectory = directoryToCleanup;
|
|
373
304
|
}
|
|
374
305
|
|
|
306
|
+
const dateProvider = new TestDateProvider();
|
|
307
|
+
|
|
375
308
|
if (!config.l1RpcUrls?.length) {
|
|
376
309
|
if (!isAnvilTestChain(chain.id)) {
|
|
377
310
|
throw new Error(`No ETHEREUM_HOSTS set but non anvil chain requested`);
|
|
378
311
|
}
|
|
379
|
-
if (AZTEC_NODE_URL) {
|
|
380
|
-
throw new Error(
|
|
381
|
-
`AZTEC_NODE_URL provided but no ETHEREUM_HOSTS set. Refusing to run, please set both variables so tests can deploy L1 contracts to the same Anvil instance`,
|
|
382
|
-
);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
312
|
const res = await startAnvil({
|
|
386
313
|
l1BlockTime: opts.ethereumSlotDuration,
|
|
387
314
|
accounts: opts.anvilAccounts,
|
|
388
|
-
port: opts.anvilPort,
|
|
315
|
+
port: opts.anvilPort ?? (process.env.ANVIL_PORT ? parseInt(process.env.ANVIL_PORT) : undefined),
|
|
316
|
+
slotsInAnEpoch: opts.anvilSlotsInAnEpoch,
|
|
317
|
+
dateProvider,
|
|
389
318
|
});
|
|
390
319
|
anvil = res.anvil;
|
|
391
320
|
config.l1RpcUrls = [res.rpcUrl];
|
|
@@ -397,8 +326,6 @@ export async function setup(
|
|
|
397
326
|
logger.info(`Logging metrics to ${filename}`);
|
|
398
327
|
setupMetricsLogger(filename);
|
|
399
328
|
}
|
|
400
|
-
|
|
401
|
-
const dateProvider = new TestDateProvider();
|
|
402
329
|
const ethCheatCodes = new EthCheatCodesWithState(config.l1RpcUrls, dateProvider);
|
|
403
330
|
|
|
404
331
|
if (opts.stateLoad) {
|
|
@@ -416,11 +343,11 @@ export async function setup(
|
|
|
416
343
|
publisherPrivKeyHex = opts.l1PublisherKey.getValue();
|
|
417
344
|
publisherHdAccount = privateKeyToAccount(publisherPrivKeyHex);
|
|
418
345
|
} else if (
|
|
419
|
-
config.
|
|
420
|
-
config.
|
|
421
|
-
config.
|
|
346
|
+
config.sequencerPublisherPrivateKeys &&
|
|
347
|
+
config.sequencerPublisherPrivateKeys.length > 0 &&
|
|
348
|
+
config.sequencerPublisherPrivateKeys[0].getValue() != NULL_KEY
|
|
422
349
|
) {
|
|
423
|
-
publisherPrivKeyHex = config.
|
|
350
|
+
publisherPrivKeyHex = config.sequencerPublisherPrivateKeys[0].getValue();
|
|
424
351
|
publisherHdAccount = privateKeyToAccount(publisherPrivKeyHex);
|
|
425
352
|
} else if (!MNEMONIC) {
|
|
426
353
|
throw new Error(`Mnemonic not provided and no publisher private key`);
|
|
@@ -429,18 +356,13 @@ export async function setup(
|
|
|
429
356
|
const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
|
|
430
357
|
const publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
431
358
|
publisherPrivKeyHex = `0x${publisherPrivKey!.toString('hex')}` as const;
|
|
432
|
-
config.
|
|
359
|
+
config.sequencerPublisherPrivateKeys = [new SecretValue(publisherPrivKeyHex)];
|
|
433
360
|
}
|
|
434
361
|
|
|
435
362
|
if (config.coinbase === undefined) {
|
|
436
363
|
config.coinbase = EthAddress.fromString(publisherHdAccount.address);
|
|
437
364
|
}
|
|
438
365
|
|
|
439
|
-
if (AZTEC_NODE_URL) {
|
|
440
|
-
// we are setting up against a remote environment, l1 contracts are assumed to already be deployed
|
|
441
|
-
return await setupWithRemoteEnvironment(publisherHdAccount!, config, logger, numberOfAccounts);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
366
|
// Determine which addresses to fund in genesis
|
|
445
367
|
const initialFundedAccounts =
|
|
446
368
|
opts.initialFundedAccounts ??
|
|
@@ -497,7 +419,13 @@ export async function setup(
|
|
|
497
419
|
if (enableAutomine) {
|
|
498
420
|
await ethCheatCodes.setAutomine(false);
|
|
499
421
|
await ethCheatCodes.setIntervalMining(config.ethereumSlotDuration);
|
|
500
|
-
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// In compose mode (no local anvil), sync dateProvider to L1 time since it may have drifted
|
|
425
|
+
// ahead of system time due to the local-network watcher warping time forward on each filled slot.
|
|
426
|
+
// When running with a local anvil, the dateProvider is kept in sync via the stdout listener.
|
|
427
|
+
if (!anvil) {
|
|
428
|
+
dateProvider.setTime((await ethCheatCodes.lastBlockTimestamp()) * 1000);
|
|
501
429
|
}
|
|
502
430
|
|
|
503
431
|
if (opts.l2StartTime) {
|
|
@@ -536,7 +464,7 @@ export async function setup(
|
|
|
536
464
|
}
|
|
537
465
|
|
|
538
466
|
let mockGossipSubNetwork: MockGossipSubNetwork | undefined;
|
|
539
|
-
let p2pClientDeps: P2PClientDeps
|
|
467
|
+
let p2pClientDeps: P2PClientDeps | undefined = undefined;
|
|
540
468
|
|
|
541
469
|
if (opts.mockGossipSubNetwork) {
|
|
542
470
|
mockGossipSubNetwork = new MockGossipSubNetwork();
|
|
@@ -567,44 +495,52 @@ export async function setup(
|
|
|
567
495
|
}
|
|
568
496
|
}
|
|
569
497
|
|
|
570
|
-
const aztecNodeService = await
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
498
|
+
const aztecNodeService = await withLoggerBindings({ actor: 'node-0' }, () =>
|
|
499
|
+
AztecNodeService.createAndSync(
|
|
500
|
+
config,
|
|
501
|
+
{ dateProvider, telemetry: telemetryClient, p2pClientDeps },
|
|
502
|
+
{ prefilledPublicData },
|
|
503
|
+
),
|
|
574
504
|
);
|
|
575
505
|
const sequencerClient = aztecNodeService.getSequencer();
|
|
576
506
|
|
|
577
|
-
|
|
578
|
-
const publisher = (sequencerClient as TestSequencerClient).sequencer.publisher;
|
|
579
|
-
publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration, l1Client);
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
let proverNode: ProverNode | undefined = undefined;
|
|
507
|
+
let proverNode: AztecNodeService | undefined = undefined;
|
|
583
508
|
if (opts.startProverNode) {
|
|
584
509
|
logger.verbose('Creating and syncing a simulated prover node...');
|
|
585
510
|
const proverNodePrivateKey = getPrivateKeyFromIndex(2);
|
|
586
511
|
const proverNodePrivateKeyHex: Hex = `0x${proverNodePrivateKey!.toString('hex')}`;
|
|
587
512
|
const proverNodeDataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
513
|
+
|
|
514
|
+
const p2pClientDeps: Partial<P2PClientDeps> = {
|
|
515
|
+
p2pServiceFactory: mockGossipSubNetwork && getMockPubSubP2PServiceFactory(mockGossipSubNetwork!),
|
|
516
|
+
rpcTxProviders: [aztecNodeService],
|
|
592
517
|
};
|
|
593
|
-
|
|
518
|
+
|
|
519
|
+
({ proverNode } = await createAndSyncProverNode(
|
|
594
520
|
proverNodePrivateKeyHex,
|
|
595
521
|
config,
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
522
|
+
{
|
|
523
|
+
...config.proverNodeConfig,
|
|
524
|
+
dataDirectory: proverNodeDataDirectory,
|
|
525
|
+
},
|
|
526
|
+
{ dateProvider, p2pClientDeps, telemetry: telemetryClient },
|
|
527
|
+
{ prefilledPublicData },
|
|
528
|
+
));
|
|
600
529
|
}
|
|
601
530
|
|
|
531
|
+
const sequencerDelayer = sequencerClient?.getDelayer();
|
|
532
|
+
const proverDelayer = proverNode?.getProverNode()?.getDelayer();
|
|
533
|
+
|
|
602
534
|
logger.verbose('Creating a pxe...');
|
|
603
535
|
const pxeConfig = { ...getPXEConfig(), ...pxeOpts };
|
|
604
536
|
pxeConfig.dataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
605
537
|
// For tests we only want proving enabled if specifically requested
|
|
606
538
|
pxeConfig.proverEnabled = !!pxeOpts.proverEnabled;
|
|
607
|
-
const wallet = await TestWallet.create(aztecNodeService, pxeConfig);
|
|
539
|
+
const wallet = await TestWallet.create(aztecNodeService, pxeConfig, { loggerActorLabel: 'pxe-0' });
|
|
540
|
+
|
|
541
|
+
if (opts.walletMinFeePadding !== undefined) {
|
|
542
|
+
wallet.setMinFeePadding(opts.walletMinFeePadding);
|
|
543
|
+
}
|
|
608
544
|
|
|
609
545
|
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, aztecNodeService, dateProvider);
|
|
610
546
|
|
|
@@ -629,7 +565,7 @@ export async function setup(
|
|
|
629
565
|
`${numberOfAccounts} accounts are being deployed. Reliably progressing past genesis by setting minTxsPerBlock to 1 and waiting for the accounts to be deployed`,
|
|
630
566
|
);
|
|
631
567
|
const accountsData = initialFundedAccounts.slice(0, numberOfAccounts);
|
|
632
|
-
const accountManagers = await deployFundedSchnorrAccounts(wallet,
|
|
568
|
+
const accountManagers = await deployFundedSchnorrAccounts(wallet, accountsData);
|
|
633
569
|
accounts = accountManagers.map(accountManager => accountManager.address);
|
|
634
570
|
} else if (needsEmptyBlock) {
|
|
635
571
|
logger.info('No accounts are being deployed, waiting for an empty block 1 to be mined');
|
|
@@ -672,7 +608,7 @@ export async function setup(
|
|
|
672
608
|
logger.error(`Error during e2e test teardown`, err);
|
|
673
609
|
} finally {
|
|
674
610
|
try {
|
|
675
|
-
await telemetryClient
|
|
611
|
+
await telemetryClient.stop();
|
|
676
612
|
} catch (err) {
|
|
677
613
|
logger.error(`Error during telemetry client stop`, err);
|
|
678
614
|
}
|
|
@@ -695,6 +631,8 @@ export async function setup(
|
|
|
695
631
|
mockGossipSubNetwork,
|
|
696
632
|
prefilledPublicData,
|
|
697
633
|
proverNode,
|
|
634
|
+
sequencerDelayer,
|
|
635
|
+
proverDelayer,
|
|
698
636
|
sequencer: sequencerClient,
|
|
699
637
|
teardown,
|
|
700
638
|
telemetryClient,
|
|
@@ -778,93 +716,55 @@ export async function waitForProvenChain(node: AztecNode, targetBlock?: BlockNum
|
|
|
778
716
|
);
|
|
779
717
|
}
|
|
780
718
|
|
|
719
|
+
/**
|
|
720
|
+
* Creates an AztecNodeService with the prover node enabled as a subsystem.
|
|
721
|
+
* Returns both the aztec node service (for lifecycle management) and the prover node (for test internals access).
|
|
722
|
+
*/
|
|
781
723
|
export function createAndSyncProverNode(
|
|
782
724
|
proverNodePrivateKey: `0x${string}`,
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
const proverConfig: ProverNodeConfig = {
|
|
806
|
-
...aztecNodeConfig,
|
|
807
|
-
txCollectionNodeRpcUrls: [],
|
|
808
|
-
realProofs: false,
|
|
809
|
-
proverAgentCount: 2,
|
|
810
|
-
publisherPrivateKeys: [new SecretValue(proverNodePrivateKey)],
|
|
811
|
-
proverNodeMaxPendingJobs: 10,
|
|
812
|
-
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
813
|
-
proverNodePollingIntervalMs: 200,
|
|
814
|
-
txGatheringIntervalMs: 1000,
|
|
815
|
-
txGatheringBatchSize: 10,
|
|
816
|
-
txGatheringMaxParallelRequestsPerNode: 10,
|
|
817
|
-
txGatheringTimeoutMs: 24_000,
|
|
818
|
-
proverNodeFailedEpochStore: undefined,
|
|
819
|
-
proverId: EthAddress.fromNumber(1),
|
|
820
|
-
proverNodeEpochProvingDelayMs: undefined,
|
|
821
|
-
...proverNodeConfig,
|
|
822
|
-
};
|
|
823
|
-
|
|
824
|
-
const l1TxUtils = createDelayedL1TxUtils(
|
|
825
|
-
aztecNodeConfig,
|
|
826
|
-
proverNodePrivateKey,
|
|
827
|
-
'prover-node',
|
|
828
|
-
proverNodeDeps.dateProvider,
|
|
725
|
+
baseConfig: AztecNodeConfig,
|
|
726
|
+
configOverrides: Pick<AztecNodeConfig, 'dataDirectory'>,
|
|
727
|
+
deps: {
|
|
728
|
+
telemetry?: TelemetryClient;
|
|
729
|
+
dateProvider: DateProvider;
|
|
730
|
+
p2pClientDeps?: P2PClientDeps;
|
|
731
|
+
},
|
|
732
|
+
options: { prefilledPublicData: PublicDataTreeLeaf[]; dontStart?: boolean },
|
|
733
|
+
): Promise<{ proverNode: AztecNodeService }> {
|
|
734
|
+
return withLoggerBindings({ actor: 'prover-0' }, async () => {
|
|
735
|
+
const proverNode = await AztecNodeService.createAndSync(
|
|
736
|
+
{
|
|
737
|
+
...baseConfig,
|
|
738
|
+
...configOverrides,
|
|
739
|
+
p2pPort: 0,
|
|
740
|
+
enableProverNode: true,
|
|
741
|
+
disableValidator: true,
|
|
742
|
+
proverPublisherPrivateKeys: [new SecretValue(proverNodePrivateKey)],
|
|
743
|
+
},
|
|
744
|
+
deps,
|
|
745
|
+
{ ...options, dontStartProverNode: options.dontStart },
|
|
829
746
|
);
|
|
830
747
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
{ ...proverNodeDeps, aztecNodeTxProvider, archiver: archiver as Archiver, l1TxUtils },
|
|
834
|
-
{ prefilledPublicData },
|
|
835
|
-
);
|
|
836
|
-
getLogger().info(`Created and synced prover node`, { publisherAddress: l1TxUtils.client.account!.address });
|
|
837
|
-
if (!proverNodeConfig.dontStart) {
|
|
838
|
-
await proverNode.start();
|
|
748
|
+
if (!proverNode.getProverNode()) {
|
|
749
|
+
throw new Error('Prover node subsystem was not created despite enableProverNode being set');
|
|
839
750
|
}
|
|
840
|
-
return proverNode;
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
function createDelayedL1TxUtils(
|
|
845
|
-
aztecNodeConfig: AztecNodeConfig,
|
|
846
|
-
privateKey: `0x${string}`,
|
|
847
|
-
logName: string,
|
|
848
|
-
dateProvider?: DateProvider,
|
|
849
|
-
) {
|
|
850
|
-
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
|
|
851
751
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
return l1TxUtils;
|
|
752
|
+
getLogger().info(`Created and synced prover node`);
|
|
753
|
+
return { proverNode };
|
|
754
|
+
});
|
|
856
755
|
}
|
|
857
756
|
|
|
858
757
|
export type BalancesFn = ReturnType<typeof getBalancesFn>;
|
|
859
758
|
export function getBalancesFn(
|
|
860
759
|
symbol: string,
|
|
861
760
|
method: ContractMethod,
|
|
862
|
-
from: AztecAddress,
|
|
863
761
|
logger: any,
|
|
864
762
|
): (...addresses: (AztecAddress | { address: AztecAddress })[]) => Promise<bigint[]> {
|
|
865
763
|
const balances = async (...addressLikes: (AztecAddress | { address: AztecAddress })[]) => {
|
|
866
764
|
const addresses = addressLikes.map(addressLike => ('address' in addressLike ? addressLike.address : addressLike));
|
|
867
|
-
const b = await Promise.all(
|
|
765
|
+
const b = await Promise.all(
|
|
766
|
+
addresses.map(async address => (await method(address).simulate({ from: address })).result),
|
|
767
|
+
);
|
|
868
768
|
const debugString = `${symbol} balances: ${addresses.map((address, i) => `${address}: ${b[i]}`).join(', ')}`;
|
|
869
769
|
logger.verbose(debugString);
|
|
870
770
|
return b;
|
|
@@ -921,13 +821,11 @@ export async function ensureAccountContractsPublished(wallet: Wallet, accountsTo
|
|
|
921
821
|
).map(contractMetadata => contractMetadata.instance);
|
|
922
822
|
const contractClass = await getContractClassFromArtifact(SchnorrAccountContractArtifact);
|
|
923
823
|
if (!(await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
|
|
924
|
-
await (await publishContractClass(wallet, SchnorrAccountContractArtifact))
|
|
925
|
-
.send({ from: accountsToDeploy[0] })
|
|
926
|
-
.wait();
|
|
824
|
+
await (await publishContractClass(wallet, SchnorrAccountContractArtifact)).send({ from: accountsToDeploy[0] });
|
|
927
825
|
}
|
|
928
826
|
const requests = instances.map(instance => publishInstance(wallet, instance!));
|
|
929
827
|
const batch = new BatchCall(wallet, requests);
|
|
930
|
-
await batch.send({ from: accountsToDeploy[0] })
|
|
828
|
+
await batch.send({ from: accountsToDeploy[0] });
|
|
931
829
|
}
|
|
932
830
|
|
|
933
831
|
/**
|
|
@@ -951,12 +849,10 @@ export const deployAccounts =
|
|
|
951
849
|
deployedAccounts[i].signingKey,
|
|
952
850
|
);
|
|
953
851
|
const deployMethod = await accountManager.getDeployMethod();
|
|
954
|
-
await deployMethod
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
})
|
|
959
|
-
.wait();
|
|
852
|
+
await deployMethod.send({
|
|
853
|
+
from: NO_FROM,
|
|
854
|
+
skipClassPublication: i !== 0, // Publish the contract class at most once.
|
|
855
|
+
});
|
|
960
856
|
}
|
|
961
857
|
|
|
962
858
|
return { deployedAccounts };
|
|
@@ -986,7 +882,7 @@ export async function publicDeployAccounts(
|
|
|
986
882
|
|
|
987
883
|
const batch = new BatchCall(wallet, calls);
|
|
988
884
|
|
|
989
|
-
const txReceipt = await batch.send({ from: accountsToDeploy[0] })
|
|
885
|
+
const { receipt: txReceipt } = await batch.send({ from: accountsToDeploy[0] });
|
|
990
886
|
if (waitUntilProven) {
|
|
991
887
|
if (!node) {
|
|
992
888
|
throw new Error('Need to provide an AztecNode to wait for proven.');
|