@aztec/end-to-end 0.0.1-commit.9593d84 → 0.0.1-commit.96bb3f7
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 +3 -3
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +6 -4
- package/dest/bench/client_flows/data_extractor.js +3 -1
- package/dest/bench/utils.d.ts +5 -5
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +18 -11
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +14 -7
- 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 +36 -19
- package/dest/e2e_epochs/epochs_test.d.ts +11 -9
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +14 -12
- package/dest/e2e_fees/bridging_race.notest.js +1 -1
- package/dest/e2e_fees/fees_test.d.ts +8 -4
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +7 -4
- package/dest/e2e_l1_publisher/write_json.d.ts +1 -1
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +2 -5
- package/dest/e2e_multi_validator/utils.js +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +2 -2
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +3 -6
- package/dest/e2e_p2p/p2p_network.d.ts +7 -6
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +11 -9
- 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 +4 -4
- package/dest/fixtures/e2e_prover_test.d.ts +3 -5
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +6 -10
- package/dest/fixtures/fixtures.d.ts +2 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +2 -3
- package/dest/fixtures/get_acvm_config.js +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +2 -2
- package/dest/fixtures/setup_p2p_test.js +3 -3
- package/dest/fixtures/snapshot_manager.d.ts +6 -8
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +27 -44
- package/dest/fixtures/utils.d.ts +17 -463
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +45 -77
- package/dest/fixtures/web3signer.js +1 -1
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/quality_of_service/grafana_client.d.ts +41 -0
- package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
- package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts +5 -3
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +3 -3
- package/dest/shared/gas_portal_test_harness.d.ts +2 -2
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/index.d.ts +2 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +3 -27
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +43 -23
- package/dest/simulators/lending_simulator.d.ts +2 -2
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +4 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +2 -1
- package/dest/spartan/tx_metrics.d.ts +39 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +95 -0
- package/dest/spartan/utils.d.ts +45 -10
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +203 -60
- package/package.json +40 -40
- package/src/bench/client_flows/client_flows_benchmark.ts +8 -5
- package/src/bench/client_flows/data_extractor.ts +1 -1
- package/src/bench/utils.ts +22 -14
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +53 -31
- package/src/e2e_epochs/epochs_test.ts +34 -21
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +13 -9
- package/src/e2e_l1_publisher/write_json.ts +2 -5
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_p2p/inactivity_slash_test.ts +4 -7
- package/src/e2e_p2p/p2p_network.ts +10 -17
- package/src/e2e_p2p/shared.ts +11 -6
- package/src/fixtures/e2e_prover_test.ts +7 -10
- package/src/fixtures/fixtures.ts +2 -5
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/fixtures/snapshot_manager.ts +44 -63
- package/src/fixtures/utils.ts +74 -139
- package/src/fixtures/web3signer.ts +1 -1
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
- package/src/shared/cross_chain_test_harness.ts +6 -9
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/index.ts +1 -1
- package/src/shared/uniswap_l1_l2.ts +53 -67
- package/src/simulators/lending_simulator.ts +2 -2
- package/src/spartan/DEVELOP.md +7 -0
- package/src/spartan/setup_test_wallets.ts +9 -2
- package/src/spartan/tx_metrics.ts +130 -0
- package/src/spartan/utils.ts +267 -51
- package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
- package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
- package/dest/fixtures/setup_l1_contracts.js +0 -17
- package/dest/quality_of_service/alert_checker.d.ts +0 -41
- package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
- package/src/fixtures/setup_l1_contracts.ts +0 -26
package/src/fixtures/utils.ts
CHANGED
|
@@ -5,26 +5,23 @@ import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec
|
|
|
5
5
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
6
6
|
import { BatchCall, type ContractMethod } from '@aztec/aztec.js/contracts';
|
|
7
7
|
import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
|
|
8
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
8
9
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
9
10
|
import { type AztecNode, createAztecNodeClient, waitForNode } from '@aztec/aztec.js/node';
|
|
10
11
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
11
12
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
14
|
+
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
15
|
+
import { isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
16
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
17
|
+
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
|
|
18
|
+
import { NULL_KEY } from '@aztec/ethereum/constants';
|
|
15
19
|
import {
|
|
16
|
-
type
|
|
17
|
-
type DeployL1ContractsReturnType,
|
|
18
|
-
FeeAssetArtifact,
|
|
19
|
-
NULL_KEY,
|
|
20
|
+
type DeployAztecL1ContractsReturnType,
|
|
20
21
|
type Operator,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
deployMulticall3,
|
|
25
|
-
getL1ContractsConfigEnvVars,
|
|
26
|
-
isAnvilTestChain,
|
|
27
|
-
} from '@aztec/ethereum';
|
|
22
|
+
type ZKPassportArgs,
|
|
23
|
+
deployAztecL1Contracts,
|
|
24
|
+
} from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
28
25
|
import {
|
|
29
26
|
DelayedTxUtils,
|
|
30
27
|
EthCheatCodes,
|
|
@@ -32,11 +29,9 @@ import {
|
|
|
32
29
|
createDelayedL1TxUtilsFromViemWallet,
|
|
33
30
|
startAnvil,
|
|
34
31
|
} from '@aztec/ethereum/test';
|
|
35
|
-
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
32
|
+
import { BlockNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
36
33
|
import { SecretValue } from '@aztec/foundation/config';
|
|
37
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
38
34
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
39
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
40
35
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
41
36
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
42
37
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
@@ -72,13 +67,19 @@ import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet/serv
|
|
|
72
67
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
73
68
|
|
|
74
69
|
import type { Anvil } from '@viem/anvil';
|
|
70
|
+
import { randomBytes } from 'crypto';
|
|
75
71
|
import fs from 'fs/promises';
|
|
76
|
-
import getPort from 'get-port';
|
|
77
72
|
import { tmpdir } from 'os';
|
|
78
73
|
import * as path from 'path';
|
|
79
|
-
import
|
|
80
|
-
import {
|
|
81
|
-
|
|
74
|
+
import type { Hex } from 'viem';
|
|
75
|
+
import {
|
|
76
|
+
type HDAccount,
|
|
77
|
+
type PrivateKeyAccount,
|
|
78
|
+
generatePrivateKey,
|
|
79
|
+
mnemonicToAccount,
|
|
80
|
+
privateKeyToAccount,
|
|
81
|
+
} from 'viem/accounts';
|
|
82
|
+
import { type Chain, foundry } from 'viem/chains';
|
|
82
83
|
|
|
83
84
|
import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
84
85
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
@@ -88,14 +89,24 @@ import { isMetricsLoggingRequested, setupMetricsLogger } from './logging.js';
|
|
|
88
89
|
export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
|
|
89
90
|
export { startAnvil };
|
|
90
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Sets up shared blob storage using FileStore in the data directory.
|
|
94
|
+
*/
|
|
95
|
+
export async function setupSharedBlobStorage(config: { dataDirectory?: string } & Record<string, any>): Promise<void> {
|
|
96
|
+
const sharedBlobPath = path.join(config.dataDirectory!, 'shared-blobs');
|
|
97
|
+
await fs.mkdir(sharedBlobPath, { recursive: true });
|
|
98
|
+
config.blobFileStoreUrls = [`file://${sharedBlobPath}`];
|
|
99
|
+
config.blobFileStoreUploadUrl = `file://${sharedBlobPath}`;
|
|
100
|
+
}
|
|
101
|
+
|
|
91
102
|
const { AZTEC_NODE_URL = '' } = process.env;
|
|
92
103
|
const getAztecUrl = () => AZTEC_NODE_URL;
|
|
93
104
|
|
|
94
105
|
let telemetry: TelemetryClient | undefined = undefined;
|
|
95
|
-
function getTelemetryClient(partialConfig: Partial<TelemetryClientConfig> & { benchmark?: boolean } = {}) {
|
|
106
|
+
async function getTelemetryClient(partialConfig: Partial<TelemetryClientConfig> & { benchmark?: boolean } = {}) {
|
|
96
107
|
if (!telemetry) {
|
|
97
108
|
const config = { ...getTelemetryConfig(), ...partialConfig };
|
|
98
|
-
telemetry = config.benchmark ? new BenchmarkTelemetryClient() : initTelemetryClient(config);
|
|
109
|
+
telemetry = config.benchmark ? new BenchmarkTelemetryClient() : await initTelemetryClient(config);
|
|
99
110
|
}
|
|
100
111
|
return telemetry;
|
|
101
112
|
}
|
|
@@ -111,37 +122,6 @@ export const getPrivateKeyFromIndex = (index: number): Buffer | null => {
|
|
|
111
122
|
return privKeyRaw === null ? null : Buffer.from(privKeyRaw);
|
|
112
123
|
};
|
|
113
124
|
|
|
114
|
-
export const setupL1Contracts = async (
|
|
115
|
-
l1RpcUrls: string[],
|
|
116
|
-
account: HDAccount | PrivateKeyAccount,
|
|
117
|
-
logger: Logger,
|
|
118
|
-
args: Partial<DeployL1ContractsArgs> = {},
|
|
119
|
-
chain: Chain = foundry,
|
|
120
|
-
) => {
|
|
121
|
-
const l1Data = await deployL1Contracts(
|
|
122
|
-
l1RpcUrls,
|
|
123
|
-
account,
|
|
124
|
-
chain,
|
|
125
|
-
logger,
|
|
126
|
-
{
|
|
127
|
-
vkTreeRoot: getVKTreeRoot(),
|
|
128
|
-
protocolContractsHash,
|
|
129
|
-
genesisArchiveRoot: args.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
|
|
130
|
-
salt: args.salt,
|
|
131
|
-
initialValidators: args.initialValidators,
|
|
132
|
-
...getL1ContractsConfigEnvVars(),
|
|
133
|
-
realVerifier: false,
|
|
134
|
-
...args,
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
priorityFeeBumpPercentage: 0,
|
|
138
|
-
priorityFeeRetryBumpPercentage: 0,
|
|
139
|
-
},
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
return l1Data;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
125
|
/**
|
|
146
126
|
* Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
|
|
147
127
|
* @param aztecNode - An instance of Aztec Node.
|
|
@@ -218,7 +198,7 @@ async function setupWithRemoteEnvironment(
|
|
|
218
198
|
|
|
219
199
|
const l1Client = createExtendedL1Client(config.l1RpcUrls, account, foundry);
|
|
220
200
|
|
|
221
|
-
const deployL1ContractsValues:
|
|
201
|
+
const deployL1ContractsValues: DeployAztecL1ContractsReturnType = {
|
|
222
202
|
l1ContractAddresses,
|
|
223
203
|
l1Client,
|
|
224
204
|
rollupVersion,
|
|
@@ -260,7 +240,6 @@ async function setupWithRemoteEnvironment(
|
|
|
260
240
|
mockGossipSubNetwork: undefined,
|
|
261
241
|
watcher: undefined,
|
|
262
242
|
dateProvider: undefined,
|
|
263
|
-
blobSink: undefined,
|
|
264
243
|
telemetryClient: undefined,
|
|
265
244
|
teardown,
|
|
266
245
|
};
|
|
@@ -273,17 +252,13 @@ export type SetupOptions = {
|
|
|
273
252
|
/** Whether to enable metrics collection, if undefined, metrics collection is disabled */
|
|
274
253
|
metricsPort?: number | undefined;
|
|
275
254
|
/** Previously deployed contracts on L1 */
|
|
276
|
-
deployL1ContractsValues?:
|
|
277
|
-
/** Whether to skip deployment of protocol contracts (auth registry, etc) */
|
|
278
|
-
skipProtocolContracts?: boolean;
|
|
255
|
+
deployL1ContractsValues?: DeployAztecL1ContractsReturnType;
|
|
279
256
|
/** Initial fee juice for default accounts */
|
|
280
257
|
initialAccountFeeJuice?: Fr;
|
|
281
258
|
/** Number of initial accounts funded with fee juice */
|
|
282
259
|
numberOfInitialFundedAccounts?: number;
|
|
283
260
|
/** Data of the initial funded accounts */
|
|
284
261
|
initialFundedAccounts?: InitialAccountData[];
|
|
285
|
-
/** Salt to use in L1 contract deployment */
|
|
286
|
-
salt?: number;
|
|
287
262
|
/** An initial set of validators */
|
|
288
263
|
initialValidators?: (Operator & { privateKey: `0x${string}` })[];
|
|
289
264
|
/** Anvil Start time */
|
|
@@ -292,8 +267,6 @@ export type SetupOptions = {
|
|
|
292
267
|
l2StartTime?: number;
|
|
293
268
|
/** Whether to start a prover node */
|
|
294
269
|
startProverNode?: boolean;
|
|
295
|
-
/** Whether to fund the rewardDistributor */
|
|
296
|
-
fundRewardDistributor?: boolean;
|
|
297
270
|
/** Manual config for the telemetry client */
|
|
298
271
|
telemetryConfig?: Partial<TelemetryClientConfig> & { benchmark?: boolean };
|
|
299
272
|
/** Public data that will be inserted in the tree in genesis */
|
|
@@ -312,6 +285,8 @@ export type SetupOptions = {
|
|
|
312
285
|
anvilPort?: number;
|
|
313
286
|
/** Key to use for publishing L1 contracts */
|
|
314
287
|
l1PublisherKey?: SecretValue<`0x${string}`>;
|
|
288
|
+
/** ZkPassport configuration (domain, scope, mock verifier) */
|
|
289
|
+
zkPassportArgs?: ZKPassportArgs;
|
|
315
290
|
} & Partial<AztecNodeConfig>;
|
|
316
291
|
|
|
317
292
|
/** Context for an end-to-end test as returned by the `setup` function */
|
|
@@ -324,8 +299,8 @@ export type EndToEndContext = {
|
|
|
324
299
|
proverNode: ProverNode | undefined;
|
|
325
300
|
/** A client to the sequencer service (undefined if connected to remote environment) */
|
|
326
301
|
sequencer: SequencerClient | undefined;
|
|
327
|
-
/** Return values from
|
|
328
|
-
deployL1ContractsValues:
|
|
302
|
+
/** Return values from deployAztecL1Contracts function. */
|
|
303
|
+
deployL1ContractsValues: DeployAztecL1ContractsReturnType;
|
|
329
304
|
/** The Aztec Node configuration. */
|
|
330
305
|
config: AztecNodeConfig;
|
|
331
306
|
/** The data for the initial funded accounts. */
|
|
@@ -344,8 +319,6 @@ export type EndToEndContext = {
|
|
|
344
319
|
watcher: AnvilTestWatcher | undefined;
|
|
345
320
|
/** Allows tweaking current system time, used by the epoch cache only (undefined if connected to remote environment) */
|
|
346
321
|
dateProvider: TestDateProvider | undefined;
|
|
347
|
-
/** The blob sink (undefined if connected to remote environment) */
|
|
348
|
-
blobSink: BlobSinkServer | undefined;
|
|
349
322
|
/** Telemetry client */
|
|
350
323
|
telemetryClient: TelemetryClient | undefined;
|
|
351
324
|
/** Mock gossip sub network used for gossipping messages (only if mockGossipSubNetwork was set to true in opts) */
|
|
@@ -429,27 +402,32 @@ export async function setup(
|
|
|
429
402
|
await ethCheatCodes.warp(opts.l1StartTime, { resetBlockInterval: true });
|
|
430
403
|
}
|
|
431
404
|
|
|
432
|
-
let
|
|
433
|
-
let publisherHdAccount = undefined;
|
|
405
|
+
let publisherPrivKeyHex: `0x${string}` | undefined = undefined;
|
|
406
|
+
let publisherHdAccount: HDAccount | PrivateKeyAccount | undefined = undefined;
|
|
434
407
|
|
|
435
408
|
if (opts.l1PublisherKey && opts.l1PublisherKey.getValue() && opts.l1PublisherKey.getValue() != NULL_KEY) {
|
|
436
|
-
|
|
409
|
+
publisherPrivKeyHex = opts.l1PublisherKey.getValue();
|
|
410
|
+
publisherHdAccount = privateKeyToAccount(publisherPrivKeyHex);
|
|
437
411
|
} else if (
|
|
438
412
|
config.publisherPrivateKeys &&
|
|
439
413
|
config.publisherPrivateKeys.length > 0 &&
|
|
440
414
|
config.publisherPrivateKeys[0].getValue() != NULL_KEY
|
|
441
415
|
) {
|
|
442
|
-
|
|
416
|
+
publisherPrivKeyHex = config.publisherPrivateKeys[0].getValue();
|
|
417
|
+
publisherHdAccount = privateKeyToAccount(publisherPrivKeyHex);
|
|
443
418
|
} else if (!MNEMONIC) {
|
|
444
419
|
throw new Error(`Mnemonic not provided and no publisher private key`);
|
|
445
420
|
} else {
|
|
446
421
|
publisherHdAccount = mnemonicToAccount(MNEMONIC, { addressIndex: 0 });
|
|
447
422
|
const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
|
|
448
|
-
publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
449
|
-
|
|
423
|
+
const publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
424
|
+
publisherPrivKeyHex = `0x${publisherPrivKey!.toString('hex')}` as const;
|
|
425
|
+
config.publisherPrivateKeys = [new SecretValue(publisherPrivKeyHex)];
|
|
450
426
|
}
|
|
451
427
|
|
|
452
|
-
config.coinbase
|
|
428
|
+
if (config.coinbase === undefined) {
|
|
429
|
+
config.coinbase = EthAddress.fromString(publisherHdAccount.address);
|
|
430
|
+
}
|
|
453
431
|
|
|
454
432
|
if (AZTEC_NODE_URL) {
|
|
455
433
|
// we are setting up against a remote environment, l1 contracts are assumed to already be deployed
|
|
@@ -472,51 +450,26 @@ export async function setup(
|
|
|
472
450
|
}
|
|
473
451
|
|
|
474
452
|
const l1Client = createExtendedL1Client(config.l1RpcUrls, publisherHdAccount!, chain);
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
453
|
+
|
|
454
|
+
const deployL1ContractsValues: DeployAztecL1ContractsReturnType = await deployAztecL1Contracts(
|
|
455
|
+
config.l1RpcUrls[0],
|
|
456
|
+
publisherPrivKeyHex!,
|
|
457
|
+
chain.id,
|
|
458
|
+
{
|
|
459
|
+
...getL1ContractsConfigEnvVars(),
|
|
460
|
+
...opts,
|
|
461
|
+
vkTreeRoot: getVKTreeRoot(),
|
|
462
|
+
protocolContractsHash,
|
|
463
|
+
genesisArchiveRoot,
|
|
464
|
+
initialValidators: opts.initialValidators,
|
|
465
|
+
feeJuicePortalInitialBalance: fundingNeeded,
|
|
466
|
+
realVerifier: false,
|
|
467
|
+
},
|
|
468
|
+
);
|
|
491
469
|
|
|
492
470
|
config.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
|
|
493
471
|
config.rollupVersion = deployL1ContractsValues.rollupVersion;
|
|
494
472
|
|
|
495
|
-
if (opts.fundRewardDistributor) {
|
|
496
|
-
// Mints block rewards for 10000 blocks to the rewardDistributor contract
|
|
497
|
-
|
|
498
|
-
const rollup = new RollupContract(
|
|
499
|
-
deployL1ContractsValues.l1Client,
|
|
500
|
-
deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
501
|
-
);
|
|
502
|
-
|
|
503
|
-
const blockReward = await rollup.getCheckpointReward();
|
|
504
|
-
const mintAmount = 10_000n * (blockReward as bigint);
|
|
505
|
-
|
|
506
|
-
const feeJuice = getContract({
|
|
507
|
-
address: deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress.toString(),
|
|
508
|
-
abi: FeeAssetArtifact.contractAbi,
|
|
509
|
-
client: deployL1ContractsValues.l1Client,
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
const rewardDistributorMintTxHash = await feeJuice.write.mint(
|
|
513
|
-
[deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress.toString(), mintAmount],
|
|
514
|
-
{} as any,
|
|
515
|
-
);
|
|
516
|
-
await deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: rewardDistributorMintTxHash });
|
|
517
|
-
logger.info(`Funding rewardDistributor in ${rewardDistributorMintTxHash}`);
|
|
518
|
-
}
|
|
519
|
-
|
|
520
473
|
if (enableAutomine) {
|
|
521
474
|
await ethCheatCodes.setAutomine(false);
|
|
522
475
|
await ethCheatCodes.setIntervalMining(config.ethereumSlotDuration);
|
|
@@ -539,23 +492,9 @@ export async function setup(
|
|
|
539
492
|
await watcher.start();
|
|
540
493
|
}
|
|
541
494
|
|
|
542
|
-
const telemetry = getTelemetryClient(opts.telemetryConfig);
|
|
495
|
+
const telemetry = await getTelemetryClient(opts.telemetryConfig);
|
|
543
496
|
|
|
544
|
-
|
|
545
|
-
const blobSinkPort = await getPort();
|
|
546
|
-
const blobSink = await createBlobSinkServer(
|
|
547
|
-
{
|
|
548
|
-
l1ChainId: config.l1ChainId,
|
|
549
|
-
l1RpcUrls: config.l1RpcUrls,
|
|
550
|
-
l1Contracts: config.l1Contracts,
|
|
551
|
-
port: blobSinkPort,
|
|
552
|
-
dataDirectory: config.dataDirectory,
|
|
553
|
-
dataStoreMapSizeKb: config.dataStoreMapSizeKb,
|
|
554
|
-
},
|
|
555
|
-
telemetry,
|
|
556
|
-
);
|
|
557
|
-
await blobSink.start();
|
|
558
|
-
config.blobSinkUrl = `http://localhost:${blobSinkPort}`;
|
|
497
|
+
await setupSharedBlobStorage(config);
|
|
559
498
|
|
|
560
499
|
logger.verbose('Creating and synching an aztec node', config);
|
|
561
500
|
|
|
@@ -571,8 +510,6 @@ export async function setup(
|
|
|
571
510
|
config.bbWorkingDirectory = bbConfig.bbWorkingDirectory;
|
|
572
511
|
}
|
|
573
512
|
|
|
574
|
-
const blobSinkClient = createBlobSinkClient(config, { logger: createLogger('node:blob-sink:client') });
|
|
575
|
-
|
|
576
513
|
let mockGossipSubNetwork: MockGossipSubNetwork | undefined;
|
|
577
514
|
let p2pClientDeps: P2PClientDeps<P2PClientType.Full> | undefined = undefined;
|
|
578
515
|
|
|
@@ -611,7 +548,7 @@ export async function setup(
|
|
|
611
548
|
|
|
612
549
|
const aztecNode = await AztecNodeService.createAndSync(
|
|
613
550
|
config, // REFACTOR: createAndSync mutates this config
|
|
614
|
-
{ dateProvider,
|
|
551
|
+
{ dateProvider, telemetry, p2pClientDeps, logger: createLogger('node:MAIN-aztec-node') },
|
|
615
552
|
{ prefilledPublicData },
|
|
616
553
|
);
|
|
617
554
|
const sequencerClient = aztecNode.getSequencer();
|
|
@@ -699,7 +636,6 @@ export async function setup(
|
|
|
699
636
|
await tryStop(watcher, logger);
|
|
700
637
|
await tryStop(anvil, logger);
|
|
701
638
|
|
|
702
|
-
await tryStop(blobSink, logger);
|
|
703
639
|
await tryRmDir(directoryToCleanup, logger);
|
|
704
640
|
} catch (err) {
|
|
705
641
|
logger.error(`Error during e2e test teardown`, err);
|
|
@@ -709,7 +645,6 @@ export async function setup(
|
|
|
709
645
|
return {
|
|
710
646
|
aztecNode,
|
|
711
647
|
aztecNodeAdmin: aztecNode,
|
|
712
|
-
blobSink,
|
|
713
648
|
cheatCodes,
|
|
714
649
|
ethCheatCodes,
|
|
715
650
|
config,
|
|
@@ -876,7 +811,7 @@ export async function registerSponsoredFPC(wallet: Wallet): Promise<void> {
|
|
|
876
811
|
await wallet.registerContract(await getSponsoredFPCInstance(), SponsoredFPCContract.artifact);
|
|
877
812
|
}
|
|
878
813
|
|
|
879
|
-
export async function waitForProvenChain(node: AztecNode, targetBlock?:
|
|
814
|
+
export async function waitForProvenChain(node: AztecNode, targetBlock?: BlockNumber, timeoutSec = 60, intervalSec = 1) {
|
|
880
815
|
targetBlock ??= await node.getBlockNumber();
|
|
881
816
|
|
|
882
817
|
await retryUntil(
|
|
@@ -904,13 +839,13 @@ export function createAndSyncProverNode(
|
|
|
904
839
|
stop: () => Promise.resolve(),
|
|
905
840
|
};
|
|
906
841
|
|
|
907
|
-
const
|
|
842
|
+
const blobClient = await createBlobClientWithFileStores(aztecNodeConfig, createLogger('blob-client:prover-node'));
|
|
908
843
|
|
|
909
844
|
// Creating temp store and archiver for simulated prover node
|
|
910
845
|
const archiverConfig = { ...aztecNodeConfig, dataDirectory: proverNodeConfig.dataDirectory };
|
|
911
846
|
const archiver = await createArchiver(
|
|
912
847
|
archiverConfig,
|
|
913
|
-
{
|
|
848
|
+
{ blobClient, dateProvider: proverNodeDeps.dateProvider },
|
|
914
849
|
{ blockUntilSync: true },
|
|
915
850
|
);
|
|
916
851
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
1
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
2
2
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
3
3
|
import { sleep } from '@aztec/foundation/sleep';
|
|
4
4
|
import { RemoteSigner } from '@aztec/node-keystore';
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
} from '@aztec/telemetry-client';
|
|
8
8
|
import { OTelPinoStream } from '@aztec/telemetry-client/otel-pino-stream';
|
|
9
9
|
|
|
10
|
-
export function getEndToEndTestTelemetryClient(metricsPort?: number): TelemetryClient {
|
|
10
|
+
export async function getEndToEndTestTelemetryClient(metricsPort?: number): Promise<TelemetryClient> {
|
|
11
11
|
if (metricsPort) {
|
|
12
12
|
const otelStream = new OTelPinoStream({ levels });
|
|
13
13
|
registerLoggingStream(otelStream);
|
|
14
14
|
}
|
|
15
|
-
return initTelemetryClient(getEndToEndTestTelemetryConfig(metricsPort));
|
|
15
|
+
return await initTelemetryClient(getEndToEndTestTelemetryConfig(metricsPort));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -13,7 +13,10 @@ import type { AztecNode } from '@aztec/aztec.js/node';
|
|
|
13
13
|
import type { SiblingPath } from '@aztec/aztec.js/trees';
|
|
14
14
|
import type { TxReceipt } from '@aztec/aztec.js/tx';
|
|
15
15
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
16
|
-
import {
|
|
16
|
+
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
17
|
+
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
18
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
19
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
17
20
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
18
21
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
19
22
|
import { TestERC20Abi, TokenPortalAbi, TokenPortalBytecode } from '@aztec/l1-artifacts';
|
|
@@ -321,17 +324,11 @@ export class CrossChainTestHarness {
|
|
|
321
324
|
|
|
322
325
|
withdrawFundsFromBridgeOnL1(
|
|
323
326
|
amount: bigint,
|
|
324
|
-
|
|
327
|
+
epochNumber: EpochNumber,
|
|
325
328
|
messageIndex: bigint,
|
|
326
329
|
siblingPath: SiblingPath<number>,
|
|
327
330
|
) {
|
|
328
|
-
return this.l1TokenPortalManager.withdrawFunds(
|
|
329
|
-
amount,
|
|
330
|
-
this.ethAccount,
|
|
331
|
-
BigInt(blockNumber),
|
|
332
|
-
messageIndex,
|
|
333
|
-
siblingPath,
|
|
334
|
-
);
|
|
331
|
+
return this.l1TokenPortalManager.withdrawFunds(amount, this.ethAccount, epochNumber, messageIndex, siblingPath);
|
|
335
332
|
}
|
|
336
333
|
|
|
337
334
|
async transferToPrivateOnL2(shieldAmount: bigint) {
|
|
@@ -4,7 +4,7 @@ import { Fr } from '@aztec/aztec.js/fields';
|
|
|
4
4
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
5
5
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
6
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
7
|
-
import type { ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
7
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
8
8
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
9
9
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
10
10
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
package/src/shared/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { uniswapL1L2TestSuite
|
|
1
|
+
export { uniswapL1L2TestSuite } from './uniswap_l1_l2.js';
|