@aztec/end-to-end 0.0.1-commit.6d63667d → 0.0.1-commit.7ac86ea28
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 +3 -3
- 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/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 +10 -0
- 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_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 +9 -7
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +58 -33
- 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 +5 -5
- package/dest/e2e_p2p/p2p_network.d.ts +2 -2
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +16 -2
- package/dest/e2e_p2p/reqresp/utils.d.ts +3 -3
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
- package/dest/e2e_p2p/reqresp/utils.js +32 -8
- package/dest/e2e_p2p/shared.d.ts +2 -2
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +5 -1
- 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 +10 -0
- 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 +4 -4
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +27 -34
- 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/ha_setup.d.ts +1 -1
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +3 -1
- package/dest/fixtures/setup.d.ts +39 -22
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +59 -149
- package/dest/fixtures/setup_p2p_test.d.ts +15 -7
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +18 -12
- 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 +3 -2
- 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/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 +2 -2
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- 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 -1
- 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 +2 -23
- package/dest/spartan/setup_test_wallets.d.ts +9 -2
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +31 -1
- package/dest/spartan/utils/bot.d.ts +3 -2
- package/dest/spartan/utils/bot.d.ts.map +1 -1
- package/dest/spartan/utils/bot.js +2 -1
- package/dest/spartan/utils/index.d.ts +2 -2
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +1 -1
- package/dest/spartan/utils/k8s.d.ts +3 -1
- package/dest/spartan/utils/k8s.d.ts.map +1 -1
- package/dest/spartan/utils/k8s.js +6 -0
- package/dest/test-wallet/test_wallet.d.ts +83 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +214 -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 +40 -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 +103 -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 +40 -39
- package/src/bench/client_flows/client_flows_benchmark.ts +8 -12
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/utils.ts +1 -1
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +11 -2
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +4 -4
- package/src/e2e_deploy_contract/deploy_test.ts +3 -3
- package/src/e2e_epochs/epochs_test.ts +73 -63
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +11 -26
- package/src/e2e_nested_contract/nested_contract_test.ts +1 -1
- package/src/e2e_p2p/inactivity_slash_test.ts +4 -4
- package/src/e2e_p2p/p2p_network.ts +29 -7
- package/src/e2e_p2p/reqresp/utils.ts +40 -12
- package/src/e2e_p2p/shared.ts +3 -1
- 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 +11 -2
- 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 +28 -38
- package/src/fixtures/fixtures.ts +10 -0
- package/src/fixtures/ha_setup.ts +3 -1
- package/src/fixtures/setup.ts +89 -210
- package/src/fixtures/setup_p2p_test.ts +25 -24
- package/src/fixtures/token_utils.ts +2 -1
- package/src/guides/up_quick_start.sh +3 -3
- package/src/shared/index.ts +1 -0
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +6 -2
- package/src/shared/uniswap_l1_l2.ts +2 -2
- package/src/simulators/token_simulator.ts +1 -29
- package/src/spartan/setup_test_wallets.ts +58 -4
- package/src/spartan/utils/bot.ts +4 -1
- package/src/spartan/utils/index.ts +1 -0
- package/src/spartan/utils/k8s.ts +8 -0
- package/src/test-wallet/test_wallet.ts +306 -0
- package/src/test-wallet/utils.ts +112 -0
- package/src/test-wallet/wallet_worker_script.ts +43 -0
- package/src/test-wallet/worker_wallet.ts +165 -0
- package/src/test-wallet/worker_wallet_schema.ts +13 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
|
-
import {
|
|
2
|
+
import { AztecNodeService } from '@aztec/aztec-node';
|
|
3
3
|
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
4
4
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
5
5
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
@@ -11,22 +11,20 @@ import {
|
|
|
11
11
|
TestCircuitVerifier,
|
|
12
12
|
} from '@aztec/bb-prover';
|
|
13
13
|
import { BackendType, Barretenberg } from '@aztec/bb.js';
|
|
14
|
-
import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
15
14
|
import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
16
15
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
17
16
|
import { SecretValue } from '@aztec/foundation/config';
|
|
18
17
|
import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
19
18
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
20
|
-
import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
|
|
21
19
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
22
20
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
23
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
24
21
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
25
22
|
|
|
26
23
|
import { type Hex, getContract } from 'viem';
|
|
27
24
|
import { privateKeyToAddress } from 'viem/accounts';
|
|
28
25
|
|
|
29
26
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
27
|
+
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
30
28
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
31
29
|
import { getBBConfig } from './get_bb_config.js';
|
|
32
30
|
import {
|
|
@@ -73,8 +71,8 @@ export class FullProverTest {
|
|
|
73
71
|
circuitProofVerifier?: ClientProtocolCircuitVerifier;
|
|
74
72
|
provenAsset!: TokenContract;
|
|
75
73
|
context!: EndToEndContext;
|
|
76
|
-
private
|
|
77
|
-
private
|
|
74
|
+
private proverAztecNode!: AztecNodeService;
|
|
75
|
+
private simulatedProverAztecNode!: AztecNodeService;
|
|
78
76
|
public l1Contracts!: DeployAztecL1ContractsReturnType;
|
|
79
77
|
public proverAddress!: EthAddress;
|
|
80
78
|
private minNumberOfTxsPerBlock: number;
|
|
@@ -144,18 +142,17 @@ export class FullProverTest {
|
|
|
144
142
|
this.logger.info(`Enabling proving`, { realProofs: this.realProofs });
|
|
145
143
|
|
|
146
144
|
// We don't wish to mark as proven automatically, so we set the flag to false
|
|
147
|
-
this.context.watcher
|
|
145
|
+
this.context.watcher.setIsMarkingAsProven(false);
|
|
148
146
|
|
|
149
|
-
this.
|
|
147
|
+
this.simulatedProverAztecNode = this.context.proverNode!;
|
|
150
148
|
({
|
|
151
149
|
aztecNode: this.aztecNode,
|
|
152
150
|
deployL1ContractsValues: this.l1Contracts,
|
|
153
151
|
cheatCodes: this.cheatCodes,
|
|
154
152
|
} = this.context);
|
|
155
|
-
this.aztecNodeAdmin = this.context.aztecNodeService
|
|
153
|
+
this.aztecNodeAdmin = this.context.aztecNodeService;
|
|
156
154
|
|
|
157
155
|
const config = this.context.aztecNodeConfig;
|
|
158
|
-
const blobClient = await createBlobClientWithFileStores(config, this.logger);
|
|
159
156
|
|
|
160
157
|
// Configure a full prover PXE
|
|
161
158
|
let acvmConfig: Awaited<ReturnType<typeof getACVMConfig>> | undefined;
|
|
@@ -217,20 +214,13 @@ export class FullProverTest {
|
|
|
217
214
|
this.provenWallet = provenWallet;
|
|
218
215
|
this.logger.info(`Full prover PXE started`);
|
|
219
216
|
|
|
220
|
-
// Shutdown the current, simulated prover node
|
|
217
|
+
// Shutdown the current, simulated prover node (by stopping its hosting aztec node)
|
|
221
218
|
this.logger.verbose('Shutting down simulated prover node');
|
|
222
|
-
await this.
|
|
223
|
-
|
|
224
|
-
// Creating temp store and archiver for fully proven prover node
|
|
225
|
-
this.logger.verbose('Starting archiver for new prover node');
|
|
226
|
-
const archiver = await createArchiver(
|
|
227
|
-
{ ...this.context.aztecNodeConfig, dataDirectory: undefined },
|
|
228
|
-
{ blobClient, dateProvider: this.context.dateProvider! },
|
|
229
|
-
{ blockUntilSync: true },
|
|
230
|
-
);
|
|
219
|
+
await this.simulatedProverAztecNode.stop();
|
|
231
220
|
|
|
232
221
|
// The simulated prover node (now shutdown) used private key index 2
|
|
233
222
|
const proverNodePrivateKey = getPrivateKeyFromIndex(2);
|
|
223
|
+
const proverNodePrivateKeyHex = `0x${proverNodePrivateKey!.toString('hex')}` as const;
|
|
234
224
|
const proverNodeSenderAddress = privateKeyToAddress(new Buffer32(proverNodePrivateKey!).toString());
|
|
235
225
|
this.proverAddress = EthAddress.fromString(proverNodeSenderAddress);
|
|
236
226
|
|
|
@@ -238,14 +228,21 @@ export class FullProverTest {
|
|
|
238
228
|
await this.mintFeeJuice(proverNodeSenderAddress);
|
|
239
229
|
|
|
240
230
|
this.logger.verbose('Starting prover node');
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
231
|
+
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
232
|
+
const { prefilledPublicData } = await getGenesisValues(
|
|
233
|
+
this.context.initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
const proverNodeConfig: Parameters<typeof AztecNodeService.createAndSync>[0] = {
|
|
237
|
+
...config,
|
|
238
|
+
enableProverNode: true,
|
|
239
|
+
disableValidator: true,
|
|
244
240
|
dataDirectory: undefined,
|
|
241
|
+
txCollectionNodeRpcUrls: [],
|
|
245
242
|
proverId: this.proverAddress,
|
|
246
243
|
realProofs: this.realProofs,
|
|
247
244
|
proverAgentCount: 2,
|
|
248
|
-
|
|
245
|
+
proverPublisherPrivateKeys: [new SecretValue(proverNodePrivateKeyHex)],
|
|
249
246
|
proverNodeMaxPendingJobs: 100,
|
|
250
247
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
251
248
|
proverNodePollingIntervalMs: 100,
|
|
@@ -255,21 +252,14 @@ export class FullProverTest {
|
|
|
255
252
|
txGatheringTimeoutMs: 24_000,
|
|
256
253
|
proverNodeFailedEpochStore: undefined,
|
|
257
254
|
proverNodeEpochProvingDelayMs: undefined,
|
|
255
|
+
validatorPrivateKeys: new SecretValue([]),
|
|
258
256
|
};
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
this.proverNode = await createProverNode(
|
|
264
|
-
proverConfig,
|
|
265
|
-
{
|
|
266
|
-
aztecNodeTxProvider: this.aztecNode,
|
|
267
|
-
archiver: archiver as Archiver,
|
|
268
|
-
},
|
|
257
|
+
|
|
258
|
+
this.proverAztecNode = await AztecNodeService.createAndSync(
|
|
259
|
+
proverNodeConfig,
|
|
260
|
+
{ dateProvider: this.context.dateProvider, p2pClientDeps: { rpcTxProviders: [this.aztecNode] } },
|
|
269
261
|
{ prefilledPublicData },
|
|
270
262
|
);
|
|
271
|
-
await this.proverNode.start();
|
|
272
|
-
|
|
273
263
|
this.logger.warn(`Proofs are now enabled`, { realProofs: this.realProofs });
|
|
274
264
|
return this;
|
|
275
265
|
}
|
|
@@ -289,8 +279,8 @@ export class FullProverTest {
|
|
|
289
279
|
await this.provenComponents[i].teardown();
|
|
290
280
|
}
|
|
291
281
|
|
|
292
|
-
// clean up the full prover node
|
|
293
|
-
await this.
|
|
282
|
+
// clean up the full prover node (by stopping its hosting aztec node)
|
|
283
|
+
await this.proverAztecNode.stop();
|
|
294
284
|
|
|
295
285
|
await Barretenberg.destroySingleton();
|
|
296
286
|
await this.bbConfigCleanup?.();
|
package/src/fixtures/fixtures.ts
CHANGED
|
@@ -7,6 +7,16 @@ export const shouldCollectMetrics = () => {
|
|
|
7
7
|
return undefined;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
+
/** Returns the boot node UDP port from environment variable or default value. */
|
|
11
|
+
export function getBootNodeUdpPort(): number {
|
|
12
|
+
return process.env.BOOT_NODE_UDP_PORT ? parseInt(process.env.BOOT_NODE_UDP_PORT, 10) : 4500;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Returns the anvil port from environment variable or default value. */
|
|
16
|
+
export function getAnvilPort(): number {
|
|
17
|
+
return process.env.ANVIL_PORT ? parseInt(process.env.ANVIL_PORT, 10) : 8545;
|
|
18
|
+
}
|
|
19
|
+
|
|
10
20
|
export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
|
|
11
21
|
export const TEST_MAX_PENDING_TX_POOL_COUNT = 10_000; // Number of max pending TXs ~ 1.56GB
|
|
12
22
|
|
package/src/fixtures/ha_setup.ts
CHANGED
|
@@ -69,8 +69,10 @@ export async function cleanupHADatabase(pool: Pool, logger?: Logger): Promise<vo
|
|
|
69
69
|
try {
|
|
70
70
|
// Drop all HA tables
|
|
71
71
|
await pool.query('DROP TABLE IF EXISTS validator_duties CASCADE');
|
|
72
|
-
await pool.query('DROP TABLE IF EXISTS slashing_protection CASCADE');
|
|
73
72
|
await pool.query('DROP TABLE IF EXISTS schema_version CASCADE');
|
|
73
|
+
// Drop migration tracking table (node-pg-migrate uses 'pgmigrations' by default)
|
|
74
|
+
// This ensures migrations will run fresh on next startup
|
|
75
|
+
await pool.query('DROP TABLE IF EXISTS pgmigrations CASCADE');
|
|
74
76
|
|
|
75
77
|
logger?.info('HA database cleaned up successfully');
|
|
76
78
|
} catch (error) {
|
package/src/fixtures/setup.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
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';
|
|
5
4
|
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
6
5
|
import {
|
|
@@ -13,10 +12,9 @@ import {
|
|
|
13
12
|
import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
|
|
14
13
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
15
14
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
16
|
-
import {
|
|
15
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
17
16
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
18
17
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
19
|
-
import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
20
18
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
21
19
|
import { isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
22
20
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
@@ -30,13 +28,8 @@ import {
|
|
|
30
28
|
type ZKPassportArgs,
|
|
31
29
|
deployAztecL1Contracts,
|
|
32
30
|
} from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
EthCheatCodes,
|
|
36
|
-
EthCheatCodesWithState,
|
|
37
|
-
createDelayedL1TxUtilsFromViemWallet,
|
|
38
|
-
startAnvil,
|
|
39
|
-
} from '@aztec/ethereum/test';
|
|
31
|
+
import type { Delayer } from '@aztec/ethereum/l1-tx-utils';
|
|
32
|
+
import { EthCheatCodes, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
40
33
|
import { BlockNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
41
34
|
import { SecretValue } from '@aztec/foundation/config';
|
|
42
35
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
@@ -45,16 +38,14 @@ import { withLoggerBindings } from '@aztec/foundation/log/server';
|
|
|
45
38
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
46
39
|
import { sleep } from '@aztec/foundation/sleep';
|
|
47
40
|
import { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
|
|
48
|
-
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
49
41
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
50
42
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
51
43
|
import type { P2PClientDeps } from '@aztec/p2p';
|
|
52
44
|
import { MockGossipSubNetwork, getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
53
45
|
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
54
|
-
import
|
|
46
|
+
import type { ProverNodeConfig } from '@aztec/prover-node';
|
|
55
47
|
import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
56
48
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
57
|
-
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
58
49
|
import { type ContractInstanceWithAddress, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
59
50
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
60
51
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
@@ -67,7 +58,7 @@ import {
|
|
|
67
58
|
initTelemetryClient,
|
|
68
59
|
} from '@aztec/telemetry-client';
|
|
69
60
|
import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
70
|
-
import {
|
|
61
|
+
import { deployFundedSchnorrAccounts } from '@aztec/wallets/testing';
|
|
71
62
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
72
63
|
|
|
73
64
|
import type { Anvil } from '@viem/anvil';
|
|
@@ -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) {
|
|
@@ -217,13 +206,13 @@ export type EndToEndContext = {
|
|
|
217
206
|
anvil: Anvil | undefined;
|
|
218
207
|
/** The Aztec Node service or client a connected to it. */
|
|
219
208
|
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
|
|
209
|
+
/** The Aztec Node as a service. */
|
|
210
|
+
aztecNodeService: AztecNodeService;
|
|
211
|
+
/** Client to the Aztec Node admin interface. */
|
|
212
|
+
aztecNodeAdmin: AztecNodeAdmin;
|
|
213
|
+
/** The aztec node running the prover node subsystem (only set if startProverNode is true). */
|
|
214
|
+
proverNode: AztecNodeService | undefined;
|
|
215
|
+
/** A client to the sequencer service. */
|
|
227
216
|
sequencer: SequencerClient | undefined;
|
|
228
217
|
/** Return values from deployAztecL1Contracts function. */
|
|
229
218
|
deployL1ContractsValues: DeployAztecL1ContractsReturnType;
|
|
@@ -243,14 +232,18 @@ export type EndToEndContext = {
|
|
|
243
232
|
cheatCodes: CheatCodes;
|
|
244
233
|
/** The cheat codes for L1 */
|
|
245
234
|
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
|
|
235
|
+
/** The anvil test watcher. */
|
|
236
|
+
watcher: AnvilTestWatcher;
|
|
237
|
+
/** Allows tweaking current system time, used by the epoch cache only. */
|
|
238
|
+
dateProvider: TestDateProvider;
|
|
250
239
|
/** Telemetry client */
|
|
251
|
-
telemetryClient: TelemetryClient
|
|
240
|
+
telemetryClient: TelemetryClient;
|
|
252
241
|
/** Mock gossip sub network used for gossipping messages (only if mockGossipSubNetwork was set to true in opts) */
|
|
253
242
|
mockGossipSubNetwork: MockGossipSubNetwork | undefined;
|
|
243
|
+
/** Delayer for sequencer L1 txs (only when enableDelayer is true). */
|
|
244
|
+
sequencerDelayer: Delayer | undefined;
|
|
245
|
+
/** Delayer for prover node L1 txs (only when enableDelayer and startProverNode are true). */
|
|
246
|
+
proverDelayer: Delayer | undefined;
|
|
254
247
|
/** Prefilled public data used for setting up nodes. */
|
|
255
248
|
prefilledPublicData: PublicDataTreeLeaf[] | undefined;
|
|
256
249
|
/** ACVM config (only set if running locally). */
|
|
@@ -258,87 +251,11 @@ export type EndToEndContext = {
|
|
|
258
251
|
/** BB config (only set if running locally). */
|
|
259
252
|
bbConfig: Awaited<ReturnType<typeof getBBConfig>>;
|
|
260
253
|
/** Directory to cleanup on teardown. */
|
|
261
|
-
directoryToCleanup: string
|
|
254
|
+
directoryToCleanup: string;
|
|
262
255
|
/** Function to stop the started services. */
|
|
263
256
|
teardown: () => Promise<void>;
|
|
264
257
|
};
|
|
265
258
|
|
|
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 & SetupOptions,
|
|
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
|
-
|
|
293
|
-
if (config.walletMinFeePadding !== undefined) {
|
|
294
|
-
wallet.setMinFeePadding(config.walletMinFeePadding);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, aztecNode, new DateProvider());
|
|
298
|
-
const teardown = () => Promise.resolve();
|
|
299
|
-
|
|
300
|
-
logger.verbose('Populating wallet from already registered accounts...');
|
|
301
|
-
const initialFundedAccounts = await getInitialTestAccountsData();
|
|
302
|
-
|
|
303
|
-
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
304
|
-
throw new Error(`Required ${numberOfAccounts} accounts. Found ${initialFundedAccounts.length}.`);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
const testAccounts = await Promise.all(
|
|
308
|
-
initialFundedAccounts.slice(0, numberOfAccounts).map(async account => {
|
|
309
|
-
const accountManager = await wallet.createSchnorrAccount(account.secret, account.salt, account.signingKey);
|
|
310
|
-
return accountManager.address;
|
|
311
|
-
}),
|
|
312
|
-
);
|
|
313
|
-
|
|
314
|
-
return {
|
|
315
|
-
anvil: undefined,
|
|
316
|
-
aztecNode,
|
|
317
|
-
aztecNodeService: undefined,
|
|
318
|
-
aztecNodeAdmin: undefined,
|
|
319
|
-
sequencer: undefined,
|
|
320
|
-
proverNode: undefined,
|
|
321
|
-
deployL1ContractsValues,
|
|
322
|
-
config,
|
|
323
|
-
aztecNodeConfig: config,
|
|
324
|
-
initialFundedAccounts,
|
|
325
|
-
wallet,
|
|
326
|
-
accounts: testAccounts,
|
|
327
|
-
logger,
|
|
328
|
-
cheatCodes,
|
|
329
|
-
ethCheatCodes,
|
|
330
|
-
prefilledPublicData: undefined,
|
|
331
|
-
mockGossipSubNetwork: undefined,
|
|
332
|
-
watcher: undefined,
|
|
333
|
-
dateProvider: undefined,
|
|
334
|
-
telemetryClient: undefined,
|
|
335
|
-
acvmConfig: undefined,
|
|
336
|
-
bbConfig: undefined,
|
|
337
|
-
directoryToCleanup: undefined,
|
|
338
|
-
teardown,
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
|
|
342
259
|
/**
|
|
343
260
|
* Sets up the environment for the end-to-end tests.
|
|
344
261
|
* @param numberOfAccounts - The number of new accounts to be created once the PXE is initiated.
|
|
@@ -366,8 +283,12 @@ export async function setup(
|
|
|
366
283
|
config.realProofs = !!opts.realProofs;
|
|
367
284
|
// Only enforce the time table if requested
|
|
368
285
|
config.enforceTimeTable = !!opts.enforceTimeTable;
|
|
286
|
+
// Enable the tx delayer for tests (default config has it disabled, so we force-enable it here)
|
|
287
|
+
config.enableDelayer = true;
|
|
369
288
|
config.listenAddress = '127.0.0.1';
|
|
370
289
|
|
|
290
|
+
config.minTxPoolAgeMs = opts.minTxPoolAgeMs ?? 0;
|
|
291
|
+
|
|
371
292
|
const logger = getLogger();
|
|
372
293
|
|
|
373
294
|
// Create a temp directory for any services that need it and cleanup later
|
|
@@ -381,12 +302,6 @@ export async function setup(
|
|
|
381
302
|
if (!isAnvilTestChain(chain.id)) {
|
|
382
303
|
throw new Error(`No ETHEREUM_HOSTS set but non anvil chain requested`);
|
|
383
304
|
}
|
|
384
|
-
if (AZTEC_NODE_URL) {
|
|
385
|
-
throw new Error(
|
|
386
|
-
`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`,
|
|
387
|
-
);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
305
|
const res = await startAnvil({
|
|
391
306
|
l1BlockTime: opts.ethereumSlotDuration,
|
|
392
307
|
accounts: opts.anvilAccounts,
|
|
@@ -421,11 +336,11 @@ export async function setup(
|
|
|
421
336
|
publisherPrivKeyHex = opts.l1PublisherKey.getValue();
|
|
422
337
|
publisherHdAccount = privateKeyToAccount(publisherPrivKeyHex);
|
|
423
338
|
} else if (
|
|
424
|
-
config.
|
|
425
|
-
config.
|
|
426
|
-
config.
|
|
339
|
+
config.sequencerPublisherPrivateKeys &&
|
|
340
|
+
config.sequencerPublisherPrivateKeys.length > 0 &&
|
|
341
|
+
config.sequencerPublisherPrivateKeys[0].getValue() != NULL_KEY
|
|
427
342
|
) {
|
|
428
|
-
publisherPrivKeyHex = config.
|
|
343
|
+
publisherPrivKeyHex = config.sequencerPublisherPrivateKeys[0].getValue();
|
|
429
344
|
publisherHdAccount = privateKeyToAccount(publisherPrivKeyHex);
|
|
430
345
|
} else if (!MNEMONIC) {
|
|
431
346
|
throw new Error(`Mnemonic not provided and no publisher private key`);
|
|
@@ -434,18 +349,13 @@ export async function setup(
|
|
|
434
349
|
const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
|
|
435
350
|
const publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
436
351
|
publisherPrivKeyHex = `0x${publisherPrivKey!.toString('hex')}` as const;
|
|
437
|
-
config.
|
|
352
|
+
config.sequencerPublisherPrivateKeys = [new SecretValue(publisherPrivKeyHex)];
|
|
438
353
|
}
|
|
439
354
|
|
|
440
355
|
if (config.coinbase === undefined) {
|
|
441
356
|
config.coinbase = EthAddress.fromString(publisherHdAccount.address);
|
|
442
357
|
}
|
|
443
358
|
|
|
444
|
-
if (AZTEC_NODE_URL) {
|
|
445
|
-
// we are setting up against a remote environment, l1 contracts are assumed to already be deployed
|
|
446
|
-
return await setupWithRemoteEnvironment(publisherHdAccount!, config, logger, numberOfAccounts);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
359
|
// Determine which addresses to fund in genesis
|
|
450
360
|
const initialFundedAccounts =
|
|
451
361
|
opts.initialFundedAccounts ??
|
|
@@ -502,9 +412,14 @@ export async function setup(
|
|
|
502
412
|
if (enableAutomine) {
|
|
503
413
|
await ethCheatCodes.setAutomine(false);
|
|
504
414
|
await ethCheatCodes.setIntervalMining(config.ethereumSlotDuration);
|
|
505
|
-
dateProvider.setTime((await ethCheatCodes.timestamp()) * 1000);
|
|
506
415
|
}
|
|
507
416
|
|
|
417
|
+
// Always sync dateProvider to L1 time after deploying L1 contracts, regardless of mining mode.
|
|
418
|
+
// In compose mode, L1 time may have drifted ahead of system time due to the local-network watcher
|
|
419
|
+
// warping time forward on each filled slot. Without this sync, the sequencer computes the wrong
|
|
420
|
+
// slot from its dateProvider and cannot propose blocks.
|
|
421
|
+
dateProvider.setTime((await ethCheatCodes.timestamp()) * 1000);
|
|
422
|
+
|
|
508
423
|
if (opts.l2StartTime) {
|
|
509
424
|
await ethCheatCodes.warp(opts.l2StartTime, { resetBlockInterval: true });
|
|
510
425
|
}
|
|
@@ -581,31 +496,33 @@ export async function setup(
|
|
|
581
496
|
);
|
|
582
497
|
const sequencerClient = aztecNodeService.getSequencer();
|
|
583
498
|
|
|
584
|
-
|
|
585
|
-
const publisher = (sequencerClient as TestSequencerClient).sequencer.publisher;
|
|
586
|
-
publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration, l1Client);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
let proverNode: ProverNode | undefined = undefined;
|
|
499
|
+
let proverNode: AztecNodeService | undefined = undefined;
|
|
590
500
|
if (opts.startProverNode) {
|
|
591
501
|
logger.verbose('Creating and syncing a simulated prover node...');
|
|
592
502
|
const proverNodePrivateKey = getPrivateKeyFromIndex(2);
|
|
593
503
|
const proverNodePrivateKeyHex: Hex = `0x${proverNodePrivateKey!.toString('hex')}`;
|
|
594
504
|
const proverNodeDataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
505
|
+
|
|
506
|
+
const p2pClientDeps: Partial<P2PClientDeps<P2PClientType.Full>> = {
|
|
507
|
+
p2pServiceFactory: mockGossipSubNetwork && getMockPubSubP2PServiceFactory(mockGossipSubNetwork!),
|
|
508
|
+
rpcTxProviders: [aztecNodeService],
|
|
599
509
|
};
|
|
600
|
-
|
|
510
|
+
|
|
511
|
+
({ proverNode } = await createAndSyncProverNode(
|
|
601
512
|
proverNodePrivateKeyHex,
|
|
602
513
|
config,
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
514
|
+
{
|
|
515
|
+
...config.proverNodeConfig,
|
|
516
|
+
dataDirectory: proverNodeDataDirectory,
|
|
517
|
+
},
|
|
518
|
+
{ dateProvider, p2pClientDeps, telemetry: telemetryClient },
|
|
519
|
+
{ prefilledPublicData },
|
|
520
|
+
));
|
|
607
521
|
}
|
|
608
522
|
|
|
523
|
+
const sequencerDelayer = sequencerClient?.getDelayer();
|
|
524
|
+
const proverDelayer = proverNode?.getProverNode()?.getDelayer();
|
|
525
|
+
|
|
609
526
|
logger.verbose('Creating a pxe...');
|
|
610
527
|
const pxeConfig = { ...getPXEConfig(), ...pxeOpts };
|
|
611
528
|
pxeConfig.dataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
@@ -683,7 +600,7 @@ export async function setup(
|
|
|
683
600
|
logger.error(`Error during e2e test teardown`, err);
|
|
684
601
|
} finally {
|
|
685
602
|
try {
|
|
686
|
-
await telemetryClient
|
|
603
|
+
await telemetryClient.stop();
|
|
687
604
|
} catch (err) {
|
|
688
605
|
logger.error(`Error during telemetry client stop`, err);
|
|
689
606
|
}
|
|
@@ -706,6 +623,8 @@ export async function setup(
|
|
|
706
623
|
mockGossipSubNetwork,
|
|
707
624
|
prefilledPublicData,
|
|
708
625
|
proverNode,
|
|
626
|
+
sequencerDelayer,
|
|
627
|
+
proverDelayer,
|
|
709
628
|
sequencer: sequencerClient,
|
|
710
629
|
teardown,
|
|
711
630
|
telemetryClient,
|
|
@@ -789,93 +708,53 @@ export async function waitForProvenChain(node: AztecNode, targetBlock?: BlockNum
|
|
|
789
708
|
);
|
|
790
709
|
}
|
|
791
710
|
|
|
711
|
+
/**
|
|
712
|
+
* Creates an AztecNodeService with the prover node enabled as a subsystem.
|
|
713
|
+
* Returns both the aztec node service (for lifecycle management) and the prover node (for test internals access).
|
|
714
|
+
*/
|
|
792
715
|
export function createAndSyncProverNode(
|
|
793
716
|
proverNodePrivateKey: `0x${string}`,
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
717
|
+
baseConfig: AztecNodeConfig,
|
|
718
|
+
configOverrides: Pick<AztecNodeConfig, 'dataDirectory'>,
|
|
719
|
+
deps: {
|
|
720
|
+
telemetry?: TelemetryClient;
|
|
721
|
+
dateProvider: DateProvider;
|
|
722
|
+
p2pClientDeps?: P2PClientDeps<P2PClientType.Full>;
|
|
723
|
+
},
|
|
724
|
+
options: { prefilledPublicData: PublicDataTreeLeaf[]; dontStart?: boolean },
|
|
725
|
+
): Promise<{ proverNode: AztecNodeService }> {
|
|
800
726
|
return withLoggerBindings({ actor: 'prover-0' }, async () => {
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
{ blobClient, dateProvider: proverNodeDeps.dateProvider },
|
|
813
|
-
{ blockUntilSync: true },
|
|
814
|
-
);
|
|
815
|
-
|
|
816
|
-
const proverConfig: ProverNodeConfig = {
|
|
817
|
-
...aztecNodeConfig,
|
|
818
|
-
txCollectionNodeRpcUrls: [],
|
|
819
|
-
realProofs: false,
|
|
820
|
-
proverAgentCount: 2,
|
|
821
|
-
publisherPrivateKeys: [new SecretValue(proverNodePrivateKey)],
|
|
822
|
-
proverNodeMaxPendingJobs: 10,
|
|
823
|
-
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
824
|
-
proverNodePollingIntervalMs: 200,
|
|
825
|
-
txGatheringIntervalMs: 1000,
|
|
826
|
-
txGatheringBatchSize: 10,
|
|
827
|
-
txGatheringMaxParallelRequestsPerNode: 10,
|
|
828
|
-
txGatheringTimeoutMs: 24_000,
|
|
829
|
-
proverNodeFailedEpochStore: undefined,
|
|
830
|
-
proverId: EthAddress.fromNumber(1),
|
|
831
|
-
proverNodeEpochProvingDelayMs: undefined,
|
|
832
|
-
...proverNodeConfig,
|
|
833
|
-
};
|
|
834
|
-
|
|
835
|
-
const l1TxUtils = createDelayedL1TxUtils(
|
|
836
|
-
aztecNodeConfig,
|
|
837
|
-
proverNodePrivateKey,
|
|
838
|
-
'prover-node',
|
|
839
|
-
proverNodeDeps.dateProvider,
|
|
727
|
+
const proverNode = await AztecNodeService.createAndSync(
|
|
728
|
+
{
|
|
729
|
+
...baseConfig,
|
|
730
|
+
...configOverrides,
|
|
731
|
+
p2pPort: 0,
|
|
732
|
+
enableProverNode: true,
|
|
733
|
+
disableValidator: true,
|
|
734
|
+
proverPublisherPrivateKeys: [new SecretValue(proverNodePrivateKey)],
|
|
735
|
+
},
|
|
736
|
+
deps,
|
|
737
|
+
{ ...options, dontStartProverNode: options.dontStart },
|
|
840
738
|
);
|
|
841
739
|
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
{ ...proverNodeDeps, aztecNodeTxProvider, archiver: archiver as Archiver, l1TxUtils },
|
|
845
|
-
{ prefilledPublicData },
|
|
846
|
-
);
|
|
847
|
-
getLogger().info(`Created and synced prover node`, { publisherAddress: l1TxUtils.client.account!.address });
|
|
848
|
-
if (!proverNodeConfig.dontStart) {
|
|
849
|
-
await proverNode.start();
|
|
740
|
+
if (!proverNode.getProverNode()) {
|
|
741
|
+
throw new Error('Prover node subsystem was not created despite enableProverNode being set');
|
|
850
742
|
}
|
|
851
|
-
return proverNode;
|
|
852
|
-
});
|
|
853
|
-
}
|
|
854
743
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
logName: string,
|
|
859
|
-
dateProvider?: DateProvider,
|
|
860
|
-
) {
|
|
861
|
-
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
|
|
862
|
-
|
|
863
|
-
const log = createLogger(logName);
|
|
864
|
-
const l1TxUtils = createDelayedL1TxUtilsFromViemWallet(l1Client, log, dateProvider, aztecNodeConfig);
|
|
865
|
-
l1TxUtils.enableDelayer(aztecNodeConfig.ethereumSlotDuration);
|
|
866
|
-
return l1TxUtils;
|
|
744
|
+
getLogger().info(`Created and synced prover node`);
|
|
745
|
+
return { proverNode };
|
|
746
|
+
});
|
|
867
747
|
}
|
|
868
748
|
|
|
869
749
|
export type BalancesFn = ReturnType<typeof getBalancesFn>;
|
|
870
750
|
export function getBalancesFn(
|
|
871
751
|
symbol: string,
|
|
872
752
|
method: ContractMethod,
|
|
873
|
-
from: AztecAddress,
|
|
874
753
|
logger: any,
|
|
875
754
|
): (...addresses: (AztecAddress | { address: AztecAddress })[]) => Promise<bigint[]> {
|
|
876
755
|
const balances = async (...addressLikes: (AztecAddress | { address: AztecAddress })[]) => {
|
|
877
756
|
const addresses = addressLikes.map(addressLike => ('address' in addressLike ? addressLike.address : addressLike));
|
|
878
|
-
const b = await Promise.all(addresses.map(address => method(address).simulate({ from })));
|
|
757
|
+
const b = await Promise.all(addresses.map(address => method(address).simulate({ from: address })));
|
|
879
758
|
const debugString = `${symbol} balances: ${addresses.map((address, i) => `${address}: ${b[i]}`).join(', ')}`;
|
|
880
759
|
logger.verbose(debugString);
|
|
881
760
|
return b;
|