@aztec/end-to-end 3.0.0-nightly.20250923 → 3.0.0-nightly.20250925
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 +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +6 -10
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +1 -1
- 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 +1 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts +1 -1
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.d.ts +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +2 -3
- package/dest/e2e_p2p/p2p_network.d.ts +1 -1
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +2 -4
- package/dest/e2e_p2p/shared.d.ts +5 -11
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +36 -32
- package/dest/e2e_token_contract/token_contract_test.d.ts +1 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts +0 -7
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.d.ts +1 -1
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +13 -15
- package/dest/fixtures/utils.d.ts +1 -7
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +25 -53
- package/dest/shared/submit-transactions.d.ts +1 -1
- 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/spartan/setup_test_wallets.d.ts +3 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +26 -21
- package/package.json +37 -37
- package/src/bench/client_flows/client_flows_benchmark.ts +5 -8
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +2 -2
- package/src/e2e_deploy_contract/deploy_test.ts +1 -1
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +3 -3
- package/src/e2e_p2p/p2p_network.ts +55 -61
- package/src/e2e_p2p/shared.ts +40 -30
- package/src/e2e_token_contract/token_contract_test.ts +1 -1
- package/src/fixtures/e2e_prover_test.ts +1 -1
- package/src/fixtures/setup_p2p_test.ts +0 -8
- package/src/fixtures/snapshot_manager.ts +15 -16
- package/src/fixtures/utils.ts +25 -55
- package/src/shared/submit-transactions.ts +1 -1
- package/src/shared/uniswap_l1_l2.ts +1 -1
- package/src/spartan/setup_test_wallets.ts +20 -28
|
@@ -14,10 +14,10 @@ import { tryRmDir } from '@aztec/foundation/fs';
|
|
|
14
14
|
import { createLogger } from '@aztec/foundation/log';
|
|
15
15
|
import { resolver, reviver } from '@aztec/foundation/serialize';
|
|
16
16
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
17
|
-
import {
|
|
17
|
+
import { getPXEServiceConfig } from '@aztec/pxe/server';
|
|
18
18
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
19
19
|
import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
20
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
20
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
21
21
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
22
22
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
23
23
|
import { copySync, removeSync } from 'fs-extra/esm';
|
|
@@ -119,7 +119,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
119
119
|
// Execute the restoration function.
|
|
120
120
|
await restore(snapshotData, context);
|
|
121
121
|
// Save the snapshot data.
|
|
122
|
-
const ethCheatCodes = new EthCheatCodesWithState(context.aztecNodeConfig.l1RpcUrls);
|
|
122
|
+
const ethCheatCodes = new EthCheatCodesWithState(context.aztecNodeConfig.l1RpcUrls, context.dateProvider);
|
|
123
123
|
const anvilStateFile = `${this.livePath}/anvil.dat`;
|
|
124
124
|
await ethCheatCodes.dumpChainState(anvilStateFile);
|
|
125
125
|
writeFileSync(`${this.livePath}/${name}.json`, JSON.stringify(snapshotData || {}, resolver));
|
|
@@ -262,7 +262,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
262
262
|
aztecNodeConfig.l1RpcUrls = [
|
|
263
263
|
res.rpcUrl
|
|
264
264
|
];
|
|
265
|
-
const
|
|
265
|
+
const dateProvider = new TestDateProvider();
|
|
266
|
+
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls, dateProvider);
|
|
266
267
|
// Deploy our L1 contracts.
|
|
267
268
|
logger.verbose('Deploying L1 contracts...');
|
|
268
269
|
if (opts.l1StartTime) {
|
|
@@ -285,8 +286,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
285
286
|
aztecNodeConfig.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
|
|
286
287
|
aztecNodeConfig.rollupVersion = deployL1ContractsValues.rollupVersion;
|
|
287
288
|
aztecNodeConfig.l1PublishRetryIntervalMS = 100;
|
|
288
|
-
const
|
|
289
|
-
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
289
|
+
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls, dateProvider), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
290
290
|
await watcher.start();
|
|
291
291
|
const acvmConfig = await getACVMConfig(logger);
|
|
292
292
|
if (acvmConfig) {
|
|
@@ -330,9 +330,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
330
330
|
pxeConfig.dataDirectory = statePath ?? path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
331
331
|
// Only enable proving if specifically requested.
|
|
332
332
|
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
333
|
-
const
|
|
334
|
-
const
|
|
335
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode);
|
|
333
|
+
const wallet = await TestWallet.create(aztecNode, pxeConfig);
|
|
334
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode, dateProvider);
|
|
336
335
|
if (statePath) {
|
|
337
336
|
writeFileSync(`${statePath}/aztec_node_config.json`, JSON.stringify(aztecNodeConfig, resolver));
|
|
338
337
|
writeFileSync(`${statePath}/accounts.json`, JSON.stringify(initialFundedAccounts, resolver));
|
|
@@ -379,7 +378,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
379
378
|
];
|
|
380
379
|
// Load anvil state.
|
|
381
380
|
const anvilStateFile = `${statePath}/anvil.dat`;
|
|
382
|
-
const
|
|
381
|
+
const dateProvider = new TestDateProvider();
|
|
382
|
+
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls, dateProvider);
|
|
383
383
|
await ethCheatCodes.loadChainState(anvilStateFile);
|
|
384
384
|
// TODO: Encapsulate this in a NativeAcvm impl.
|
|
385
385
|
const acvmConfig = await getACVMConfig(logger);
|
|
@@ -394,8 +394,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
394
394
|
}
|
|
395
395
|
logger.verbose('Creating ETH clients...');
|
|
396
396
|
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, mnemonicToAccount(MNEMONIC));
|
|
397
|
-
const
|
|
398
|
-
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls), aztecNodeConfig.l1Contracts.rollupAddress, l1Client, dateProvider);
|
|
397
|
+
const watcher = new AnvilTestWatcher(ethCheatCodes, aztecNodeConfig.l1Contracts.rollupAddress, l1Client, dateProvider);
|
|
399
398
|
await watcher.start();
|
|
400
399
|
const telemetry = initTelemetryClient(getTelemetryConfig());
|
|
401
400
|
const blobSink = await createBlobSinkServer({
|
|
@@ -428,9 +427,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
428
427
|
logger.verbose('Creating pxe...');
|
|
429
428
|
const pxeConfig = getPXEServiceConfig();
|
|
430
429
|
pxeConfig.dataDirectory = statePath;
|
|
431
|
-
const
|
|
432
|
-
const
|
|
433
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode);
|
|
430
|
+
const wallet = await TestWallet.create(aztecNode, pxeConfig);
|
|
431
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode, dateProvider);
|
|
434
432
|
return {
|
|
435
433
|
aztecNodeConfig,
|
|
436
434
|
anvil,
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
|
17
17
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
18
18
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
19
19
|
import { type TelemetryClient, type TelemetryClientConfig } from '@aztec/telemetry-client';
|
|
20
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
20
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
21
21
|
import { type Chain, type HDAccount, type PrivateKeyAccount } from 'viem';
|
|
22
22
|
export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
|
|
23
23
|
export { startAnvil };
|
|
@@ -151,12 +151,6 @@ export declare function setup(numberOfAccounts?: number, opts?: SetupOptions, px
|
|
|
151
151
|
* @param accountsToDeploy - Which accounts to publicly deploy.
|
|
152
152
|
*/
|
|
153
153
|
export declare function ensureAccountContractsPublished(wallet: Wallet, accountsToDeploy: AztecAddress[]): Promise<void>;
|
|
154
|
-
/**
|
|
155
|
-
* Sets the timestamp of the next block.
|
|
156
|
-
* @param rpcUrl - rpc url of the blockchain instance to connect to
|
|
157
|
-
* @param timestamp - the timestamp for the next block
|
|
158
|
-
*/
|
|
159
|
-
export declare function setNextBlockTimestamp(rpcUrl: string, timestamp: number): Promise<void>;
|
|
160
154
|
/**
|
|
161
155
|
* Returns a logger instance for the current test.
|
|
162
156
|
* @returns a logger instance for the current test.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAuD,MAAM,yBAAyB,CAAC;AAEvH,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,MAAM,EAKZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBA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,GAAG,SAAS,EAChC,mBAAmB,GAAE,kBAAkB,EAAO,EAC9C,cAAc,GAAE,cAAmB,uBAqDpC"}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr';
|
|
2
|
-
import { generateSchnorrAccounts,
|
|
2
|
+
import { generateSchnorrAccounts, getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
3
3
|
import { createArchiver } from '@aztec/archiver';
|
|
4
4
|
import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
|
-
import { BatchCall, createAztecNodeClient, createLogger,
|
|
5
|
+
import { BatchCall, createAztecNodeClient, createLogger, sleep, waitForNode } from '@aztec/aztec.js';
|
|
6
6
|
import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
|
|
7
7
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
8
8
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
@@ -17,20 +17,18 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
17
17
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
18
18
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
19
19
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
20
|
-
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
20
|
+
import { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
|
|
21
21
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
22
22
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
23
23
|
import { MockGossipSubNetwork, getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
24
24
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
25
25
|
import { createProverNode } from '@aztec/prover-node';
|
|
26
|
-
import {
|
|
27
|
-
import { MemoryCircuitRecorder, SimulatorRecorderWrapper, WASMSimulator } from '@aztec/simulator/client';
|
|
28
|
-
import { FileCircuitRecorder } from '@aztec/simulator/testing';
|
|
26
|
+
import { getPXEServiceConfig } from '@aztec/pxe/server';
|
|
29
27
|
import { getContractClassFromArtifact, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
30
28
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
31
29
|
import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
32
30
|
import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
33
|
-
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
|
|
31
|
+
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet/server';
|
|
34
32
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
35
33
|
import fs from 'fs/promises';
|
|
36
34
|
import getPort from 'get-port';
|
|
@@ -45,8 +43,8 @@ import { getBBConfig } from './get_bb_config.js';
|
|
|
45
43
|
import { isMetricsLoggingRequested, setupMetricsLogger } from './logging.js';
|
|
46
44
|
export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
|
|
47
45
|
export { startAnvil };
|
|
48
|
-
const {
|
|
49
|
-
const getAztecUrl = ()=>
|
|
46
|
+
const { AZTEC_NODE_URL = '' } = process.env;
|
|
47
|
+
const getAztecUrl = ()=>AZTEC_NODE_URL;
|
|
50
48
|
let telemetry = undefined;
|
|
51
49
|
function getTelemetryClient(partialConfig = {}) {
|
|
52
50
|
if (!telemetry) {
|
|
@@ -102,14 +100,10 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
102
100
|
if (!configuredDataDirectory) {
|
|
103
101
|
pxeServiceConfig.dataDirectory = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
104
102
|
}
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
const simulatorWithRecorder = new SimulatorRecorderWrapper(simulator, recorder);
|
|
108
|
-
const pxe = await createPXEServiceWithSimulator(aztecNode, simulatorWithRecorder, pxeServiceConfig, {
|
|
103
|
+
const teardown = configuredDataDirectory ? ()=>Promise.resolve() : ()=>tryRmDir(pxeServiceConfig.dataDirectory);
|
|
104
|
+
const wallet = await TestWallet.create(aztecNode, pxeServiceConfig, {
|
|
109
105
|
useLogSuffix
|
|
110
106
|
});
|
|
111
|
-
const teardown = configuredDataDirectory ? ()=>Promise.resolve() : ()=>tryRmDir(pxeServiceConfig.dataDirectory);
|
|
112
|
-
const wallet = new TestWallet(pxe, aztecNode);
|
|
113
107
|
return {
|
|
114
108
|
wallet,
|
|
115
109
|
logger,
|
|
@@ -129,15 +123,9 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
129
123
|
const aztecNodeUrl = getAztecUrl();
|
|
130
124
|
logger.verbose(`Creating Aztec Node client to remote host ${aztecNodeUrl}`);
|
|
131
125
|
const aztecNode = createAztecNodeClient(aztecNodeUrl);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
2,
|
|
136
|
-
3
|
|
137
|
-
], true));
|
|
138
|
-
await waitForPXE(pxeClient, logger);
|
|
139
|
-
logger.verbose('JSON RPC client connected to PXE');
|
|
140
|
-
logger.verbose(`Retrieving contract addresses from ${PXE_URL}`);
|
|
126
|
+
await waitForNode(aztecNode, logger);
|
|
127
|
+
logger.verbose('JSON RPC client connected to Aztec Node');
|
|
128
|
+
logger.verbose(`Retrieving contract addresses from ${aztecNodeUrl}`);
|
|
141
129
|
const { l1ContractAddresses, rollupVersion } = await aztecNode.getNodeInfo();
|
|
142
130
|
const l1Client = createExtendedL1Client(config.l1RpcUrls, account, foundry);
|
|
143
131
|
const deployL1ContractsValues = {
|
|
@@ -145,12 +133,12 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
145
133
|
l1Client,
|
|
146
134
|
rollupVersion
|
|
147
135
|
};
|
|
148
|
-
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls);
|
|
149
|
-
const wallet =
|
|
150
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode);
|
|
136
|
+
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls, new DateProvider());
|
|
137
|
+
const wallet = await TestWallet.create(aztecNode);
|
|
138
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode, new DateProvider());
|
|
151
139
|
const teardown = ()=>Promise.resolve();
|
|
152
140
|
logger.verbose('Populating wallet from already registered accounts...');
|
|
153
|
-
const initialFundedAccounts = await
|
|
141
|
+
const initialFundedAccounts = await getInitialTestAccountsData();
|
|
154
142
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
155
143
|
throw new Error(`Required ${numberOfAccounts} accounts. Found ${initialFundedAccounts.length}.`);
|
|
156
144
|
// Deploy new accounts if there's a test that requires more funded accounts in the remote environment.
|
|
@@ -215,8 +203,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
215
203
|
if (!isAnvilTestChain(chain.id)) {
|
|
216
204
|
throw new Error(`No ETHEREUM_HOSTS set but non anvil chain requested`);
|
|
217
205
|
}
|
|
218
|
-
if (
|
|
219
|
-
throw new Error(`
|
|
206
|
+
if (AZTEC_NODE_URL) {
|
|
207
|
+
throw new Error(`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`);
|
|
220
208
|
}
|
|
221
209
|
const res = await startAnvil({
|
|
222
210
|
l1BlockTime: opts.ethereumSlotDuration,
|
|
@@ -234,7 +222,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
234
222
|
logger.info(`Logging metrics to ${filename}`);
|
|
235
223
|
setupMetricsLogger(filename);
|
|
236
224
|
}
|
|
237
|
-
const
|
|
225
|
+
const dateProvider = new TestDateProvider();
|
|
226
|
+
const ethCheatCodes = new EthCheatCodesWithState(config.l1RpcUrls, dateProvider);
|
|
238
227
|
if (opts.stateLoad) {
|
|
239
228
|
await ethCheatCodes.loadChainState(opts.stateLoad);
|
|
240
229
|
}
|
|
@@ -262,7 +251,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
262
251
|
];
|
|
263
252
|
}
|
|
264
253
|
config.coinbase = EthAddress.fromString(publisherHdAccount.address);
|
|
265
|
-
if (
|
|
254
|
+
if (AZTEC_NODE_URL) {
|
|
266
255
|
// we are setting up against a remote environment, l1 contracts are assumed to already be deployed
|
|
267
256
|
return await setupWithRemoteEnvironment(publisherHdAccount, config, logger, numberOfAccounts);
|
|
268
257
|
}
|
|
@@ -305,6 +294,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
305
294
|
if (enableAutomine) {
|
|
306
295
|
await ethCheatCodes.setAutomine(false);
|
|
307
296
|
await ethCheatCodes.setIntervalMining(config.ethereumSlotDuration);
|
|
297
|
+
dateProvider.setTime(await ethCheatCodes.timestamp() * 1000);
|
|
308
298
|
}
|
|
309
299
|
if (opts.l2StartTime) {
|
|
310
300
|
// This should only be used in synching test or when you need to have a stable
|
|
@@ -313,9 +303,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
313
303
|
resetBlockInterval: true
|
|
314
304
|
});
|
|
315
305
|
}
|
|
316
|
-
const
|
|
317
|
-
dateProvider.setTime(await ethCheatCodes.timestamp() * 1000);
|
|
318
|
-
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(config.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
306
|
+
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(config.l1RpcUrls, dateProvider), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
319
307
|
if (!opts.disableAnvilTestWatcher) {
|
|
320
308
|
await watcher.start();
|
|
321
309
|
}
|
|
@@ -410,12 +398,10 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
410
398
|
}
|
|
411
399
|
logger.verbose('Creating a pxe...');
|
|
412
400
|
const { wallet, teardown: pxeTeardown } = await setupPXEServiceAndGetWallet(aztecNode, pxeOpts, logger);
|
|
413
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode);
|
|
401
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode, dateProvider);
|
|
414
402
|
if (opts.aztecTargetCommitteeSize && opts.aztecTargetCommitteeSize > 0 || opts.initialValidators && opts.initialValidators.length > 0) {
|
|
415
403
|
// We need to advance such that the committee is set up.
|
|
416
|
-
await cheatCodes.rollup.advanceToEpoch(await cheatCodes.rollup.getEpoch() + BigInt(config.lagInEpochs + 1)
|
|
417
|
-
updateDateProvider: dateProvider
|
|
418
|
-
});
|
|
404
|
+
await cheatCodes.rollup.advanceToEpoch(await cheatCodes.rollup.getEpoch() + BigInt(config.lagInEpochs + 1));
|
|
419
405
|
await cheatCodes.rollup.setupEpoch();
|
|
420
406
|
await cheatCodes.rollup.debugRollup();
|
|
421
407
|
}
|
|
@@ -515,20 +501,6 @@ export async function ensureAccountContractsPublished(wallet, accountsToDeploy)
|
|
|
515
501
|
}).wait();
|
|
516
502
|
}
|
|
517
503
|
// docs:end:public_deploy_accounts
|
|
518
|
-
/**
|
|
519
|
-
* Sets the timestamp of the next block.
|
|
520
|
-
* @param rpcUrl - rpc url of the blockchain instance to connect to
|
|
521
|
-
* @param timestamp - the timestamp for the next block
|
|
522
|
-
*/ export async function setNextBlockTimestamp(rpcUrl, timestamp) {
|
|
523
|
-
const params = `[${timestamp}]`;
|
|
524
|
-
await fetch(rpcUrl, {
|
|
525
|
-
body: `{"jsonrpc":"2.0", "method": "evm_setNextBlockTimestamp", "params": ${params}, "id": 1}`,
|
|
526
|
-
method: 'POST',
|
|
527
|
-
headers: {
|
|
528
|
-
'Content-Type': 'application/json'
|
|
529
|
-
}
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
504
|
/** Returns the job name for the current test. */ function getJobName() {
|
|
533
505
|
return process.env.JOB_NAME ?? expect.getState().currentTestName?.split(' ')[0].replaceAll('/', '_') ?? 'unknown';
|
|
534
506
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AztecAddress, type Logger, type SentTx } from '@aztec/aztec.js';
|
|
2
|
-
import type { TestWallet } from '@aztec/test-wallet';
|
|
2
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
3
3
|
export declare const submitTxsTo: (wallet: TestWallet, submitter: AztecAddress, numTxs: number, logger: Logger) => Promise<SentTx[]>;
|
|
4
4
|
//# sourceMappingURL=submit-transactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,KAAK,MAAM,EAAE,KAAK,MAAM,EAAY,MAAM,iBAAiB,CAAC;AAEvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,KAAK,MAAM,EAAE,KAAK,MAAM,EAAY,MAAM,iBAAiB,CAAC;AAEvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,eAAO,MAAM,WAAW,GACtB,QAAQ,UAAU,EAClB,WAAW,YAAY,EACvB,QAAQ,MAAM,EACd,QAAQ,MAAM,KACb,OAAO,CAAC,MAAM,EAAE,CAqBlB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AztecAddress, type AztecNode, type Logger } from '@aztec/aztec.js';
|
|
2
2
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
3
3
|
import { type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
4
|
-
import type { TestWallet } from '@aztec/test-wallet';
|
|
4
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
5
5
|
/** Objects to be returned by the uniswap setup function */
|
|
6
6
|
export type UniswapSetupContext = {
|
|
7
7
|
/** Aztec Node instance */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAGd,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAI9B,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAGd,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAI9B,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAkB5D,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,kBAAkB;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,yBAAyB;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,0BAA0B;IAC1B,cAAc,EAAE,YAAY,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,OAAO,CAAC,mBAAmB,CAAC,EACzC,SAAS,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,gCAAkC,SAi+BnC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AztecAddress, type AztecNode, type FeePaymentMethod } from '@aztec/aztec.js';
|
|
2
2
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
4
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
5
5
|
export interface TestAccounts {
|
|
6
6
|
aztecNode: AztecNode;
|
|
7
7
|
wallet: TestWallet;
|
|
@@ -12,9 +12,9 @@ export interface TestAccounts {
|
|
|
12
12
|
recipientAddress: AztecAddress;
|
|
13
13
|
tokenAddress: AztecAddress;
|
|
14
14
|
}
|
|
15
|
-
export declare function setupTestAccountsWithTokens(
|
|
15
|
+
export declare function setupTestAccountsWithTokens(nodeUrl: string, mintAmount: bigint, logger: Logger): Promise<TestAccounts>;
|
|
16
16
|
export declare function deploySponsoredTestAccounts(wallet: TestWallet, aztecNode: AztecNode, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
17
|
-
export declare function deployTestAccountsWithTokens(
|
|
17
|
+
export declare function deployTestAccountsWithTokens(nodeUrl: string, l1RpcUrls: string[], mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
18
18
|
export declare function performTransfers({ testAccounts, rounds, transferAmount, logger, feePaymentMethod, }: {
|
|
19
19
|
testAccounts: TestAccounts;
|
|
20
20
|
rounds: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,gBAAgB,EAOtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAMvD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,iBAAiB,EAAE,YAAY,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,YAAY,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,CAAC,CAyBvB;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,YAAY,CAAC,CAqCvB;AAED,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,YAAY,CAAC,CAgDvB;AA+ED,wBAAsB,gBAAgB,CAAC,EACrC,YAAY,EACZ,MAAM,EACN,cAAc,EACd,MAAM,EACN,gBAAgB,GACjB,EAAE;IACD,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,iBAiBA;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAqBrF"}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { generateSchnorrAccounts
|
|
2
|
-
import { FeeJuicePaymentMethodWithClaim, Fr, L1FeeJuicePortalManager, SponsoredFeePaymentMethod, createAztecNodeClient,
|
|
1
|
+
import { generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
2
|
+
import { FeeJuicePaymentMethodWithClaim, Fr, L1FeeJuicePortalManager, SponsoredFeePaymentMethod, createAztecNodeClient, retryUntil } from '@aztec/aztec.js';
|
|
3
3
|
import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
4
4
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
|
-
import {
|
|
6
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
5
|
+
import { registerInitialSandboxAccountsInWallet } from '@aztec/test-wallet';
|
|
6
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
7
7
|
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
8
8
|
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
9
9
|
import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.js';
|
|
10
10
|
const TOKEN_NAME = 'USDC';
|
|
11
11
|
const TOKEN_SYMBOL = 'USD';
|
|
12
12
|
const TOKEN_DECIMALS = 18n;
|
|
13
|
-
export async function setupTestAccountsWithTokens(
|
|
13
|
+
export async function setupTestAccountsWithTokens(nodeUrl, mintAmount, logger) {
|
|
14
14
|
const ACCOUNT_COUNT = 1; // TODO fix this to allow for 16 wallets again
|
|
15
|
-
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
16
15
|
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
17
|
-
const wallet =
|
|
18
|
-
const [recipientAccount, ...accounts] = (await
|
|
16
|
+
const wallet = await TestWallet.create(aztecNode);
|
|
17
|
+
const [recipientAccount, ...accounts] = (await registerInitialSandboxAccountsInWallet(wallet)).slice(0, ACCOUNT_COUNT + 1);
|
|
19
18
|
const tokenAdmin = accounts[0];
|
|
20
|
-
const tokenAddress = await deployTokenAndMint(wallet, accounts
|
|
19
|
+
const tokenAddress = await deployTokenAndMint(wallet, accounts, tokenAdmin, mintAmount, undefined, logger);
|
|
21
20
|
const tokenContract = await TokenContract.at(tokenAddress, wallet);
|
|
22
21
|
return {
|
|
23
22
|
aztecNode,
|
|
24
|
-
accounts
|
|
23
|
+
accounts,
|
|
25
24
|
wallet,
|
|
26
|
-
tokenAdminAddress: tokenAdmin
|
|
25
|
+
tokenAdminAddress: tokenAdmin,
|
|
27
26
|
tokenName: TOKEN_NAME,
|
|
28
27
|
tokenAddress,
|
|
29
28
|
tokenContract,
|
|
30
|
-
recipientAddress: recipientAccount
|
|
29
|
+
recipientAddress: recipientAccount
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
32
|
export async function deploySponsoredTestAccounts(wallet, aztecNode, mintAmount, logger, numberOfFundedWallets = 1) {
|
|
@@ -35,9 +34,16 @@ export async function deploySponsoredTestAccounts(wallet, aztecNode, mintAmount,
|
|
|
35
34
|
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
36
35
|
const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
37
36
|
await registerSponsoredFPC(wallet);
|
|
37
|
+
const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
38
|
+
await recipientAccount.deploy({
|
|
39
|
+
fee: {
|
|
40
|
+
paymentMethod
|
|
41
|
+
}
|
|
42
|
+
}).wait({
|
|
43
|
+
timeout: 2400
|
|
44
|
+
});
|
|
38
45
|
await Promise.all(fundedAccounts.map(async (a)=>{
|
|
39
|
-
|
|
40
|
-
await recipientAccount.deploy({
|
|
46
|
+
await a.deploy({
|
|
41
47
|
fee: {
|
|
42
48
|
paymentMethod
|
|
43
49
|
}
|
|
@@ -60,10 +66,9 @@ export async function deploySponsoredTestAccounts(wallet, aztecNode, mintAmount,
|
|
|
60
66
|
recipientAddress: recipientAccount.getAddress()
|
|
61
67
|
};
|
|
62
68
|
}
|
|
63
|
-
export async function deployTestAccountsWithTokens(
|
|
64
|
-
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
69
|
+
export async function deployTestAccountsWithTokens(nodeUrl, l1RpcUrls, mnemonicOrPrivateKey, mintAmount, logger, numberOfFundedWallets = 1) {
|
|
65
70
|
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
66
|
-
const wallet =
|
|
71
|
+
const wallet = await TestWallet.create(aztecNode);
|
|
67
72
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
68
73
|
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
69
74
|
const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
@@ -171,19 +176,19 @@ export async function createWalletAndAztecNodeClient(nodeUrl, proverEnabled, log
|
|
|
171
176
|
getBBConfig(logger),
|
|
172
177
|
getACVMConfig(logger)
|
|
173
178
|
]);
|
|
174
|
-
const
|
|
179
|
+
const pxeConfig = {
|
|
175
180
|
dataDirectory: undefined,
|
|
176
181
|
dataStoreMapSizeKB: 1024 * 1024,
|
|
177
182
|
...bbConfig,
|
|
178
183
|
...acvmConfig,
|
|
179
184
|
proverEnabled
|
|
180
|
-
}
|
|
181
|
-
const wallet =
|
|
185
|
+
};
|
|
186
|
+
const wallet = await TestWallet.create(aztecNode, pxeConfig);
|
|
182
187
|
return {
|
|
183
188
|
wallet,
|
|
184
189
|
aztecNode,
|
|
185
190
|
async cleanup () {
|
|
186
|
-
await
|
|
191
|
+
await wallet.stop();
|
|
187
192
|
await bbConfig?.cleanup();
|
|
188
193
|
await acvmConfig?.cleanup();
|
|
189
194
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250925",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,42 +25,42 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "3.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
46
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
47
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
48
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
51
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
52
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
53
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
55
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
56
|
-
"@aztec/sequencer-client": "3.0.0-nightly.
|
|
57
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
58
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
59
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
60
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
61
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
62
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
63
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "3.0.0-nightly.20250925",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20250925",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20250925",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20250925",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250925",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250925",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250925",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-nightly.20250925",
|
|
36
|
+
"@aztec/bot": "3.0.0-nightly.20250925",
|
|
37
|
+
"@aztec/cli": "3.0.0-nightly.20250925",
|
|
38
|
+
"@aztec/constants": "3.0.0-nightly.20250925",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250925",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20250925",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-nightly.20250925",
|
|
42
|
+
"@aztec/foundation": "3.0.0-nightly.20250925",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-nightly.20250925",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250925",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20250925",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-nightly.20250925",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250925",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250925",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250925",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250925",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20250925",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250925",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-nightly.20250925",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-nightly.20250925",
|
|
55
|
+
"@aztec/pxe": "3.0.0-nightly.20250925",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20250925",
|
|
57
|
+
"@aztec/simulator": "3.0.0-nightly.20250925",
|
|
58
|
+
"@aztec/slasher": "3.0.0-nightly.20250925",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-nightly.20250925",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20250925",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250925",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-nightly.20250925",
|
|
63
|
+
"@aztec/world-state": "3.0.0-nightly.20250925",
|
|
64
64
|
"@iarna/toml": "^2.2.5",
|
|
65
65
|
"@jest/globals": "^30.0.0",
|
|
66
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -26,9 +26,9 @@ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
|
26
26
|
import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
27
27
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
28
28
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
29
|
-
import { type PXEServiceConfig,
|
|
29
|
+
import { type PXEServiceConfig, getPXEServiceConfig } from '@aztec/pxe/server';
|
|
30
30
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
31
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
31
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
32
32
|
|
|
33
33
|
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
34
34
|
import {
|
|
@@ -201,11 +201,11 @@ export class ClientFlowsBenchmark {
|
|
|
201
201
|
deployAccounts(2, this.logger),
|
|
202
202
|
async (
|
|
203
203
|
{ deployedAccounts: [{ address: adminAddress }, { address: sequencerAddress }] },
|
|
204
|
-
{ wallet, aztecNode,
|
|
204
|
+
{ wallet, aztecNode, cheatCodes },
|
|
205
205
|
) => {
|
|
206
206
|
this.adminWallet = wallet;
|
|
207
207
|
this.aztecNode = aztecNode;
|
|
208
|
-
this.cheatCodes =
|
|
208
|
+
this.cheatCodes = cheatCodes;
|
|
209
209
|
|
|
210
210
|
this.adminAddress = adminAddress;
|
|
211
211
|
this.sequencerAddress = sequencerAddress;
|
|
@@ -215,19 +215,16 @@ export class ClientFlowsBenchmark {
|
|
|
215
215
|
this.coinbase = EthAddress.random();
|
|
216
216
|
|
|
217
217
|
const userPXEConfig = getPXEServiceConfig();
|
|
218
|
-
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
219
218
|
const userPXEConfigWithContracts = {
|
|
220
219
|
...userPXEConfig,
|
|
221
220
|
proverEnabled: this.realProofs,
|
|
222
|
-
l1Contracts,
|
|
223
221
|
} as PXEServiceConfig;
|
|
224
222
|
|
|
225
|
-
this.
|
|
223
|
+
this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
|
|
226
224
|
loggers: {
|
|
227
225
|
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
|
|
228
226
|
},
|
|
229
227
|
});
|
|
230
|
-
this.userWallet = new TestWallet(this.userPXE, this.aztecNode);
|
|
231
228
|
},
|
|
232
229
|
);
|
|
233
230
|
}
|