@aztec/end-to-end 3.0.0-nightly.20250922 → 3.0.0-nightly.20250923

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.
Files changed (61) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.d.ts +0 -1
  2. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/client_flows_benchmark.js +5 -8
  4. package/dest/bench/utils.d.ts +1 -10
  5. package/dest/bench/utils.d.ts.map +1 -1
  6. package/dest/bench/utils.js +0 -25
  7. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -2
  8. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  9. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +1 -3
  10. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +1 -2
  11. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  12. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +6 -8
  13. package/dest/e2e_deploy_contract/deploy_test.d.ts +3 -3
  14. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  15. package/dest/e2e_deploy_contract/deploy_test.js +2 -3
  16. package/dest/e2e_fees/fees_test.d.ts +1 -2
  17. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  18. package/dest/e2e_fees/fees_test.js +5 -8
  19. package/dest/e2e_nested_contract/nested_contract_test.d.ts +1 -2
  20. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  21. package/dest/e2e_nested_contract/nested_contract_test.js +1 -3
  22. package/dest/e2e_p2p/shared.d.ts +2 -1
  23. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  24. package/dest/e2e_p2p/shared.js +5 -3
  25. package/dest/fixtures/e2e_prover_test.d.ts +0 -2
  26. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  27. package/dest/fixtures/e2e_prover_test.js +6 -9
  28. package/dest/fixtures/snapshot_manager.d.ts +0 -2
  29. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  30. package/dest/fixtures/snapshot_manager.js +2 -4
  31. package/dest/fixtures/utils.d.ts +12 -14
  32. package/dest/fixtures/utils.d.ts.map +1 -1
  33. package/dest/fixtures/utils.js +17 -19
  34. package/dest/shared/cross_chain_test_harness.d.ts +2 -6
  35. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  36. package/dest/shared/cross_chain_test_harness.js +3 -5
  37. package/dest/shared/gas_portal_test_harness.d.ts +5 -6
  38. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  39. package/dest/shared/gas_portal_test_harness.js +5 -5
  40. package/dest/shared/uniswap_l1_l2.d.ts +1 -3
  41. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  42. package/dest/shared/uniswap_l1_l2.js +3 -4
  43. package/dest/spartan/setup_test_wallets.d.ts +5 -5
  44. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  45. package/dest/spartan/setup_test_wallets.js +10 -12
  46. package/package.json +37 -37
  47. package/src/bench/client_flows/client_flows_benchmark.ts +4 -8
  48. package/src/bench/utils.ts +1 -28
  49. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -4
  50. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +5 -9
  51. package/src/e2e_deploy_contract/deploy_test.ts +4 -5
  52. package/src/e2e_fees/fees_test.ts +6 -9
  53. package/src/e2e_nested_contract/nested_contract_test.ts +2 -4
  54. package/src/e2e_p2p/shared.ts +6 -2
  55. package/src/fixtures/e2e_prover_test.ts +7 -12
  56. package/src/fixtures/snapshot_manager.ts +3 -6
  57. package/src/fixtures/utils.ts +21 -30
  58. package/src/shared/cross_chain_test_harness.ts +0 -5
  59. package/src/shared/gas_portal_test_harness.ts +4 -6
  60. package/src/shared/uniswap_l1_l2.ts +1 -7
  61. package/src/spartan/setup_test_wallets.ts +10 -15
@@ -15,12 +15,11 @@ export async function setupTestAccountsWithTokens(pxeUrl, nodeUrl, mintAmount, l
15
15
  const pxe = await createCompatibleClient(pxeUrl, logger);
16
16
  const aztecNode = createAztecNodeClient(nodeUrl);
17
17
  const wallet = new TestWallet(pxe, aztecNode);
18
- const [recipientAccount, ...accounts] = (await getDeployedTestAccounts(pxe)).slice(0, ACCOUNT_COUNT + 1);
18
+ const [recipientAccount, ...accounts] = (await getDeployedTestAccounts(wallet)).slice(0, ACCOUNT_COUNT + 1);
19
19
  const tokenAdmin = accounts[0];
20
20
  const tokenAddress = await deployTokenAndMint(wallet, accounts.map((acc)=>acc.address), tokenAdmin.address, mintAmount, undefined, logger);
21
21
  const tokenContract = await TokenContract.at(tokenAddress, wallet);
22
22
  return {
23
- pxe,
24
23
  aztecNode,
25
24
  accounts: accounts.map((acc)=>acc.address),
26
25
  wallet,
@@ -31,8 +30,7 @@ export async function setupTestAccountsWithTokens(pxeUrl, nodeUrl, mintAmount, l
31
30
  recipientAddress: recipientAccount.address
32
31
  };
33
32
  }
34
- export async function deploySponsoredTestAccounts(pxe, aztecNode, mintAmount, logger, numberOfFundedWallets = 1) {
35
- const wallet = new TestWallet(pxe, aztecNode);
33
+ export async function deploySponsoredTestAccounts(wallet, aztecNode, mintAmount, logger, numberOfFundedWallets = 1) {
36
34
  const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
37
35
  const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
38
36
  const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
@@ -52,7 +50,6 @@ export async function deploySponsoredTestAccounts(pxe, aztecNode, mintAmount, lo
52
50
  const tokenAddress = await deployTokenAndMint(wallet, fundedAccounts.map((acc)=>acc.getAddress()), tokenAdmin.getAddress(), mintAmount, new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()), logger);
53
51
  const tokenContract = await TokenContract.at(tokenAddress, wallet);
54
52
  return {
55
- pxe,
56
53
  aztecNode,
57
54
  wallet,
58
55
  accounts: fundedAccounts.map((acc)=>acc.getAddress()),
@@ -70,7 +67,7 @@ export async function deployTestAccountsWithTokens(pxeUrl, nodeUrl, l1RpcUrls, m
70
67
  const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
71
68
  const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
72
69
  const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
73
- const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, aztecNode, a.getAddress(), undefined, logger)));
70
+ const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, aztecNode, a.getAddress(), undefined, logger)));
74
71
  // Progress by 3 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
75
72
  await advanceL2Block(aztecNode);
76
73
  await advanceL2Block(aztecNode);
@@ -88,7 +85,6 @@ export async function deployTestAccountsWithTokens(pxeUrl, nodeUrl, l1RpcUrls, m
88
85
  const tokenAddress = await deployTokenAndMint(wallet, fundedAccounts.map((acc)=>acc.getAddress()), tokenAdmin.getAddress(), mintAmount, undefined, logger);
89
86
  const tokenContract = await TokenContract.at(tokenAddress, wallet);
90
87
  return {
91
- pxe,
92
88
  aztecNode,
93
89
  wallet,
94
90
  accounts: fundedAccounts.map((acc)=>acc.getAddress()),
@@ -99,7 +95,7 @@ export async function deployTestAccountsWithTokens(pxeUrl, nodeUrl, l1RpcUrls, m
99
95
  recipientAddress: recipientAccount.getAddress()
100
96
  };
101
97
  }
102
- async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, aztecNode, recipient, amount, log) {
98
+ async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, aztecNode, recipient, amount, log) {
103
99
  const { l1ChainId } = await aztecNode.getNodeInfo();
104
100
  const chain = createEthereumChain(l1RpcUrls, l1ChainId);
105
101
  const l1Client = createExtendedL1Client(chain.rpcUrls, mnemonicOrPrivateKey, chain.chainInfo);
@@ -169,21 +165,23 @@ export async function performTransfers({ testAccounts, rounds, transferAmount, l
169
165
  logger.info(`Completed round ${i + 1} / ${rounds}`);
170
166
  }
171
167
  }
172
- export async function startCompatiblePXE(nodeUrl, proverEnabled, logger) {
173
- const node = createAztecNodeClient(nodeUrl);
168
+ export async function createWalletAndAztecNodeClient(nodeUrl, proverEnabled, logger) {
169
+ const aztecNode = createAztecNodeClient(nodeUrl);
174
170
  const [bbConfig, acvmConfig] = await Promise.all([
175
171
  getBBConfig(logger),
176
172
  getACVMConfig(logger)
177
173
  ]);
178
- const pxe = await createPXEService(node, {
174
+ const pxe = await createPXEService(aztecNode, {
179
175
  dataDirectory: undefined,
180
176
  dataStoreMapSizeKB: 1024 * 1024,
181
177
  ...bbConfig,
182
178
  ...acvmConfig,
183
179
  proverEnabled
184
180
  });
181
+ const wallet = new TestWallet(pxe, aztecNode);
185
182
  return {
186
- pxe,
183
+ wallet,
184
+ aztecNode,
187
185
  async cleanup () {
188
186
  await pxe.stop();
189
187
  await bbConfig?.cleanup();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "3.0.0-nightly.20250922",
3
+ "version": "3.0.0-nightly.20250923",
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.20250922",
29
- "@aztec/archiver": "3.0.0-nightly.20250922",
30
- "@aztec/aztec": "3.0.0-nightly.20250922",
31
- "@aztec/aztec-node": "3.0.0-nightly.20250922",
32
- "@aztec/aztec.js": "3.0.0-nightly.20250922",
33
- "@aztec/bb-prover": "3.0.0-nightly.20250922",
34
- "@aztec/blob-lib": "3.0.0-nightly.20250922",
35
- "@aztec/blob-sink": "3.0.0-nightly.20250922",
36
- "@aztec/bot": "3.0.0-nightly.20250922",
37
- "@aztec/cli": "3.0.0-nightly.20250922",
38
- "@aztec/constants": "3.0.0-nightly.20250922",
39
- "@aztec/entrypoints": "3.0.0-nightly.20250922",
40
- "@aztec/epoch-cache": "3.0.0-nightly.20250922",
41
- "@aztec/ethereum": "3.0.0-nightly.20250922",
42
- "@aztec/foundation": "3.0.0-nightly.20250922",
43
- "@aztec/kv-store": "3.0.0-nightly.20250922",
44
- "@aztec/l1-artifacts": "3.0.0-nightly.20250922",
45
- "@aztec/merkle-tree": "3.0.0-nightly.20250922",
46
- "@aztec/node-keystore": "3.0.0-nightly.20250922",
47
- "@aztec/noir-contracts.js": "3.0.0-nightly.20250922",
48
- "@aztec/noir-noirc_abi": "3.0.0-nightly.20250922",
49
- "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250922",
50
- "@aztec/noir-test-contracts.js": "3.0.0-nightly.20250922",
51
- "@aztec/p2p": "3.0.0-nightly.20250922",
52
- "@aztec/protocol-contracts": "3.0.0-nightly.20250922",
53
- "@aztec/prover-client": "3.0.0-nightly.20250922",
54
- "@aztec/prover-node": "3.0.0-nightly.20250922",
55
- "@aztec/pxe": "3.0.0-nightly.20250922",
56
- "@aztec/sequencer-client": "3.0.0-nightly.20250922",
57
- "@aztec/simulator": "3.0.0-nightly.20250922",
58
- "@aztec/slasher": "3.0.0-nightly.20250922",
59
- "@aztec/stdlib": "3.0.0-nightly.20250922",
60
- "@aztec/telemetry-client": "3.0.0-nightly.20250922",
61
- "@aztec/test-wallet": "3.0.0-nightly.20250922",
62
- "@aztec/validator-client": "3.0.0-nightly.20250922",
63
- "@aztec/world-state": "3.0.0-nightly.20250922",
28
+ "@aztec/accounts": "3.0.0-nightly.20250923",
29
+ "@aztec/archiver": "3.0.0-nightly.20250923",
30
+ "@aztec/aztec": "3.0.0-nightly.20250923",
31
+ "@aztec/aztec-node": "3.0.0-nightly.20250923",
32
+ "@aztec/aztec.js": "3.0.0-nightly.20250923",
33
+ "@aztec/bb-prover": "3.0.0-nightly.20250923",
34
+ "@aztec/blob-lib": "3.0.0-nightly.20250923",
35
+ "@aztec/blob-sink": "3.0.0-nightly.20250923",
36
+ "@aztec/bot": "3.0.0-nightly.20250923",
37
+ "@aztec/cli": "3.0.0-nightly.20250923",
38
+ "@aztec/constants": "3.0.0-nightly.20250923",
39
+ "@aztec/entrypoints": "3.0.0-nightly.20250923",
40
+ "@aztec/epoch-cache": "3.0.0-nightly.20250923",
41
+ "@aztec/ethereum": "3.0.0-nightly.20250923",
42
+ "@aztec/foundation": "3.0.0-nightly.20250923",
43
+ "@aztec/kv-store": "3.0.0-nightly.20250923",
44
+ "@aztec/l1-artifacts": "3.0.0-nightly.20250923",
45
+ "@aztec/merkle-tree": "3.0.0-nightly.20250923",
46
+ "@aztec/node-keystore": "3.0.0-nightly.20250923",
47
+ "@aztec/noir-contracts.js": "3.0.0-nightly.20250923",
48
+ "@aztec/noir-noirc_abi": "3.0.0-nightly.20250923",
49
+ "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250923",
50
+ "@aztec/noir-test-contracts.js": "3.0.0-nightly.20250923",
51
+ "@aztec/p2p": "3.0.0-nightly.20250923",
52
+ "@aztec/protocol-contracts": "3.0.0-nightly.20250923",
53
+ "@aztec/prover-client": "3.0.0-nightly.20250923",
54
+ "@aztec/prover-node": "3.0.0-nightly.20250923",
55
+ "@aztec/pxe": "3.0.0-nightly.20250923",
56
+ "@aztec/sequencer-client": "3.0.0-nightly.20250923",
57
+ "@aztec/simulator": "3.0.0-nightly.20250923",
58
+ "@aztec/slasher": "3.0.0-nightly.20250923",
59
+ "@aztec/stdlib": "3.0.0-nightly.20250923",
60
+ "@aztec/telemetry-client": "3.0.0-nightly.20250923",
61
+ "@aztec/test-wallet": "3.0.0-nightly.20250923",
62
+ "@aztec/validator-client": "3.0.0-nightly.20250923",
63
+ "@aztec/world-state": "3.0.0-nightly.20250923",
64
64
  "@iarna/toml": "^2.2.5",
65
65
  "@jest/globals": "^30.0.0",
66
66
  "@noble/curves": "=1.0.0",
@@ -57,7 +57,6 @@ export class ClientFlowsBenchmark {
57
57
  private snapshotManager: ISnapshotManager;
58
58
 
59
59
  public logger: Logger;
60
- private pxe!: PXE;
61
60
  public aztecNode!: AztecNode;
62
61
  public cheatCodes!: CheatCodes;
63
62
  public context!: SubsystemsContext;
@@ -202,12 +201,11 @@ export class ClientFlowsBenchmark {
202
201
  deployAccounts(2, this.logger),
203
202
  async (
204
203
  { deployedAccounts: [{ address: adminAddress }, { address: sequencerAddress }] },
205
- { wallet, pxe, aztecNode, aztecNodeConfig },
204
+ { wallet, aztecNode, aztecNodeConfig },
206
205
  ) => {
207
- this.pxe = pxe;
208
206
  this.adminWallet = wallet;
209
207
  this.aztecNode = aztecNode;
210
- this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
208
+ this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode);
211
209
 
212
210
  this.adminAddress = adminAddress;
213
211
  this.sequencerAddress = sequencerAddress;
@@ -246,7 +244,6 @@ export class ClientFlowsBenchmark {
246
244
  this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
247
245
  aztecNode: context.aztecNode,
248
246
  aztecNodeAdmin: context.aztecNode,
249
- pxeService: context.pxe,
250
247
  l1Client: context.deployL1ContractsValues.l1Client,
251
248
  wallet: this.adminWallet,
252
249
  logger: this.logger,
@@ -292,7 +289,7 @@ export class ClientFlowsBenchmark {
292
289
  'fpc_setup',
293
290
  async context => {
294
291
  const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
295
- expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
292
+ expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
296
293
 
297
294
  const bananaCoin = this.bananaCoin;
298
295
  const bananaFPC = await FPCContract.deploy(this.adminWallet, bananaCoin.address, this.adminAddress)
@@ -315,7 +312,7 @@ export class ClientFlowsBenchmark {
315
312
  await this.snapshotManager.snapshot(
316
313
  'deploy_sponsored_fpc',
317
314
  async () => {
318
- const sponsoredFPC = await setupSponsoredFPC(this.pxe);
315
+ const sponsoredFPC = await setupSponsoredFPC(this.adminWallet);
319
316
  this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
320
317
  return { sponsoredFPCAddress: sponsoredFPC.address };
321
318
  },
@@ -337,7 +334,6 @@ export class ClientFlowsBenchmark {
337
334
  this.logger.verbose(`Setting up cross chain harness...`);
338
335
  const crossChainTestHarness = await CrossChainTestHarness.new(
339
336
  this.aztecNode,
340
- this.pxe,
341
337
  l1Client,
342
338
  this.adminWallet,
343
339
  owner,
@@ -1,8 +1,7 @@
1
1
  import type { AztecNodeService } from '@aztec/aztec-node';
2
- import { type AztecNode, BatchCall, type SentTx, type WaitOpts } from '@aztec/aztec.js';
2
+ import { BatchCall, type SentTx, type WaitOpts } from '@aztec/aztec.js';
3
3
  import { mean, stdDev, times } from '@aztec/foundation/collection';
4
4
  import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
5
- import { type PXEService, type PXEServiceConfig, createPXEService } from '@aztec/pxe/server';
6
5
  import type { MetricsType } from '@aztec/telemetry-client';
7
6
  import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
8
7
 
@@ -150,32 +149,6 @@ export async function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitOpt
150
149
  context.logger.info(`All ${txs.length} txs have been mined`);
151
150
  }
152
151
 
153
- /**
154
- * Creates a new PXE
155
- * @param node - Node to connect the pxe to.
156
- * @param contract - Benchmark contract to add to the pxe.
157
- * @param startingBlock - First l2 block to process.
158
- * @returns The new PXE.
159
- */
160
- export async function createNewPXE(node: AztecNode, contract: BenchmarkingContract): Promise<PXEService> {
161
- const l1Contracts = await node.getL1ContractAddresses();
162
- const { l1ChainId, rollupVersion } = await node.getNodeInfo();
163
- const pxeConfig = {
164
- l2BlockBatchSize: 50,
165
- l2BlockPollingIntervalMS: 100,
166
- dataDirectory: undefined,
167
- dataStoreMapSizeKB: 1024 * 1024,
168
- l1Contracts,
169
- l1ChainId,
170
- rollupVersion,
171
- } as PXEServiceConfig;
172
- // docs:start:PXEcreate
173
- const pxe = await createPXEService(node, pxeConfig);
174
- // docs:end:PXEcreate
175
- await pxe.registerContract(contract);
176
- return pxe;
177
- }
178
-
179
152
  function randomBytesAsBigInts(length: number): bigint[] {
180
153
  return [...Array(length)].map(_ => BigInt(Math.floor(Math.random() * 255)));
181
154
  }
@@ -3,7 +3,6 @@ import {
3
3
  type AztecNode,
4
4
  Fr,
5
5
  type Logger,
6
- type PXE,
7
6
  type TxHash,
8
7
  computeSecretHash,
9
8
  createLogger,
@@ -62,7 +61,6 @@ export class BlacklistTokenContractTest {
62
61
  private snapshotManager: ISnapshotManager;
63
62
  logger: Logger;
64
63
  wallet!: TestWallet;
65
- pxe!: PXE;
66
64
  asset!: TokenBlacklistContract;
67
65
  tokenSim!: TokenSimulator;
68
66
  badAccount!: InvalidAccountContract;
@@ -99,8 +97,7 @@ export class BlacklistTokenContractTest {
99
97
  await this.snapshotManager.snapshot(
100
98
  '3_accounts',
101
99
  deployAccounts(3, this.logger),
102
- ({ deployedAccounts }, { pxe, cheatCodes, aztecNode, sequencer, wallet }) => {
103
- this.pxe = pxe;
100
+ ({ deployedAccounts }, { cheatCodes, aztecNode, sequencer, wallet }) => {
104
101
  this.cheatCodes = cheatCodes;
105
102
  this.aztecNode = aztecNode;
106
103
  this.sequencer = sequencer;
@@ -1,5 +1,5 @@
1
1
  import type { AztecNodeConfig } from '@aztec/aztec-node';
2
- import { AztecAddress, type AztecNode, EthAddress, type Logger, type PXE, createLogger } from '@aztec/aztec.js';
2
+ import { AztecAddress, type AztecNode, EthAddress, type Logger, createLogger } from '@aztec/aztec.js';
3
3
  import { CheatCodes } from '@aztec/aztec/testing';
4
4
  import {
5
5
  type DeployL1ContractsArgs,
@@ -33,7 +33,6 @@ export class CrossChainMessagingTest {
33
33
  private snapshotManager: ISnapshotManager;
34
34
  logger: Logger;
35
35
  aztecNode!: AztecNode;
36
- pxe!: PXE;
37
36
  aztecNodeConfig!: AztecNodeConfig;
38
37
  aztecNodeAdmin!: AztecNodeAdmin;
39
38
  ctx!: SubsystemsContext;
@@ -70,9 +69,9 @@ export class CrossChainMessagingTest {
70
69
  async setup() {
71
70
  this.ctx = await this.snapshotManager.setup();
72
71
  this.aztecNode = this.ctx.aztecNode;
73
- this.pxe = this.ctx.pxe;
72
+ this.wallet = this.ctx.wallet;
74
73
  this.aztecNodeConfig = this.ctx.aztecNodeConfig;
75
- this.cheatCodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.pxe, this.aztecNode);
74
+ this.cheatCodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.wallet, this.aztecNode);
76
75
  this.deployL1ContractsValues = this.ctx.deployL1ContractsValues;
77
76
  this.aztecNodeAdmin = this.ctx.aztecNode;
78
77
  }
@@ -88,15 +87,14 @@ export class CrossChainMessagingTest {
88
87
  }
89
88
 
90
89
  async applyBaseSnapshots() {
91
- // Note that we are using the same `pxe`, `aztecNodeConfig` and `aztecNode` across all snapshots.
90
+ // Note that we are using the same `wallet`, `aztecNodeConfig` and `aztecNode` across all snapshots.
92
91
  // This is to not have issues with different networks.
93
92
 
94
93
  await this.snapshotManager.snapshot(
95
94
  '3_accounts',
96
95
  deployAccounts(3, this.logger),
97
- ({ deployedAccounts }, { pxe, wallet, aztecNodeConfig, aztecNode }) => {
96
+ ({ deployedAccounts }, { wallet, aztecNodeConfig, aztecNode }) => {
98
97
  [this.ownerAddress, this.user1Address, this.user2Address] = deployedAccounts.map(a => a.address);
99
- this.pxe = pxe;
100
98
  this.wallet = wallet;
101
99
  this.aztecNode = aztecNode;
102
100
  this.aztecNodeConfig = aztecNodeConfig;
@@ -123,7 +121,6 @@ export class CrossChainMessagingTest {
123
121
  this.logger.verbose(`Setting up cross chain harness...`);
124
122
  this.crossChainTestHarness = await CrossChainTestHarness.new(
125
123
  this.aztecNode,
126
- this.pxe,
127
124
  this.l1Client,
128
125
  this.wallet,
129
126
  this.ownerAddress,
@@ -158,7 +155,6 @@ export class CrossChainMessagingTest {
158
155
 
159
156
  this.crossChainTestHarness = new CrossChainTestHarness(
160
157
  this.aztecNode,
161
- this.pxe,
162
158
  this.logger,
163
159
  this.l2Token,
164
160
  this.l2Bridge,
@@ -5,7 +5,6 @@ import {
5
5
  type ContractBase,
6
6
  Fr,
7
7
  type Logger,
8
- type PXE,
9
8
  type PublicKeys,
10
9
  type Wallet,
11
10
  createLogger,
@@ -13,6 +12,7 @@ import {
13
12
  } from '@aztec/aztec.js';
14
13
  import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
15
14
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
15
+ import type { TestWallet } from '@aztec/test-wallet';
16
16
 
17
17
  import { type ISnapshotManager, createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
18
18
 
@@ -21,8 +21,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
21
21
  export class DeployTest {
22
22
  private snapshotManager: ISnapshotManager;
23
23
  public logger: Logger;
24
- public pxe!: PXE;
25
- public wallet!: Wallet;
24
+ public wallet!: TestWallet;
26
25
  public defaultAccountAddress!: AztecAddress;
27
26
  public aztecNode!: AztecNode;
28
27
  public aztecNodeAdmin!: AztecNodeAdmin;
@@ -35,7 +34,7 @@ export class DeployTest {
35
34
  async setup() {
36
35
  await this.applyInitialAccountSnapshot();
37
36
  const context = await this.snapshotManager.setup();
38
- ({ pxe: this.pxe, aztecNode: this.aztecNode, wallet: this.wallet } = context);
37
+ ({ aztecNode: this.aztecNode, wallet: this.wallet } = context);
39
38
  this.aztecNodeAdmin = context.aztecNode;
40
39
  return this;
41
40
  }
@@ -75,7 +74,7 @@ export class DeployTest {
75
74
  }
76
75
 
77
76
  async registerRandomAccount(): Promise<AztecAddress> {
78
- const completeAddress = await this.pxe.registerAccount(Fr.random(), Fr.random());
77
+ const completeAddress = await this.wallet.registerAccount(Fr.random(), Fr.random());
79
78
  return completeAddress.address;
80
79
  }
81
80
  }
@@ -1,5 +1,5 @@
1
1
  import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
2
- import { type AztecAddress, type AztecNode, type Logger, type PXE, createLogger, sleep } from '@aztec/aztec.js';
2
+ import { type AztecAddress, type AztecNode, type Logger, createLogger, sleep } from '@aztec/aztec.js';
3
3
  import { CheatCodes } from '@aztec/aztec/testing';
4
4
  import { type DeployL1ContractsArgs, RollupContract, createExtendedL1Client } from '@aztec/ethereum';
5
5
  import { ChainMonitor } from '@aztec/ethereum/test';
@@ -52,7 +52,6 @@ export class FeesTest {
52
52
  private accounts: AztecAddress[] = [];
53
53
 
54
54
  public logger: Logger;
55
- public pxe!: PXE;
56
55
  public aztecNode!: AztecNode;
57
56
  public cheatCodes!: CheatCodes;
58
57
 
@@ -183,12 +182,11 @@ export class FeesTest {
183
182
  await this.snapshotManager.snapshot(
184
183
  'initial_accounts',
185
184
  deployAccounts(this.numberOfAccounts, this.logger),
186
- async ({ deployedAccounts }, { wallet, pxe, aztecNode, aztecNodeConfig }) => {
187
- this.pxe = pxe;
185
+ async ({ deployedAccounts }, { wallet, aztecNode, aztecNodeConfig }) => {
188
186
  this.wallet = wallet;
189
187
  this.aztecNode = aztecNode;
190
188
  this.gasSettings = GasSettings.default({ maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2) });
191
- this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
189
+ this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode);
192
190
  this.accounts = deployedAccounts.map(a => a.address);
193
191
  this.accounts.forEach((a, i) => this.logger.verbose(`Account ${i} address: ${a}`));
194
192
  [this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
@@ -238,7 +236,6 @@ export class FeesTest {
238
236
  this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
239
237
  aztecNode: context.aztecNode,
240
238
  aztecNodeAdmin: context.aztecNode,
241
- pxeService: context.pxe,
242
239
  l1Client: context.deployL1ContractsValues.l1Client,
243
240
  wallet: this.wallet,
244
241
  logger: this.logger,
@@ -281,7 +278,7 @@ export class FeesTest {
281
278
  'fpc_setup',
282
279
  async context => {
283
280
  const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
284
- expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
281
+ expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
285
282
 
286
283
  const bananaCoin = this.bananaCoin;
287
284
  const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin)
@@ -349,9 +346,9 @@ export class FeesTest {
349
346
  'sponsored_fpc_setup',
350
347
  async context => {
351
348
  const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
352
- expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
349
+ expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
353
350
 
354
- const sponsoredFPC = await setupSponsoredFPC(context.pxe);
351
+ const sponsoredFPC = await setupSponsoredFPC(this.wallet);
355
352
  this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
356
353
 
357
354
  return {
@@ -1,4 +1,4 @@
1
- import { AztecAddress, type AztecNode, type Logger, type PXE, type Wallet, createLogger } from '@aztec/aztec.js';
1
+ import { AztecAddress, type AztecNode, type Logger, type Wallet, createLogger } from '@aztec/aztec.js';
2
2
  import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
3
3
  import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
4
4
 
@@ -17,7 +17,6 @@ export class NestedContractTest {
17
17
  logger: Logger;
18
18
  wallet!: Wallet;
19
19
  defaultAccountAddress!: AztecAddress;
20
- pxe!: PXE;
21
20
  aztecNode!: AztecNode;
22
21
 
23
22
  parentContract!: ParentContract;
@@ -40,10 +39,9 @@ export class NestedContractTest {
40
39
  await this.snapshotManager.snapshot(
41
40
  'accounts',
42
41
  deployAccounts(this.numberOfAccounts, this.logger),
43
- ({ deployedAccounts }, { pxe, wallet, aztecNode }) => {
42
+ ({ deployedAccounts }, { wallet, aztecNode }) => {
44
43
  this.wallet = wallet;
45
44
  [{ address: this.defaultAccountAddress }] = deployedAccounts;
46
- this.pxe = pxe;
47
45
  this.aztecNode = aztecNode;
48
46
  return Promise.resolve();
49
47
  },
@@ -13,6 +13,7 @@ import {
13
13
  import type { RollupCheatCodes } from '@aztec/aztec/testing';
14
14
  import type { EmpireSlashingProposerContract, RollupContract, TallySlashingProposerContract } from '@aztec/ethereum';
15
15
  import { timesAsync, unique } from '@aztec/foundation/collection';
16
+ import { pluralize } from '@aztec/foundation/string';
16
17
  import type { TestDateProvider } from '@aztec/foundation/timer';
17
18
  import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
18
19
  import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
@@ -157,17 +158,20 @@ export async function awaitOffenseDetected({
157
158
  nodeAdmin,
158
159
  slashingRoundSize,
159
160
  epochDuration,
161
+ waitUntilOffenseCount,
160
162
  }: {
161
163
  nodeAdmin: AztecNodeAdmin;
162
164
  logger: Logger;
163
165
  slashingRoundSize: number;
164
166
  epochDuration: number;
167
+ waitUntilOffenseCount?: number;
165
168
  }) {
166
- logger.info(`Waiting for an offense to be detected`);
169
+ const targetOffenseCount = waitUntilOffenseCount ?? 1;
170
+ logger.warn(`Waiting for ${pluralize('offense', targetOffenseCount)} to be detected`);
167
171
  const offenses = await retryUntil(
168
172
  async () => {
169
173
  const offenses = await nodeAdmin.getSlashOffenses('all');
170
- if (offenses.length > 0) {
174
+ if (offenses.length >= targetOffenseCount) {
171
175
  return offenses;
172
176
  }
173
177
  },
@@ -1,6 +1,6 @@
1
1
  import type { InitialAccountData } from '@aztec/accounts/testing';
2
2
  import { type Archiver, createArchiver } from '@aztec/archiver';
3
- import { AztecAddress, type AztecNode, EthAddress, type Logger, type PXE, createLogger } from '@aztec/aztec.js';
3
+ import { AztecAddress, type AztecNode, EthAddress, type Logger, createLogger } from '@aztec/aztec.js';
4
4
  import { CheatCodes } from '@aztec/aztec/testing';
5
5
  import {
6
6
  BBCircuitVerifier,
@@ -16,7 +16,6 @@ import { SecretValue } from '@aztec/foundation/config';
16
16
  import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
17
17
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
18
18
  import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
19
- import type { PXEService } from '@aztec/pxe/server';
20
19
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
21
20
  import { TestWallet } from '@aztec/test-wallet';
22
21
  import { getGenesisValues } from '@aztec/world-state/testing';
@@ -34,12 +33,12 @@ import {
34
33
  deployAccounts,
35
34
  publicDeployAccounts,
36
35
  } from './snapshot_manager.js';
37
- import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from './utils.js';
36
+ import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEServiceAndGetWallet } from './utils.js';
38
37
 
39
38
  const { E2E_DATA_PATH: dataPath } = process.env;
40
39
 
41
40
  type ProvenSetup = {
42
- pxe: PXE;
41
+ wallet: TestWallet;
43
42
  teardown: () => Promise<void>;
44
43
  };
45
44
 
@@ -63,7 +62,6 @@ export class FullProverTest {
63
62
  tokenSim!: TokenSimulator;
64
63
  aztecNode!: AztecNode;
65
64
  aztecNodeAdmin!: AztecNodeAdmin;
66
- pxe!: PXEService;
67
65
  cheatCodes!: CheatCodes;
68
66
  blobSink!: BlobSinkServer;
69
67
  private provenComponents: ProvenSetup[] = [];
@@ -161,7 +159,6 @@ export class FullProverTest {
161
159
 
162
160
  this.simulatedProverNode = this.context.proverNode!;
163
161
  ({
164
- pxe: this.pxe,
165
162
  aztecNode: this.aztecNode,
166
163
  deployL1ContractsValues: this.l1Contracts,
167
164
  cheatCodes: this.cheatCodes,
@@ -211,7 +208,7 @@ export class FullProverTest {
211
208
 
212
209
  this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
213
210
  for (let i = 0; i < 2; i++) {
214
- const result = await setupPXEService(
211
+ const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEServiceAndGetWallet(
215
212
  this.aztecNode,
216
213
  {
217
214
  proverEnabled: this.realProofs,
@@ -222,9 +219,7 @@ export class FullProverTest {
222
219
  true,
223
220
  );
224
221
  this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
225
- await result.pxe.registerContract(this.fakeProofsAsset);
226
-
227
- const provenWallet = new TestWallet(result.pxe, this.aztecNode);
222
+ await provenWallet.registerContract(this.fakeProofsAsset);
228
223
 
229
224
  for (let i = 0; i < 2; i++) {
230
225
  await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
@@ -233,8 +228,8 @@ export class FullProverTest {
233
228
 
234
229
  const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
235
230
  this.provenComponents.push({
236
- pxe: result.pxe,
237
- teardown: result.teardown,
231
+ wallet: provenWallet,
232
+ teardown: provenTeardown,
238
233
  });
239
234
  this.provenAssets.push(asset);
240
235
  }
@@ -31,7 +31,7 @@ import { createLogger } from '@aztec/foundation/log';
31
31
  import { resolver, reviver } from '@aztec/foundation/serialize';
32
32
  import { TestDateProvider } from '@aztec/foundation/timer';
33
33
  import type { ProverNode } from '@aztec/prover-node';
34
- import { type PXEService, createPXEService, getPXEServiceConfig } from '@aztec/pxe/server';
34
+ import { createPXEService, getPXEServiceConfig } from '@aztec/pxe/server';
35
35
  import type { SequencerClient } from '@aztec/sequencer-client';
36
36
  import { tryStop } from '@aztec/stdlib/interfaces/server';
37
37
  import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
@@ -68,7 +68,6 @@ export type SubsystemsContext = {
68
68
  bbConfig: any;
69
69
  aztecNode: AztecNodeService;
70
70
  aztecNodeConfig: AztecNodeConfig;
71
- pxe: PXEService;
72
71
  wallet: TestWallet;
73
72
  deployL1ContractsValues: DeployL1ContractsReturnType;
74
73
  proverNode?: ProverNode;
@@ -449,7 +448,7 @@ async function setupFromFresh(
449
448
  pxeConfig.proverEnabled = !!opts.realProofs;
450
449
  const pxe = await createPXEService(aztecNode, pxeConfig);
451
450
  const wallet = new TestWallet(pxe, aztecNode);
452
- const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
451
+ const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode);
453
452
 
454
453
  if (statePath) {
455
454
  writeFileSync(`${statePath}/aztec_node_config.json`, JSON.stringify(aztecNodeConfig, resolver));
@@ -460,7 +459,6 @@ async function setupFromFresh(
460
459
  aztecNodeConfig,
461
460
  anvil,
462
461
  aztecNode,
463
- pxe,
464
462
  wallet,
465
463
  sequencer: aztecNode.getSequencer()!,
466
464
  acvmConfig,
@@ -578,13 +576,12 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
578
576
  pxeConfig.dataDirectory = statePath;
579
577
  const pxe = await createPXEService(aztecNode, pxeConfig);
580
578
  const wallet = new TestWallet(pxe, aztecNode);
581
- const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
579
+ const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode);
582
580
 
583
581
  return {
584
582
  aztecNodeConfig,
585
583
  anvil,
586
584
  aztecNode,
587
- pxe,
588
585
  wallet,
589
586
  sequencer: aztecNode.getSequencer()!,
590
587
  acvmConfig,