@aztec/end-to-end 0.0.0-test.1 → 0.0.1-commit.1142ef1

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 (186) hide show
  1. package/dest/bench/client_flows/benchmark.d.ts +61 -0
  2. package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
  3. package/dest/bench/client_flows/benchmark.js +261 -0
  4. package/dest/bench/client_flows/client_flows_benchmark.d.ts +80 -0
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -0
  6. package/dest/bench/client_flows/client_flows_benchmark.js +336 -0
  7. package/dest/bench/client_flows/config.d.ts +14 -0
  8. package/dest/bench/client_flows/config.d.ts.map +1 -0
  9. package/dest/bench/client_flows/config.js +106 -0
  10. package/dest/bench/client_flows/data_extractor.d.ts +2 -0
  11. package/dest/bench/client_flows/data_extractor.d.ts.map +1 -0
  12. package/dest/bench/client_flows/data_extractor.js +79 -0
  13. package/dest/bench/utils.d.ts +14 -40
  14. package/dest/bench/utils.d.ts.map +1 -1
  15. package/dest/bench/utils.js +37 -70
  16. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +21 -13
  17. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  18. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +85 -57
  19. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +29 -28
  20. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  21. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +79 -82
  22. package/dest/e2e_deploy_contract/deploy_test.d.ts +16 -8
  23. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  24. package/dest/e2e_deploy_contract/deploy_test.js +13 -19
  25. package/dest/e2e_epochs/epochs_test.d.ts +65 -22
  26. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  27. package/dest/e2e_epochs/epochs_test.js +233 -49
  28. package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
  29. package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
  30. package/dest/e2e_fees/bridging_race.notest.js +63 -0
  31. package/dest/e2e_fees/fees_test.d.ts +27 -12
  32. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  33. package/dest/e2e_fees/fees_test.js +107 -110
  34. package/dest/e2e_l1_publisher/write_json.d.ts +10 -0
  35. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
  36. package/dest/e2e_l1_publisher/write_json.js +55 -0
  37. package/dest/e2e_multi_validator/utils.d.ts +12 -0
  38. package/dest/e2e_multi_validator/utils.d.ts.map +1 -0
  39. package/dest/e2e_multi_validator/utils.js +214 -0
  40. package/dest/e2e_nested_contract/nested_contract_test.d.ts +10 -7
  41. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  42. package/dest/e2e_nested_contract/nested_contract_test.js +24 -20
  43. package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
  44. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
  45. package/dest/e2e_p2p/inactivity_slash_test.js +136 -0
  46. package/dest/e2e_p2p/p2p_network.d.ts +276 -23
  47. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  48. package/dest/e2e_p2p/p2p_network.js +188 -133
  49. package/dest/e2e_p2p/shared.d.ts +43 -7
  50. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  51. package/dest/e2e_p2p/shared.js +164 -19
  52. package/dest/e2e_token_contract/token_contract_test.d.ts +12 -6
  53. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  54. package/dest/e2e_token_contract/token_contract_test.js +50 -26
  55. package/dest/fixtures/e2e_prover_test.d.ts +61 -0
  56. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
  57. package/dest/{e2e_prover → fixtures}/e2e_prover_test.js +108 -113
  58. package/dest/fixtures/fixtures.d.ts +6 -8
  59. package/dest/fixtures/fixtures.d.ts.map +1 -1
  60. package/dest/fixtures/fixtures.js +5 -5
  61. package/dest/fixtures/get_acvm_config.d.ts +2 -2
  62. package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
  63. package/dest/fixtures/get_acvm_config.js +3 -15
  64. package/dest/fixtures/get_bb_config.d.ts +2 -2
  65. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  66. package/dest/fixtures/get_bb_config.js +10 -17
  67. package/dest/fixtures/index.d.ts +1 -1
  68. package/dest/fixtures/l1_to_l2_messaging.d.ts +11 -7
  69. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  70. package/dest/fixtures/l1_to_l2_messaging.js +45 -19
  71. package/dest/fixtures/logging.d.ts +1 -1
  72. package/dest/fixtures/setup_p2p_test.d.ts +15 -14
  73. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  74. package/dest/fixtures/setup_p2p_test.js +82 -22
  75. package/dest/fixtures/snapshot_manager.d.ts +20 -14
  76. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  77. package/dest/fixtures/snapshot_manager.js +147 -138
  78. package/dest/fixtures/token_utils.d.ts +10 -4
  79. package/dest/fixtures/token_utils.d.ts.map +1 -1
  80. package/dest/fixtures/token_utils.js +28 -12
  81. package/dest/fixtures/utils.d.ts +92 -54
  82. package/dest/fixtures/utils.d.ts.map +1 -1
  83. package/dest/fixtures/utils.js +452 -389
  84. package/dest/fixtures/web3signer.d.ts +5 -0
  85. package/dest/fixtures/web3signer.d.ts.map +1 -0
  86. package/dest/fixtures/web3signer.js +53 -0
  87. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  88. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  89. package/dest/fixtures/with_telemetry_utils.js +2 -2
  90. package/dest/index.d.ts +1 -1
  91. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  92. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  93. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  94. package/dest/shared/cross_chain_test_harness.d.ts +42 -35
  95. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  96. package/dest/shared/cross_chain_test_harness.js +106 -52
  97. package/dest/shared/gas_portal_test_harness.d.ts +29 -31
  98. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  99. package/dest/shared/gas_portal_test_harness.js +51 -30
  100. package/dest/shared/index.d.ts +2 -2
  101. package/dest/shared/index.d.ts.map +1 -1
  102. package/dest/shared/jest_setup.d.ts +1 -1
  103. package/dest/shared/jest_setup.js +1 -1
  104. package/dest/shared/submit-transactions.d.ts +6 -4
  105. package/dest/shared/submit-transactions.d.ts.map +1 -1
  106. package/dest/shared/submit-transactions.js +8 -7
  107. package/dest/shared/uniswap_l1_l2.d.ts +3 -25
  108. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  109. package/dest/shared/uniswap_l1_l2.js +170 -120
  110. package/dest/simulators/index.d.ts +1 -1
  111. package/dest/simulators/lending_simulator.d.ts +7 -11
  112. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  113. package/dest/simulators/lending_simulator.js +16 -17
  114. package/dest/simulators/token_simulator.d.ts +6 -3
  115. package/dest/simulators/token_simulator.d.ts.map +1 -1
  116. package/dest/simulators/token_simulator.js +16 -13
  117. package/dest/spartan/setup_test_wallets.d.ts +27 -11
  118. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  119. package/dest/spartan/setup_test_wallets.js +202 -58
  120. package/dest/spartan/tx_metrics.d.ts +39 -0
  121. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  122. package/dest/spartan/tx_metrics.js +95 -0
  123. package/dest/spartan/utils.d.ts +151 -313
  124. package/dest/spartan/utils.d.ts.map +1 -1
  125. package/dest/spartan/utils.js +598 -151
  126. package/package.json +65 -58
  127. package/src/bench/client_flows/benchmark.ts +341 -0
  128. package/src/bench/client_flows/client_flows_benchmark.ts +450 -0
  129. package/src/bench/client_flows/config.ts +61 -0
  130. package/src/bench/client_flows/data_extractor.ts +89 -0
  131. package/src/bench/utils.ts +35 -81
  132. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +80 -77
  133. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +103 -122
  134. package/src/e2e_deploy_contract/deploy_test.ts +24 -39
  135. package/src/e2e_epochs/epochs_test.ts +299 -65
  136. package/src/e2e_fees/bridging_race.notest.ts +80 -0
  137. package/src/e2e_fees/fees_test.ts +150 -142
  138. package/src/e2e_l1_publisher/write_json.ts +74 -0
  139. package/src/e2e_multi_validator/utils.ts +258 -0
  140. package/src/e2e_nested_contract/nested_contract_test.ts +29 -19
  141. package/src/e2e_p2p/inactivity_slash_test.ts +179 -0
  142. package/src/e2e_p2p/p2p_network.ts +274 -171
  143. package/src/e2e_p2p/shared.ts +252 -29
  144. package/src/e2e_token_contract/token_contract_test.ts +43 -39
  145. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  146. package/src/{e2e_prover → fixtures}/e2e_prover_test.ts +112 -160
  147. package/src/fixtures/fixtures.ts +5 -7
  148. package/src/fixtures/get_acvm_config.ts +4 -12
  149. package/src/fixtures/get_bb_config.ts +18 -13
  150. package/src/fixtures/l1_to_l2_messaging.ts +56 -24
  151. package/src/fixtures/setup_p2p_test.ts +127 -39
  152. package/src/fixtures/snapshot_manager.ts +189 -160
  153. package/src/fixtures/token_utils.ts +32 -15
  154. package/src/fixtures/utils.ts +556 -475
  155. package/src/fixtures/web3signer.ts +63 -0
  156. package/src/fixtures/with_telemetry_utils.ts +2 -2
  157. package/src/guides/up_quick_start.sh +7 -15
  158. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +2 -2
  159. package/src/shared/cross_chain_test_harness.ts +113 -87
  160. package/src/shared/gas_portal_test_harness.ts +59 -50
  161. package/src/shared/index.ts +1 -1
  162. package/src/shared/jest_setup.ts +1 -1
  163. package/src/shared/submit-transactions.ts +12 -8
  164. package/src/shared/uniswap_l1_l2.ts +194 -211
  165. package/src/simulators/lending_simulator.ts +15 -16
  166. package/src/simulators/token_simulator.ts +21 -13
  167. package/src/spartan/DEVELOP.md +128 -0
  168. package/src/spartan/setup_test_wallets.ts +258 -93
  169. package/src/spartan/tx_metrics.ts +130 -0
  170. package/src/spartan/utils.ts +722 -146
  171. package/dest/e2e_prover/e2e_prover_test.d.ts +0 -56
  172. package/dest/e2e_prover/e2e_prover_test.d.ts.map +0 -1
  173. package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
  174. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  175. package/dest/fixtures/setup_l1_contracts.js +0 -17
  176. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  177. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  178. package/dest/sample-dapp/connect.js +0 -12
  179. package/dest/sample-dapp/contracts.js +0 -10
  180. package/dest/sample-dapp/deploy.js +0 -35
  181. package/dest/sample-dapp/index.js +0 -98
  182. package/src/fixtures/setup_l1_contracts.ts +0 -27
  183. package/src/sample-dapp/connect.mjs +0 -16
  184. package/src/sample-dapp/contracts.mjs +0 -14
  185. package/src/sample-dapp/deploy.mjs +0 -40
  186. package/src/sample-dapp/index.mjs +0 -128
@@ -1,51 +1,47 @@
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';
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';
6
+ import { CheatCodes } from '@aztec/aztec/testing';
8
7
  import {
9
- type AccountWalletWithSecretKey,
10
- type AztecNode,
11
- type CheatCodes,
12
- type CompleteAddress,
13
- type DeployL1ContractsReturnType,
14
- EthAddress,
15
- type Logger,
16
- type PXE,
17
- createLogger,
18
- deployL1Contract,
19
- } from '@aztec/aztec.js';
20
- import { BBCircuitVerifier, type ClientProtocolCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
21
- import { createBlobSinkClient } from '@aztec/blob-sink/client';
22
- import type { BlobSinkServer } from '@aztec/blob-sink/server';
8
+ BBCircuitVerifier,
9
+ type ClientProtocolCircuitVerifier,
10
+ QueuedIVCVerifier,
11
+ TestCircuitVerifier,
12
+ } from '@aztec/bb-prover';
13
+ import { BackendType, Barretenberg } from '@aztec/bb.js';
14
+ import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
15
+ import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
23
16
  import { Buffer32 } from '@aztec/foundation/buffer';
24
- import { HonkVerifierAbi, HonkVerifierBytecode, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
17
+ import { SecretValue } from '@aztec/foundation/config';
18
+ import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
25
19
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
26
20
  import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
27
- import type { PXEService } from '@aztec/pxe/server';
21
+ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
22
+ import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
23
+ import { TestWallet } from '@aztec/test-wallet/server';
28
24
  import { getGenesisValues } from '@aztec/world-state/testing';
29
25
 
30
26
  import { type Hex, getContract } from 'viem';
31
27
  import { privateKeyToAddress } from 'viem/accounts';
32
28
 
33
- import { getACVMConfig } from '../fixtures/get_acvm_config.js';
34
- import { getBBConfig } from '../fixtures/get_bb_config.js';
29
+ import { TokenSimulator } from '../simulators/token_simulator.js';
30
+ import { getACVMConfig } from './get_acvm_config.js';
31
+ import { getBBConfig } from './get_bb_config.js';
35
32
  import {
36
33
  type ISnapshotManager,
37
34
  type SubsystemsContext,
38
35
  createSnapshotManager,
39
36
  deployAccounts,
40
37
  publicDeployAccounts,
41
- } from '../fixtures/snapshot_manager.js';
42
- import { getPrivateKeyFromIndex, setupPXEService } from '../fixtures/utils.js';
43
- import { TokenSimulator } from '../simulators/token_simulator.js';
38
+ } from './snapshot_manager.js';
39
+ import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEAndGetWallet } from './utils.js';
44
40
 
45
41
  const { E2E_DATA_PATH: dataPath } = process.env;
46
42
 
47
43
  type ProvenSetup = {
48
- pxe: PXE;
44
+ wallet: TestWallet;
49
45
  teardown: () => Promise<void>;
50
46
  };
51
47
 
@@ -62,24 +58,25 @@ export class FullProverTest {
62
58
  static TOKEN_DECIMALS = 18n;
63
59
  private snapshotManager: ISnapshotManager;
64
60
  logger: Logger;
65
- deployedAccounts: InitialAccountData[] = [];
66
- wallets: AccountWalletWithSecretKey[] = [];
67
- accounts: CompleteAddress[] = [];
61
+ wallet!: TestWallet;
62
+ provenWallet!: TestWallet;
63
+ accounts: AztecAddress[] = [];
64
+ deployedAccounts!: InitialAccountData[];
68
65
  fakeProofsAsset!: TokenContract;
66
+ fakeProofsAssetInstance!: ContractInstanceWithAddress;
69
67
  tokenSim!: TokenSimulator;
70
68
  aztecNode!: AztecNode;
71
- pxe!: PXEService;
69
+ aztecNodeAdmin!: AztecNodeAdmin;
72
70
  cheatCodes!: CheatCodes;
73
- blobSink!: BlobSinkServer;
74
71
  private provenComponents: ProvenSetup[] = [];
75
72
  private bbConfigCleanup?: () => Promise<void>;
76
73
  private acvmConfigCleanup?: () => Promise<void>;
77
74
  circuitProofVerifier?: ClientProtocolCircuitVerifier;
78
- provenAssets: TokenContract[] = [];
75
+ provenAsset!: TokenContract;
79
76
  private context!: SubsystemsContext;
80
77
  private proverNode!: ProverNode;
81
78
  private simulatedProverNode!: ProverNode;
82
- public l1Contracts!: DeployL1ContractsReturnType;
79
+ public l1Contracts!: DeployAztecL1ContractsReturnType;
83
80
  public proverAddress!: EthAddress;
84
81
 
85
82
  constructor(
@@ -92,8 +89,10 @@ export class FullProverTest {
92
89
  this.snapshotManager = createSnapshotManager(
93
90
  `full_prover_integration/${testName}`,
94
91
  dataPath,
95
- { startProverNode: true, fundRewardDistributor: true, coinbase },
96
- {},
92
+ { startProverNode: true, coinbase },
93
+ {
94
+ realVerifier: realProofs,
95
+ },
97
96
  );
98
97
  }
99
98
 
@@ -106,13 +105,11 @@ export class FullProverTest {
106
105
  await this.snapshotManager.snapshot(
107
106
  '2_accounts',
108
107
  deployAccounts(2, this.logger),
109
- async ({ deployedAccounts }, { pxe }) => {
108
+ ({ deployedAccounts }, { wallet }) => {
110
109
  this.deployedAccounts = deployedAccounts;
111
- this.wallets = await Promise.all(
112
- deployedAccounts.map(a => getSchnorrWalletWithSecretKey(pxe, a.secret, a.signingKey, a.salt)),
113
- );
114
- this.accounts = this.wallets.map(w => w.getCompleteAddress());
115
- this.wallets.forEach((w, i) => this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
110
+ this.accounts = deployedAccounts.map(a => a.address);
111
+ this.wallet = wallet;
112
+ return Promise.resolve();
116
113
  },
117
114
  );
118
115
 
@@ -122,35 +119,39 @@ export class FullProverTest {
122
119
  // Create the token contract state.
123
120
  // Move this account thing to addAccounts above?
124
121
  this.logger.verbose(`Public deploy accounts...`);
125
- await publicDeployAccounts(this.wallets[0], this.accounts.slice(0, 2), false);
122
+ await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
126
123
 
127
124
  this.logger.verbose(`Deploying TokenContract...`);
128
- const asset = await TokenContract.deploy(
129
- this.wallets[0],
125
+ const { contract: asset, instance } = await TokenContract.deploy(
126
+ this.wallet,
130
127
  this.accounts[0],
131
128
  FullProverTest.TOKEN_NAME,
132
129
  FullProverTest.TOKEN_SYMBOL,
133
130
  FullProverTest.TOKEN_DECIMALS,
134
131
  )
135
- .send()
136
- .deployed();
132
+ .send({ from: this.accounts[0] })
133
+ .wait();
137
134
  this.logger.verbose(`Token deployed to ${asset.address}`);
138
135
 
139
- return { tokenContractAddress: asset.address };
136
+ return { tokenContractAddress: asset.address, tokenContractInstance: instance };
140
137
  },
141
- async ({ tokenContractAddress }) => {
138
+ async ({ tokenContractAddress, tokenContractInstance }) => {
142
139
  // Restore the token contract state.
143
- this.fakeProofsAsset = await TokenContract.at(tokenContractAddress, this.wallets[0]);
140
+ this.fakeProofsAsset = TokenContract.at(tokenContractAddress, this.wallet);
141
+ this.fakeProofsAssetInstance = tokenContractInstance;
144
142
  this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
145
143
 
146
144
  this.tokenSim = new TokenSimulator(
147
145
  this.fakeProofsAsset,
148
- this.wallets[0],
146
+ this.wallet,
147
+ this.accounts[0],
149
148
  this.logger,
150
- this.accounts.map(a => a.address),
149
+ this.accounts,
151
150
  );
152
151
 
153
- expect(await this.fakeProofsAsset.methods.get_admin().simulate()).toBe(this.accounts[0].address.toBigInt());
152
+ expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0] })).toBe(
153
+ this.accounts[0].toBigInt(),
154
+ );
154
155
  },
155
156
  );
156
157
  }
@@ -163,14 +164,14 @@ export class FullProverTest {
163
164
 
164
165
  this.simulatedProverNode = this.context.proverNode!;
165
166
  ({
166
- pxe: this.pxe,
167
167
  aztecNode: this.aztecNode,
168
168
  deployL1ContractsValues: this.l1Contracts,
169
169
  cheatCodes: this.cheatCodes,
170
- blobSink: this.blobSink,
171
170
  } = this.context);
171
+ this.aztecNodeAdmin = this.context.aztecNode;
172
172
 
173
- const blobSinkClient = createBlobSinkClient({ blobSinkUrl: `http://localhost:${this.blobSink.port}` });
173
+ const config = this.context.aztecNodeConfig;
174
+ const blobClient = await createBlobClientWithFileStores(config, this.logger);
174
175
 
175
176
  // Configure a full prover PXE
176
177
  let acvmConfig: Awaited<ReturnType<typeof getACVMConfig>> | undefined;
@@ -184,21 +185,20 @@ export class FullProverTest {
184
185
  this.acvmConfigCleanup = acvmConfig.cleanup;
185
186
  this.bbConfigCleanup = bbConfig.cleanup;
186
187
 
187
- if (!bbConfig?.bbWorkingDirectory || !bbConfig?.bbBinaryPath) {
188
- throw new Error(`Test must be run with BB native configuration`);
189
- }
188
+ await Barretenberg.initSingleton({ backend: BackendType.NativeUnixSocket });
190
189
 
191
- this.circuitProofVerifier = await BBCircuitVerifier.new(bbConfig);
190
+ const verifier = await BBCircuitVerifier.new(bbConfig);
191
+ this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
192
192
 
193
193
  this.logger.debug(`Configuring the node for real proofs...`);
194
- await this.aztecNode.setConfig({
194
+ await this.aztecNodeAdmin.setConfig({
195
195
  realProofs: true,
196
196
  minTxsPerBlock: this.minNumberOfTxsPerBlock,
197
197
  });
198
198
  } else {
199
199
  this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
200
200
  this.circuitProofVerifier = new TestCircuitVerifier();
201
- await this.aztecNode.setConfig({
201
+ await this.aztecNodeAdmin.setConfig({
202
202
  minTxsPerBlock: this.minNumberOfTxsPerBlock,
203
203
  });
204
204
  }
@@ -210,51 +210,27 @@ export class FullProverTest {
210
210
  await this.context.cheatCodes.rollup.markAsProven();
211
211
 
212
212
  this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
213
- for (let i = 0; i < 2; i++) {
214
- const result = await setupPXEService(
215
- this.aztecNode,
216
- {
217
- proverEnabled: this.realProofs,
218
- bbBinaryPath: bbConfig?.bbBinaryPath,
219
- bbWorkingDirectory: bbConfig?.bbWorkingDirectory,
220
- },
221
- undefined,
222
- true,
223
- );
224
- this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
225
- await result.pxe.registerContract(this.fakeProofsAsset);
226
-
227
- for (let i = 0; i < 2; i++) {
228
- await result.pxe.registerAccount(
229
- this.deployedAccounts[i].secret,
230
- this.wallets[i].getCompleteAddress().partialAddress,
231
- );
232
- await this.pxe.registerAccount(
233
- this.deployedAccounts[i].secret,
234
- this.wallets[i].getCompleteAddress().partialAddress,
235
- );
236
- }
237
-
238
- const account = await getSchnorrAccount(
239
- result.pxe,
240
- this.deployedAccounts[0].secret,
241
- this.deployedAccounts[0].signingKey,
242
- this.deployedAccounts[0].salt,
243
- );
244
-
245
- await result.pxe.registerContract({
246
- instance: account.getInstance(),
247
- artifact: SchnorrAccountContractArtifact,
248
- });
213
+ const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(
214
+ this.aztecNode,
215
+ { proverEnabled: this.realProofs },
216
+ undefined,
217
+ true,
218
+ );
219
+ this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
220
+ await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
249
221
 
250
- const provenWallet = await account.getWallet();
251
- const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
252
- this.provenComponents.push({
253
- pxe: result.pxe,
254
- teardown: result.teardown,
255
- });
256
- this.provenAssets.push(asset);
222
+ for (let i = 0; i < 2; i++) {
223
+ await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
224
+ await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
257
225
  }
226
+
227
+ const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
228
+ this.provenComponents.push({
229
+ wallet: provenWallet,
230
+ teardown: provenTeardown,
231
+ });
232
+ this.provenAsset = asset;
233
+ this.provenWallet = provenWallet;
258
234
  this.logger.info(`Full prover PXE started`);
259
235
 
260
236
  // Shutdown the current, simulated prover node
@@ -265,7 +241,7 @@ export class FullProverTest {
265
241
  this.logger.verbose('Starting archiver for new prover node');
266
242
  const archiver = await createArchiver(
267
243
  { ...this.context.aztecNodeConfig, dataDirectory: undefined },
268
- blobSinkClient,
244
+ { blobClient, dateProvider: this.context.dateProvider },
269
245
  { blockUntilSync: true },
270
246
  );
271
247
 
@@ -275,46 +251,52 @@ export class FullProverTest {
275
251
  this.proverAddress = EthAddress.fromString(proverNodeSenderAddress);
276
252
 
277
253
  this.logger.verbose(`Funding prover node at ${proverNodeSenderAddress}`);
278
- await this.mintL1ERC20(proverNodeSenderAddress, 100_000_000n);
254
+ await this.mintFeeJuice(proverNodeSenderAddress);
279
255
 
280
256
  this.logger.verbose('Starting prover node');
281
257
  const proverConfig: ProverNodeConfig = {
282
258
  ...this.context.aztecNodeConfig,
283
- proverCoordinationNodeUrl: undefined,
259
+ txCollectionNodeRpcUrls: [],
284
260
  dataDirectory: undefined,
285
- proverId: this.proverAddress.toField(),
261
+ proverId: this.proverAddress,
286
262
  realProofs: this.realProofs,
287
263
  proverAgentCount: 2,
288
- publisherPrivateKey: `0x${proverNodePrivateKey!.toString('hex')}`,
264
+ publisherPrivateKeys: [new SecretValue(`0x${proverNodePrivateKey!.toString('hex')}` as const)],
289
265
  proverNodeMaxPendingJobs: 100,
290
266
  proverNodeMaxParallelBlocksPerEpoch: 32,
291
267
  proverNodePollingIntervalMs: 100,
292
- txGatheringTimeoutMs: 60000,
293
268
  txGatheringIntervalMs: 1000,
294
- txGatheringMaxParallelRequests: 100,
269
+ txGatheringBatchSize: 10,
270
+ txGatheringMaxParallelRequestsPerNode: 100,
271
+ txGatheringTimeoutMs: 24_000,
272
+ proverNodeFailedEpochStore: undefined,
273
+ proverNodeEpochProvingDelayMs: undefined,
295
274
  };
296
- const { prefilledPublicData } = await getGenesisValues(this.context.initialFundedAccounts.map(a => a.address));
275
+ const sponsoredFPCAddress = await getSponsoredFPCAddress();
276
+ const { prefilledPublicData } = await getGenesisValues(
277
+ this.context.initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
278
+ );
297
279
  this.proverNode = await createProverNode(
298
280
  proverConfig,
299
281
  {
300
282
  aztecNodeTxProvider: this.aztecNode,
301
283
  archiver: archiver as Archiver,
302
- blobSinkClient,
303
284
  },
304
285
  { prefilledPublicData },
305
286
  );
306
- this.proverNode.start();
287
+ await this.proverNode.start();
307
288
 
308
289
  this.logger.warn(`Proofs are now enabled`);
309
290
  return this;
310
291
  }
311
292
 
312
- private async mintL1ERC20(recipient: Hex, amount: bigint) {
313
- const erc20Address = this.context.deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress;
314
- const client = this.context.deployL1ContractsValues.walletClient;
315
- const erc20 = getContract({ abi: TestERC20Abi, address: erc20Address.toString(), client });
316
- const hash = await erc20.write.mint([recipient, amount]);
317
- await this.context.deployL1ContractsValues.publicClient.waitForTransactionReceipt({ hash });
293
+ private async mintFeeJuice(recipient: Hex) {
294
+ const handlerAddress = this.context.deployL1ContractsValues.l1ContractAddresses.feeAssetHandlerAddress!;
295
+ this.logger.verbose(`Minting fee juice to ${recipient} using handler at ${handlerAddress}`);
296
+ const client = this.context.deployL1ContractsValues.l1Client;
297
+ const handler = getContract({ abi: FeeAssetHandlerAbi, address: handlerAddress.toString(), client });
298
+ const hash = await handler.write.mint([recipient]);
299
+ await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash });
318
300
  }
319
301
 
320
302
  snapshot = <T>(
@@ -334,6 +316,7 @@ export class FullProverTest {
334
316
  // clean up the full prover node
335
317
  await this.proverNode.stop();
336
318
 
319
+ await Barretenberg.destroySingleton();
337
320
  await this.bbConfigCleanup?.();
338
321
  await this.acvmConfigCleanup?.();
339
322
  }
@@ -346,16 +329,14 @@ export class FullProverTest {
346
329
  const privateAmount = 10000n;
347
330
  const publicAmount = 10000n;
348
331
 
349
- const waitOpts = { proven: false };
350
-
351
332
  this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
352
333
  await asset.methods
353
- .mint_to_public(accounts[0].address, privateAmount + publicAmount)
354
- .send()
355
- .wait(waitOpts);
334
+ .mint_to_public(accounts[0], privateAmount + publicAmount)
335
+ .send({ from: accounts[0] })
336
+ .wait();
356
337
 
357
338
  this.logger.verbose(`Transferring ${privateAmount} to private...`);
358
- await asset.methods.transfer_to_private(accounts[0].address, privateAmount).send().wait(waitOpts);
339
+ await asset.methods.transfer_to_private(accounts[0], privateAmount).send({ from: accounts[0] }).wait();
359
340
 
360
341
  this.logger.verbose(`Minting complete.`);
361
342
 
@@ -364,21 +345,21 @@ export class FullProverTest {
364
345
  async ({ amount }) => {
365
346
  const {
366
347
  fakeProofsAsset: asset,
367
- accounts: [{ address }],
348
+ accounts: [address],
368
349
  tokenSim,
369
350
  } = this;
370
351
  tokenSim.mintPublic(address, amount);
371
352
 
372
- const publicBalance = await asset.methods.balance_of_public(address).simulate();
353
+ const publicBalance = await asset.methods.balance_of_public(address).simulate({ from: address });
373
354
  this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
374
355
  expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(address));
375
356
 
376
357
  tokenSim.mintPrivate(address, amount);
377
- const privateBalance = await asset.methods.balance_of_private(address).simulate();
358
+ const privateBalance = await asset.methods.balance_of_private(address).simulate({ from: address });
378
359
  this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
379
360
  expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
380
361
 
381
- const totalSupply = await asset.methods.total_supply().simulate();
362
+ const totalSupply = await asset.methods.total_supply().simulate({ from: address });
382
363
  this.logger.verbose(`Total supply: ${totalSupply}`);
383
364
  expect(totalSupply).toEqual(tokenSim.totalSupply);
384
365
 
@@ -386,33 +367,4 @@ export class FullProverTest {
386
367
  },
387
368
  );
388
369
  }
389
-
390
- async deployVerifier() {
391
- if (!this.realProofs) {
392
- return;
393
- }
394
-
395
- if (!this.circuitProofVerifier) {
396
- throw new Error('No verifier');
397
- }
398
-
399
- const { walletClient, publicClient, l1ContractAddresses } = this.context.deployL1ContractsValues;
400
- const rollup = getContract({
401
- abi: RollupAbi,
402
- address: l1ContractAddresses.rollupAddress.toString(),
403
- client: walletClient,
404
- });
405
-
406
- const { address: verifierAddress } = await deployL1Contract(
407
- walletClient,
408
- publicClient,
409
- HonkVerifierAbi,
410
- HonkVerifierBytecode,
411
- );
412
- this.logger.info(`Deployed honk verifier at ${verifierAddress}`);
413
-
414
- await rollup.write.setEpochVerifier([verifierAddress.toString()]);
415
-
416
- this.logger.info('Rollup only accepts valid proofs now');
417
- }
418
370
  }
@@ -8,21 +8,19 @@ export const shouldCollectMetrics = () => {
8
8
  };
9
9
 
10
10
  export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
11
+ export const TEST_MAX_PENDING_TX_POOL_COUNT = 10_000; // Number of max pending TXs ~ 1.56GB
11
12
 
12
13
  export const MNEMONIC = 'test test test test test test test test test test test junk';
13
14
  export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
14
15
  export const privateKey2 = Buffer.from('59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex');
15
16
 
16
17
  /// Common errors
17
- export const U128_UNDERFLOW_ERROR = "Assertion failed: attempt to subtract with overflow 'self - other'";
18
- export const U128_OVERFLOW_ERROR = "Assertion failed: attempt to add with overflow 'self + other'";
18
+ export const U128_UNDERFLOW_ERROR = 'Assertion failed: attempt to subtract with overflow';
19
+ export const U128_OVERFLOW_ERROR = 'Assertion failed: attempt to add with overflow';
19
20
  export const BITSIZE_TOO_BIG_ERROR = "Assertion failed: call to assert_max_bit_size 'self.__assert_max_bit_size'";
20
21
  // TODO(https://github.com/AztecProtocol/aztec-packages/issues/5818): Make these a fixed error after transition.
21
- export const DUPLICATE_NULLIFIER_ERROR = /dropped|duplicate nullifier|reverted|Nullifier collision/;
22
+ export const DUPLICATE_NULLIFIER_ERROR = /dropped|nullifier|reverted/i;
22
23
  export const NO_L1_TO_L2_MSG_ERROR =
23
24
  /No non-nullified L1 to L2 message found for message hash|Tried to consume nonexistent L1-to-L2 message/;
24
- export const STATIC_CALL_STATE_MODIFICATION_ERROR =
25
- /Static call cannot update the state, emit L2->L1 messages or generate logs.*/;
25
+ export const STATIC_CALL_STATE_MODIFICATION_ERROR = /Static call cannot update the state.*/;
26
26
  export const STATIC_CONTEXT_ASSERTION_ERROR = /Assertion failed: Function .* can only be called statically.*/;
27
-
28
- export const DEFAULT_BLOB_SINK_PORT = '5052';
@@ -1,6 +1,7 @@
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
- import { randomBytes } from '@aztec/foundation/crypto';
3
+ import { randomBytes } from '@aztec/foundation/crypto/random';
4
+ import { tryRmDir } from '@aztec/foundation/fs';
4
5
 
5
6
  import { promises as fs } from 'fs';
6
7
 
@@ -36,16 +37,7 @@ export async function getACVMConfig(logger: Logger): Promise<
36
37
 
37
38
  const directoryToCleanup = ACVM_WORKING_DIRECTORY ? undefined : tempWorkingDirectory;
38
39
 
39
- const cleanup = async () => {
40
- if (directoryToCleanup) {
41
- try {
42
- logger.info(`Cleaning up ACVM temp directory ${directoryToCleanup}`);
43
- await fs.rm(directoryToCleanup, { recursive: true, force: true, maxRetries: 3 });
44
- } catch (err) {
45
- logger.warn(`Failed to delete ACVM temp directory at ${directoryToCleanup}: ${err}`);
46
- }
47
- }
48
- };
40
+ const cleanup = () => tryRmDir(directoryToCleanup, logger);
49
41
 
50
42
  return {
51
43
  acvmWorkingDirectory,
@@ -1,9 +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
+ import { tryRmDir } from '@aztec/foundation/fs';
3
4
 
4
5
  import fs from 'node:fs/promises';
5
6
  import { tmpdir } from 'node:os';
6
7
  import path from 'path';
8
+ import { fileURLToPath } from 'url';
7
9
 
8
10
  const {
9
11
  BB_RELEASE_DIR = 'barretenberg/cpp/build/bin',
@@ -11,6 +13,8 @@ const {
11
13
  BB_SKIP_CLEANUP = '',
12
14
  TEMP_DIR = tmpdir(),
13
15
  BB_WORKING_DIRECTORY = '',
16
+ BB_NUM_IVC_VERIFIERS = '1',
17
+ BB_IVC_CONCURRENCY = '1',
14
18
  } = process.env;
15
19
 
16
20
  export const getBBConfig = async (
@@ -19,7 +23,7 @@ export const getBBConfig = async (
19
23
  try {
20
24
  const bbBinaryPath =
21
25
  BB_BINARY_PATH ??
22
- 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');
23
27
  await fs.access(bbBinaryPath, fs.constants.R_OK);
24
28
 
25
29
  let bbWorkingDirectory: string;
@@ -35,18 +39,19 @@ export const getBBConfig = async (
35
39
  await fs.mkdir(bbWorkingDirectory, { recursive: true });
36
40
 
37
41
  const bbSkipCleanup = ['1', 'true'].includes(BB_SKIP_CLEANUP);
38
-
39
- const cleanup = async () => {
40
- if (directoryToCleanup && !bbSkipCleanup) {
41
- try {
42
- await fs.rm(directoryToCleanup, { recursive: true, force: true, maxRetries: 3 });
43
- } catch (err) {
44
- logger.warn(`Failed to delete bb working directory at ${directoryToCleanup}: ${err}`);
45
- }
46
- }
42
+ const cleanup = bbSkipCleanup ? () => Promise.resolve() : () => tryRmDir(directoryToCleanup);
43
+
44
+ const numIvcVerifiers = Number(BB_NUM_IVC_VERIFIERS);
45
+ const ivcConcurrency = Number(BB_IVC_CONCURRENCY);
46
+
47
+ return {
48
+ bbSkipCleanup,
49
+ bbBinaryPath,
50
+ bbWorkingDirectory,
51
+ cleanup,
52
+ numConcurrentIVCVerifiers: numIvcVerifiers,
53
+ bbIVCConcurrency: ivcConcurrency,
47
54
  };
48
-
49
- return { bbSkipCleanup, bbBinaryPath, bbWorkingDirectory, cleanup };
50
55
  } catch (err) {
51
56
  logger.error(`Native BB not available, error: ${err}`);
52
57
  return undefined;