@aztec/end-to-end 3.0.0-canary.a9708bd → 3.0.0-manual.20251030

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 (139) hide show
  1. package/dest/bench/client_flows/benchmark.d.ts +3 -2
  2. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/benchmark.js +2 -2
  4. package/dest/bench/client_flows/client_flows_benchmark.d.ts +16 -12
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  6. package/dest/bench/client_flows/client_flows_benchmark.js +54 -58
  7. package/dest/bench/client_flows/data_extractor.js +3 -3
  8. package/dest/bench/utils.d.ts +2 -11
  9. package/dest/bench/utils.d.ts.map +1 -1
  10. package/dest/bench/utils.js +10 -34
  11. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +7 -7
  12. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  13. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +42 -42
  14. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +10 -8
  15. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  16. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +31 -33
  17. package/dest/e2e_deploy_contract/deploy_test.d.ts +10 -4
  18. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  19. package/dest/e2e_deploy_contract/deploy_test.js +9 -18
  20. package/dest/e2e_epochs/epochs_test.d.ts +9 -3
  21. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  22. package/dest/e2e_epochs/epochs_test.js +19 -13
  23. package/dest/e2e_fees/bridging_race.notest.js +12 -9
  24. package/dest/e2e_fees/fees_test.d.ts +5 -5
  25. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  26. package/dest/e2e_fees/fees_test.js +26 -33
  27. package/dest/e2e_l1_publisher/write_json.d.ts +3 -1
  28. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  29. package/dest/e2e_l1_publisher/write_json.js +5 -5
  30. package/dest/e2e_multi_validator/utils.d.ts +1 -1
  31. package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
  32. package/dest/e2e_multi_validator/utils.js +3 -9
  33. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -3
  34. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  35. package/dest/e2e_nested_contract/nested_contract_test.js +7 -9
  36. package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
  37. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
  38. package/dest/e2e_p2p/inactivity_slash_test.js +135 -0
  39. package/dest/e2e_p2p/p2p_network.d.ts +22 -8
  40. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  41. package/dest/e2e_p2p/p2p_network.js +36 -15
  42. package/dest/e2e_p2p/shared.d.ts +12 -13
  43. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  44. package/dest/e2e_p2p/shared.js +54 -54
  45. package/dest/e2e_token_contract/token_contract_test.d.ts +5 -4
  46. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  47. package/dest/e2e_token_contract/token_contract_test.js +14 -17
  48. package/dest/fixtures/e2e_prover_test.d.ts +8 -6
  49. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  50. package/dest/fixtures/e2e_prover_test.js +42 -51
  51. package/dest/fixtures/get_acvm_config.d.ts +1 -1
  52. package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
  53. package/dest/fixtures/get_bb_config.d.ts +1 -1
  54. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  55. package/dest/fixtures/get_bb_config.js +2 -2
  56. package/dest/fixtures/setup_l1_contracts.d.ts +1 -1
  57. package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
  58. package/dest/fixtures/setup_l1_contracts.js +2 -2
  59. package/dest/fixtures/setup_p2p_test.d.ts +10 -9
  60. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  61. package/dest/fixtures/setup_p2p_test.js +38 -20
  62. package/dest/fixtures/snapshot_manager.d.ts +10 -7
  63. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  64. package/dest/fixtures/snapshot_manager.js +60 -47
  65. package/dest/fixtures/token_utils.d.ts +6 -4
  66. package/dest/fixtures/token_utils.d.ts.map +1 -1
  67. package/dest/fixtures/token_utils.js +11 -15
  68. package/dest/fixtures/utils.d.ts +26 -28
  69. package/dest/fixtures/utils.d.ts.map +1 -1
  70. package/dest/fixtures/utils.js +83 -109
  71. package/dest/fixtures/web3signer.d.ts +5 -0
  72. package/dest/fixtures/web3signer.d.ts.map +1 -0
  73. package/dest/fixtures/web3signer.js +53 -0
  74. package/dest/quality_of_service/alert_checker.d.ts +1 -1
  75. package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
  76. package/dest/shared/cross_chain_test_harness.d.ts +16 -10
  77. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  78. package/dest/shared/cross_chain_test_harness.js +13 -15
  79. package/dest/shared/gas_portal_test_harness.d.ts +9 -6
  80. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  81. package/dest/shared/gas_portal_test_harness.js +10 -7
  82. package/dest/shared/jest_setup.js +1 -1
  83. package/dest/shared/submit-transactions.d.ts +5 -3
  84. package/dest/shared/submit-transactions.d.ts.map +1 -1
  85. package/dest/shared/submit-transactions.js +8 -7
  86. package/dest/shared/uniswap_l1_l2.d.ts +9 -6
  87. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  88. package/dest/shared/uniswap_l1_l2.js +29 -45
  89. package/dest/simulators/lending_simulator.d.ts +2 -1
  90. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  91. package/dest/simulators/lending_simulator.js +3 -2
  92. package/dest/simulators/token_simulator.d.ts +3 -1
  93. package/dest/simulators/token_simulator.d.ts.map +1 -1
  94. package/dest/simulators/token_simulator.js +2 -2
  95. package/dest/spartan/setup_test_wallets.d.ts +19 -13
  96. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  97. package/dest/spartan/setup_test_wallets.js +108 -85
  98. package/dest/spartan/utils.d.ts +68 -3
  99. package/dest/spartan/utils.d.ts.map +1 -1
  100. package/dest/spartan/utils.js +312 -49
  101. package/package.json +39 -38
  102. package/src/bench/client_flows/benchmark.ts +8 -8
  103. package/src/bench/client_flows/client_flows_benchmark.ts +62 -82
  104. package/src/bench/client_flows/data_extractor.ts +4 -4
  105. package/src/bench/utils.ts +9 -37
  106. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +46 -63
  107. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +33 -47
  108. package/src/e2e_deploy_contract/deploy_test.ts +17 -35
  109. package/src/e2e_epochs/epochs_test.ts +22 -19
  110. package/src/e2e_fees/bridging_race.notest.ts +14 -9
  111. package/src/e2e_fees/fees_test.ts +29 -40
  112. package/src/e2e_l1_publisher/write_json.ts +8 -6
  113. package/src/e2e_multi_validator/utils.ts +4 -10
  114. package/src/e2e_nested_contract/nested_contract_test.ts +11 -10
  115. package/src/e2e_p2p/inactivity_slash_test.ts +178 -0
  116. package/src/e2e_p2p/p2p_network.ts +110 -71
  117. package/src/e2e_p2p/shared.ts +57 -56
  118. package/src/e2e_token_contract/token_contract_test.ts +17 -17
  119. package/src/fixtures/e2e_prover_test.ts +52 -88
  120. package/src/fixtures/get_acvm_config.ts +1 -1
  121. package/src/fixtures/get_bb_config.ts +3 -2
  122. package/src/fixtures/setup_l1_contracts.ts +3 -3
  123. package/src/fixtures/setup_p2p_test.ts +60 -27
  124. package/src/fixtures/snapshot_manager.ts +80 -72
  125. package/src/fixtures/token_utils.ts +13 -21
  126. package/src/fixtures/utils.ts +95 -145
  127. package/src/fixtures/web3signer.ts +63 -0
  128. package/src/guides/up_quick_start.sh +2 -10
  129. package/src/quality_of_service/alert_checker.ts +1 -1
  130. package/src/shared/cross_chain_test_harness.ts +18 -29
  131. package/src/shared/gas_portal_test_harness.ts +12 -19
  132. package/src/shared/jest_setup.ts +1 -1
  133. package/src/shared/submit-transactions.ts +12 -8
  134. package/src/shared/uniswap_l1_l2.ts +61 -67
  135. package/src/simulators/lending_simulator.ts +3 -2
  136. package/src/simulators/token_simulator.ts +5 -2
  137. package/src/spartan/DEVELOP.md +8 -3
  138. package/src/spartan/setup_test_wallets.ts +133 -126
  139. package/src/spartan/utils.ts +373 -48
@@ -1,28 +1,23 @@
1
- import { getSchnorrAccount } from '@aztec/accounts/schnorr';
2
1
  import type { InitialAccountData } from '@aztec/accounts/testing';
3
2
  import type { AztecNodeService } from '@aztec/aztec-node';
4
- import {
5
- AztecAddress,
6
- Fr,
7
- type Logger,
8
- ProvenTx,
9
- type SentTx,
10
- TxStatus,
11
- getContractInstanceFromInstantiationParams,
12
- retryUntil,
13
- } from '@aztec/aztec.js';
3
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
4
+ import { type SentTx, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
5
+ import { Fr } from '@aztec/aztec.js/fields';
6
+ import type { Logger } from '@aztec/aztec.js/log';
7
+ import { Tx, TxStatus } from '@aztec/aztec.js/tx';
14
8
  import type { RollupCheatCodes } from '@aztec/aztec/testing';
15
9
  import type { EmpireSlashingProposerContract, RollupContract, TallySlashingProposerContract } from '@aztec/ethereum';
16
10
  import { timesAsync, unique } from '@aztec/foundation/collection';
17
- import type { TestDateProvider } from '@aztec/foundation/timer';
11
+ import { retryUntil } from '@aztec/foundation/retry';
12
+ import { pluralize } from '@aztec/foundation/string';
18
13
  import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
19
14
  import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
20
- import { PXEService, createPXEService, getPXEServiceConfig as getRpcConfig } from '@aztec/pxe/server';
15
+ import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
21
16
  import { getRoundForOffense } from '@aztec/slasher';
22
17
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
23
18
  import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
19
+ import { TestWallet, proveInteraction } from '@aztec/test-wallet/server';
24
20
 
25
- import type { NodeContext } from '../fixtures/setup_p2p_test.js';
26
21
  import { submitTxsTo } from '../shared/submit-transactions.js';
27
22
 
28
23
  // submits a set of transactions to the provided Private eXecution Environment (PXE)
@@ -55,56 +50,46 @@ export const submitComplexTxsTo = async (
55
50
  return txs;
56
51
  };
57
52
 
58
- // creates an instance of the PXE and submit a given number of transactions to it.
59
- export const createPXEServiceAndSubmitTransactions = async (
53
+ // creates a wallet and submit a given number of transactions through it.
54
+ export const submitTransactions = async (
60
55
  logger: Logger,
61
56
  node: AztecNodeService,
62
57
  numTxs: number,
63
58
  fundedAccount: InitialAccountData,
64
- ): Promise<NodeContext> => {
59
+ ): Promise<SentTx[]> => {
65
60
  const rpcConfig = getRpcConfig();
66
61
  rpcConfig.proverEnabled = false;
67
- const pxeService = await createPXEService(node, rpcConfig, { useLogSuffix: true });
68
-
69
- const account = await getSchnorrAccount(
70
- pxeService,
71
- fundedAccount.secret,
72
- fundedAccount.signingKey,
73
- fundedAccount.salt,
74
- );
75
- await account.register();
76
- const wallet = await account.getWallet();
77
-
78
- const txs = await submitTxsTo(pxeService, numTxs, wallet, logger);
79
- return { txs, pxeService, node };
62
+ const wallet = await TestWallet.create(node, { ...getPXEConfig(), proverEnabled: false }, { useLogSuffix: true });
63
+ const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
64
+ return submitTxsTo(wallet, fundedAccountManager.address, numTxs, logger);
80
65
  };
81
66
 
82
- export async function createPXEServiceAndPrepareTransactions(
67
+ export async function prepareTransactions(
83
68
  logger: Logger,
84
69
  node: AztecNodeService,
85
70
  numTxs: number,
86
71
  fundedAccount: InitialAccountData,
87
- ): Promise<{ pxeService: PXEService; txs: ProvenTx[]; node: AztecNodeService }> {
72
+ ): Promise<Tx[]> {
88
73
  const rpcConfig = getRpcConfig();
89
74
  rpcConfig.proverEnabled = false;
90
- const pxe = await createPXEService(node, rpcConfig, { useLogSuffix: true });
91
75
 
92
- const account = await getSchnorrAccount(pxe, fundedAccount.secret, fundedAccount.signingKey, fundedAccount.salt);
93
- await account.register();
94
- const wallet = await account.getWallet();
76
+ const wallet = await TestWallet.create(node, { ...getPXEConfig(), proverEnabled: false }, { useLogSuffix: true });
77
+ const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
95
78
 
96
- const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {});
97
- await wallet.registerContract({ instance: testContractInstance, artifact: TestContractArtifact });
79
+ const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
80
+ salt: Fr.random(),
81
+ });
82
+ await wallet.registerContract(testContractInstance, TestContractArtifact);
98
83
  const contract = await TestContract.at(testContractInstance.address, wallet);
99
84
 
100
- const txs = await timesAsync(numTxs, async () => {
101
- const tx = await contract.methods.emit_nullifier(Fr.random()).prove({ from: account.getAddress() });
85
+ return timesAsync(numTxs, async () => {
86
+ const tx = await proveInteraction(wallet, contract.methods.emit_nullifier(Fr.random()), {
87
+ from: fundedAccountManager.address,
88
+ });
102
89
  const txHash = tx.getTxHash();
103
90
  logger.info(`Tx prepared with hash ${txHash}`);
104
91
  return tx;
105
92
  });
106
-
107
- return { txs, pxeService: pxe, node };
108
93
  }
109
94
 
110
95
  export function awaitProposalExecution(
@@ -164,26 +149,31 @@ export async function awaitOffenseDetected({
164
149
  nodeAdmin,
165
150
  slashingRoundSize,
166
151
  epochDuration,
152
+ waitUntilOffenseCount,
153
+ timeoutSeconds = 120,
167
154
  }: {
168
155
  nodeAdmin: AztecNodeAdmin;
169
156
  logger: Logger;
170
157
  slashingRoundSize: number;
171
158
  epochDuration: number;
159
+ waitUntilOffenseCount?: number;
160
+ timeoutSeconds?: number;
172
161
  }) {
173
- logger.info(`Waiting for an offense to be detected`);
162
+ const targetOffenseCount = waitUntilOffenseCount ?? 1;
163
+ logger.warn(`Waiting for ${pluralize('offense', targetOffenseCount)} to be detected`);
174
164
  const offenses = await retryUntil(
175
165
  async () => {
176
166
  const offenses = await nodeAdmin.getSlashOffenses('all');
177
- if (offenses.length > 0) {
167
+ if (offenses.length >= targetOffenseCount) {
178
168
  return offenses;
179
169
  }
180
170
  },
181
171
  'non-empty offenses',
182
- 60,
172
+ timeoutSeconds,
183
173
  );
184
174
  logger.info(
185
175
  `Hit ${offenses.length} offenses on rounds ${unique(offenses.map(o => getRoundForOffense(o, { slashingRoundSize, epochDuration })))}`,
186
- offenses,
176
+ { offenses },
187
177
  );
188
178
  return offenses;
189
179
  }
@@ -200,8 +190,9 @@ export async function awaitCommitteeKicked({
200
190
  slashingProposer,
201
191
  slashingRoundSize,
202
192
  aztecSlotDuration,
193
+ aztecEpochDuration,
203
194
  logger,
204
- dateProvider,
195
+ offenseEpoch,
205
196
  }: {
206
197
  rollup: RollupContract;
207
198
  cheatCodes: RollupCheatCodes;
@@ -210,20 +201,22 @@ export async function awaitCommitteeKicked({
210
201
  slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
211
202
  slashingRoundSize: number;
212
203
  aztecSlotDuration: number;
213
- dateProvider: TestDateProvider;
204
+ aztecEpochDuration: number;
214
205
  logger: Logger;
206
+ offenseEpoch: number;
215
207
  }) {
216
208
  if (!slashingProposer) {
217
209
  throw new Error('No slashing proposer configured. Cannot test slashing.');
218
210
  }
219
211
 
220
- logger.info(`Advancing epochs so we start slashing`);
221
212
  await cheatCodes.debugRollup();
222
- await cheatCodes.advanceToNextEpoch({ updateDateProvider: dateProvider });
223
- await cheatCodes.advanceToNextEpoch({ updateDateProvider: dateProvider });
224
213
 
225
- // Await for the slash payload to be created if empire (no payload is created on tally until execution time)
226
214
  if (slashingProposer.type === 'empire') {
215
+ // Await for the slash payload to be created if empire (no payload is created on tally until execution time)
216
+ const targetEpoch = (await cheatCodes.getEpoch()) + (await rollup.getLagInEpochs()) + 1n;
217
+ logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
218
+ await cheatCodes.advanceToEpoch(targetEpoch);
219
+
227
220
  const slashPayloadEvents = await retryUntil(
228
221
  async () => {
229
222
  const events = await slashFactory.getSlashPayloadCreatedEvents();
@@ -238,6 +231,15 @@ export async function awaitCommitteeKicked({
238
231
  expect(unique(slashPayloadEvents[0].slashes.map(slash => slash.validator.toString()))).toHaveLength(
239
232
  committee.length,
240
233
  );
234
+ } else {
235
+ // Use the slash offset to ensure we are in the right epoch for tally
236
+ const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
237
+ const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
238
+ const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
239
+ const firstEpochInOffenseRound = offenseEpoch - (offenseEpoch % slashingRoundSizeInEpochs);
240
+ const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
241
+ logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
242
+ await cheatCodes.advanceToEpoch(targetEpoch, { offset: -aztecSlotDuration / 2 });
241
243
  }
242
244
 
243
245
  const attestersPre = await rollup.getAttesters();
@@ -248,7 +250,7 @@ export async function awaitCommitteeKicked({
248
250
  expect(attesterInfo.status).toEqual(1); // Validating
249
251
  }
250
252
 
251
- const timeout = slashingRoundSize * 2 * aztecSlotDuration;
253
+ const timeout = slashingRoundSize * 2 * aztecSlotDuration + 30;
252
254
  logger.info(`Waiting for slash to be executed (timeout ${timeout}s)`);
253
255
  await awaitProposalExecution(slashingProposer, timeout, logger);
254
256
 
@@ -265,10 +267,9 @@ export async function awaitCommitteeKicked({
265
267
  expect(attesterInfo.status).toEqual(2); // Living
266
268
  }
267
269
 
268
- logger.info(`Advancing two epochs to check current committee`);
270
+ logger.info(`Advancing to check current committee`);
269
271
  await cheatCodes.debugRollup();
270
- await cheatCodes.advanceToNextEpoch({ updateDateProvider: dateProvider });
271
- await cheatCodes.advanceToNextEpoch({ updateDateProvider: dateProvider });
272
+ await cheatCodes.advanceToEpoch((await cheatCodes.getEpoch()) + (await rollup.getLagInEpochs()) + 1n);
272
273
  await cheatCodes.debugRollup();
273
274
 
274
275
  const committeeNextEpoch = await rollup.getCurrentEpochCommittee();
@@ -1,7 +1,9 @@
1
- import { getSchnorrWallet } from '@aztec/accounts/schnorr';
2
- import { type AccountWallet, AztecAddress, type AztecNode, type Logger, createLogger } from '@aztec/aztec.js';
1
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import { type Logger, createLogger } from '@aztec/aztec.js/log';
3
+ import type { AztecNode } from '@aztec/aztec.js/node';
3
4
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
4
5
  import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
6
+ import type { TestWallet } from '@aztec/test-wallet/server';
5
7
 
6
8
  import { jest } from '@jest/globals';
7
9
 
@@ -28,11 +30,9 @@ export class TokenContractTest {
28
30
  node!: AztecNode;
29
31
 
30
32
  badAccount!: InvalidAccountContract;
31
- admin!: AccountWallet;
33
+ wallet!: TestWallet;
32
34
  adminAddress!: AztecAddress;
33
- account1!: AccountWallet;
34
35
  account1Address!: AztecAddress;
35
- account2!: AccountWallet;
36
36
  account2Address!: AztecAddress;
37
37
 
38
38
  constructor(testName: string) {
@@ -54,11 +54,11 @@ export class TokenContractTest {
54
54
  await this.snapshotManager.snapshot(
55
55
  '3_accounts',
56
56
  deployAccounts(3, this.logger),
57
- async ({ deployedAccounts }, { pxe, aztecNode }) => {
57
+ ({ deployedAccounts }, { wallet, aztecNode }) => {
58
58
  this.node = aztecNode;
59
- const wallets = await Promise.all(deployedAccounts.map(a => getSchnorrWallet(pxe, a.address, a.signingKey)));
60
- [this.admin, this.account1, this.account2] = wallets;
61
- [this.adminAddress, this.account1Address, this.account2Address] = wallets.map(w => w.getAddress());
59
+ this.wallet = wallet;
60
+ [this.adminAddress, this.account1Address, this.account2Address] = deployedAccounts.map(acc => acc.address);
61
+ return Promise.resolve();
62
62
  },
63
63
  );
64
64
 
@@ -68,11 +68,11 @@ export class TokenContractTest {
68
68
  // Create the token contract state.
69
69
  // Move this account thing to addAccounts above?
70
70
  this.logger.verbose(`Public deploy accounts...`);
71
- await publicDeployAccounts(this.admin, [this.adminAddress, this.account1Address]);
71
+ await publicDeployAccounts(this.wallet, [this.adminAddress, this.account1Address]);
72
72
 
73
73
  this.logger.verbose(`Deploying TokenContract...`);
74
74
  const asset = await TokenContract.deploy(
75
- this.admin,
75
+ this.wallet,
76
76
  this.adminAddress,
77
77
  TokenContractTest.TOKEN_NAME,
78
78
  TokenContractTest.TOKEN_SYMBOL,
@@ -83,22 +83,22 @@ export class TokenContractTest {
83
83
  this.logger.verbose(`Token deployed to ${asset.address}`);
84
84
 
85
85
  this.logger.verbose(`Deploying bad account...`);
86
- this.badAccount = await InvalidAccountContract.deploy(this.admin).send({ from: this.adminAddress }).deployed();
86
+ this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress }).deployed();
87
87
  this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
88
88
 
89
89
  return { tokenContractAddress: asset.address, badAccountAddress: this.badAccount.address };
90
90
  },
91
91
  async ({ tokenContractAddress, badAccountAddress }) => {
92
92
  // Restore the token contract state.
93
- this.asset = await TokenContract.at(tokenContractAddress, this.admin);
93
+ this.asset = await TokenContract.at(tokenContractAddress, this.wallet);
94
94
  this.logger.verbose(`Token contract address: ${this.asset.address}`);
95
95
 
96
- this.tokenSim = new TokenSimulator(this.asset, this.admin, this.adminAddress, this.logger, [
96
+ this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
97
97
  this.adminAddress,
98
98
  this.account1Address,
99
99
  ]);
100
100
 
101
- this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.admin);
101
+ this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.wallet);
102
102
  this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
103
103
 
104
104
  expect(await this.asset.methods.get_admin().simulate({ from: this.adminAddress })).toBe(
@@ -131,14 +131,14 @@ export class TokenContractTest {
131
131
  await this.snapshotManager.snapshot(
132
132
  'mint',
133
133
  async () => {
134
- const { asset, admin, adminAddress } = this;
134
+ const { asset, adminAddress } = this;
135
135
  const amount = 10000n;
136
136
 
137
137
  this.logger.verbose(`Minting ${amount} publicly...`);
138
138
  await asset.methods.mint_to_public(adminAddress, amount).send({ from: adminAddress }).wait();
139
139
 
140
140
  this.logger.verbose(`Minting ${amount} privately...`);
141
- await mintTokensToPrivate(asset, adminAddress, admin, adminAddress, amount);
141
+ await mintTokensToPrivate(asset, adminAddress, adminAddress, amount);
142
142
  this.logger.verbose(`Minting complete.`);
143
143
 
144
144
  return { amount };
@@ -1,19 +1,8 @@
1
- import {
2
- SchnorrAccountContractArtifact,
3
- getSchnorrAccount,
4
- getSchnorrWalletWithSecretKey,
5
- } from '@aztec/accounts/schnorr';
6
1
  import type { InitialAccountData } from '@aztec/accounts/testing';
7
2
  import { type Archiver, createArchiver } from '@aztec/archiver';
8
- import {
9
- type AccountWalletWithSecretKey,
10
- type AztecNode,
11
- type CompleteAddress,
12
- EthAddress,
13
- type Logger,
14
- type PXE,
15
- createLogger,
16
- } from '@aztec/aztec.js';
3
+ import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
4
+ import { type Logger, createLogger } from '@aztec/aztec.js/log';
5
+ import type { AztecNode } from '@aztec/aztec.js/node';
17
6
  import { CheatCodes } from '@aztec/aztec/testing';
18
7
  import {
19
8
  BBCircuitVerifier,
@@ -29,8 +18,8 @@ import { SecretValue } from '@aztec/foundation/config';
29
18
  import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
30
19
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
31
20
  import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
32
- import type { PXEService } from '@aztec/pxe/server';
33
21
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
22
+ import { TestWallet } from '@aztec/test-wallet/server';
34
23
  import { getGenesisValues } from '@aztec/world-state/testing';
35
24
 
36
25
  import { type Hex, getContract } from 'viem';
@@ -46,12 +35,12 @@ import {
46
35
  deployAccounts,
47
36
  publicDeployAccounts,
48
37
  } from './snapshot_manager.js';
49
- import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from './utils.js';
38
+ import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEAndGetWallet } from './utils.js';
50
39
 
51
40
  const { E2E_DATA_PATH: dataPath } = process.env;
52
41
 
53
42
  type ProvenSetup = {
54
- pxe: PXE;
43
+ wallet: TestWallet;
55
44
  teardown: () => Promise<void>;
56
45
  };
57
46
 
@@ -68,21 +57,21 @@ export class FullProverTest {
68
57
  static TOKEN_DECIMALS = 18n;
69
58
  private snapshotManager: ISnapshotManager;
70
59
  logger: Logger;
71
- deployedAccounts: InitialAccountData[] = [];
72
- wallets: AccountWalletWithSecretKey[] = [];
73
- accounts: CompleteAddress[] = [];
60
+ wallet!: TestWallet;
61
+ provenWallet!: TestWallet;
62
+ accounts: AztecAddress[] = [];
63
+ deployedAccounts!: InitialAccountData[];
74
64
  fakeProofsAsset!: TokenContract;
75
65
  tokenSim!: TokenSimulator;
76
66
  aztecNode!: AztecNode;
77
67
  aztecNodeAdmin!: AztecNodeAdmin;
78
- pxe!: PXEService;
79
68
  cheatCodes!: CheatCodes;
80
69
  blobSink!: BlobSinkServer;
81
70
  private provenComponents: ProvenSetup[] = [];
82
71
  private bbConfigCleanup?: () => Promise<void>;
83
72
  private acvmConfigCleanup?: () => Promise<void>;
84
73
  circuitProofVerifier?: ClientProtocolCircuitVerifier;
85
- provenAssets: TokenContract[] = [];
74
+ provenAsset!: TokenContract;
86
75
  private context!: SubsystemsContext;
87
76
  private proverNode!: ProverNode;
88
77
  private simulatedProverNode!: ProverNode;
@@ -115,13 +104,11 @@ export class FullProverTest {
115
104
  await this.snapshotManager.snapshot(
116
105
  '2_accounts',
117
106
  deployAccounts(2, this.logger),
118
- async ({ deployedAccounts }, { pxe }) => {
107
+ ({ deployedAccounts }, { wallet }) => {
119
108
  this.deployedAccounts = deployedAccounts;
120
- this.wallets = await Promise.all(
121
- deployedAccounts.map(a => getSchnorrWalletWithSecretKey(pxe, a.secret, a.signingKey, a.salt)),
122
- );
123
- this.accounts = this.wallets.map(w => w.getCompleteAddress());
124
- this.wallets.forEach((w, i) => this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
109
+ this.accounts = deployedAccounts.map(a => a.address);
110
+ this.wallet = wallet;
111
+ return Promise.resolve();
125
112
  },
126
113
  );
127
114
 
@@ -131,17 +118,17 @@ export class FullProverTest {
131
118
  // Create the token contract state.
132
119
  // Move this account thing to addAccounts above?
133
120
  this.logger.verbose(`Public deploy accounts...`);
134
- await publicDeployAccounts(this.wallets[0], this.accounts.slice(0, 2));
121
+ await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
135
122
 
136
123
  this.logger.verbose(`Deploying TokenContract...`);
137
124
  const asset = await TokenContract.deploy(
138
- this.wallets[0],
125
+ this.wallet,
139
126
  this.accounts[0],
140
127
  FullProverTest.TOKEN_NAME,
141
128
  FullProverTest.TOKEN_SYMBOL,
142
129
  FullProverTest.TOKEN_DECIMALS,
143
130
  )
144
- .send({ from: this.wallets[0].getAddress() })
131
+ .send({ from: this.accounts[0] })
145
132
  .deployed();
146
133
  this.logger.verbose(`Token deployed to ${asset.address}`);
147
134
 
@@ -149,19 +136,19 @@ export class FullProverTest {
149
136
  },
150
137
  async ({ tokenContractAddress }) => {
151
138
  // Restore the token contract state.
152
- this.fakeProofsAsset = await TokenContract.at(tokenContractAddress, this.wallets[0]);
139
+ this.fakeProofsAsset = await TokenContract.at(tokenContractAddress, this.wallet);
153
140
  this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
154
141
 
155
142
  this.tokenSim = new TokenSimulator(
156
143
  this.fakeProofsAsset,
157
- this.wallets[0],
158
- this.wallets[0].getAddress(),
144
+ this.wallet,
145
+ this.accounts[0],
159
146
  this.logger,
160
- this.accounts.map(a => a.address),
147
+ this.accounts,
161
148
  );
162
149
 
163
- expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0].address })).toBe(
164
- this.accounts[0].address.toBigInt(),
150
+ expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0] })).toBe(
151
+ this.accounts[0].toBigInt(),
165
152
  );
166
153
  },
167
154
  );
@@ -175,7 +162,6 @@ export class FullProverTest {
175
162
 
176
163
  this.simulatedProverNode = this.context.proverNode!;
177
164
  ({
178
- pxe: this.pxe,
179
165
  aztecNode: this.aztecNode,
180
166
  deployL1ContractsValues: this.l1Contracts,
181
167
  cheatCodes: this.cheatCodes,
@@ -224,51 +210,31 @@ export class FullProverTest {
224
210
  await this.context.cheatCodes.rollup.markAsProven();
225
211
 
226
212
  this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
227
- for (let i = 0; i < 2; i++) {
228
- const result = await setupPXEService(
229
- this.aztecNode,
230
- {
231
- proverEnabled: this.realProofs,
232
- bbBinaryPath: bbConfig?.bbBinaryPath,
233
- bbWorkingDirectory: bbConfig?.bbWorkingDirectory,
234
- },
235
- undefined,
236
- true,
237
- );
238
- this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
239
- await result.pxe.registerContract(this.fakeProofsAsset);
240
-
241
- for (let i = 0; i < 2; i++) {
242
- await result.pxe.registerAccount(
243
- this.deployedAccounts[i].secret,
244
- this.wallets[i].getCompleteAddress().partialAddress,
245
- );
246
- await this.pxe.registerAccount(
247
- this.deployedAccounts[i].secret,
248
- this.wallets[i].getCompleteAddress().partialAddress,
249
- );
250
- }
251
-
252
- const account = await getSchnorrAccount(
253
- result.pxe,
254
- this.deployedAccounts[0].secret,
255
- this.deployedAccounts[0].signingKey,
256
- this.deployedAccounts[0].salt,
257
- );
258
-
259
- await result.pxe.registerContract({
260
- instance: account.getInstance(),
261
- artifact: SchnorrAccountContractArtifact,
262
- });
213
+ const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(
214
+ this.aztecNode,
215
+ {
216
+ proverEnabled: this.realProofs,
217
+ bbBinaryPath: bbConfig?.bbBinaryPath,
218
+ bbWorkingDirectory: bbConfig?.bbWorkingDirectory,
219
+ },
220
+ undefined,
221
+ true,
222
+ );
223
+ this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
224
+ await provenWallet.registerContract(this.fakeProofsAsset);
263
225
 
264
- const provenWallet = await account.getWallet();
265
- const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
266
- this.provenComponents.push({
267
- pxe: result.pxe,
268
- teardown: result.teardown,
269
- });
270
- this.provenAssets.push(asset);
226
+ for (let i = 0; i < 2; i++) {
227
+ await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
228
+ await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
271
229
  }
230
+
231
+ const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
232
+ this.provenComponents.push({
233
+ wallet: provenWallet,
234
+ teardown: provenTeardown,
235
+ });
236
+ this.provenAsset = asset;
237
+ this.provenWallet = provenWallet;
272
238
  this.logger.info(`Full prover PXE started`);
273
239
 
274
240
  // Shutdown the current, simulated prover node
@@ -308,6 +274,7 @@ export class FullProverTest {
308
274
  txGatheringMaxParallelRequestsPerNode: 100,
309
275
  txGatheringTimeoutMs: 24_000,
310
276
  proverNodeFailedEpochStore: undefined,
277
+ proverNodeEpochProvingDelayMs: undefined,
311
278
  };
312
279
  const sponsoredFPCAddress = await getSponsoredFPCAddress();
313
280
  const { prefilledPublicData } = await getGenesisValues(
@@ -368,15 +335,12 @@ export class FullProverTest {
368
335
 
369
336
  this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
370
337
  await asset.methods
371
- .mint_to_public(accounts[0].address, privateAmount + publicAmount)
372
- .send({ from: accounts[0].address })
338
+ .mint_to_public(accounts[0], privateAmount + publicAmount)
339
+ .send({ from: accounts[0] })
373
340
  .wait();
374
341
 
375
342
  this.logger.verbose(`Transferring ${privateAmount} to private...`);
376
- await asset.methods
377
- .transfer_to_private(accounts[0].address, privateAmount)
378
- .send({ from: accounts[0].address })
379
- .wait();
343
+ await asset.methods.transfer_to_private(accounts[0], privateAmount).send({ from: accounts[0] }).wait();
380
344
 
381
345
  this.logger.verbose(`Minting complete.`);
382
346
 
@@ -385,7 +349,7 @@ export class FullProverTest {
385
349
  async ({ amount }) => {
386
350
  const {
387
351
  fakeProofsAsset: asset,
388
- accounts: [{ address }],
352
+ accounts: [address],
389
353
  tokenSim,
390
354
  } = this;
391
355
  tokenSim.mintPublic(address, amount);
@@ -1,4 +1,4 @@
1
- import type { Logger } from '@aztec/aztec.js';
1
+ import type { Logger } from '@aztec/aztec.js/log';
2
2
  import { parseBooleanEnv } from '@aztec/foundation/config';
3
3
  import { randomBytes } from '@aztec/foundation/crypto';
4
4
  import { tryRmDir } from '@aztec/foundation/fs';
@@ -1,10 +1,11 @@
1
- import { type Logger, fileURLToPath } from '@aztec/aztec.js';
1
+ import type { Logger } from '@aztec/aztec.js/log';
2
2
  import type { BBConfig } from '@aztec/bb-prover';
3
3
  import { tryRmDir } from '@aztec/foundation/fs';
4
4
 
5
5
  import fs from 'node:fs/promises';
6
6
  import { tmpdir } from 'node:os';
7
7
  import path from 'path';
8
+ import { fileURLToPath } from 'url';
8
9
 
9
10
  const {
10
11
  BB_RELEASE_DIR = 'barretenberg/cpp/build/bin',
@@ -22,7 +23,7 @@ export const getBBConfig = async (
22
23
  try {
23
24
  const bbBinaryPath =
24
25
  BB_BINARY_PATH ??
25
- path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../', BB_RELEASE_DIR, 'bb');
26
+ path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../', BB_RELEASE_DIR, 'bb-avm');
26
27
  await fs.access(bbBinaryPath, fs.constants.R_OK);
27
28
 
28
29
  let bbWorkingDirectory: string;
@@ -1,7 +1,7 @@
1
- import type { Logger } from '@aztec/aztec.js';
1
+ import type { Logger } from '@aztec/aztec.js/log';
2
2
  import { type DeployL1ContractsArgs, type L1ContractsConfig, deployL1Contracts } from '@aztec/ethereum';
3
3
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
4
- import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
4
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
5
5
 
6
6
  import type { HDAccount, PrivateKeyAccount } from 'viem';
7
7
  import { foundry } from 'viem/chains';
@@ -16,7 +16,7 @@ export const setupL1Contracts = async (
16
16
  ) => {
17
17
  const l1Data = await deployL1Contracts([l1RpcUrl], account, foundry, logger, {
18
18
  vkTreeRoot: getVKTreeRoot(),
19
- protocolContractTreeRoot,
19
+ protocolContractsHash,
20
20
  salt: undefined,
21
21
  realVerifier: false,
22
22
  ...args,