@aztec/end-to-end 0.0.1-commit.72dcdcda8 → 0.0.1-commit.7689c7f

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 (181) hide show
  1. package/README.md +27 -0
  2. package/dest/bench/client_flows/benchmark.d.ts +15 -1
  3. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  4. package/dest/bench/client_flows/benchmark.js +17 -0
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts +2 -2
  6. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  7. package/dest/bench/client_flows/client_flows_benchmark.js +32 -36
  8. package/dest/bench/utils.d.ts +1 -1
  9. package/dest/bench/utils.d.ts.map +1 -1
  10. package/dest/bench/utils.js +8 -3
  11. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +5 -4
  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 +28 -19
  14. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +15 -4
  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 +39 -7
  17. package/dest/e2e_deploy_contract/deploy_test.d.ts +3 -3
  18. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  19. package/dest/e2e_deploy_contract/deploy_test.js +2 -1
  20. package/dest/e2e_epochs/epochs_test.d.ts +25 -2
  21. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  22. package/dest/e2e_epochs/epochs_test.js +88 -14
  23. package/dest/e2e_fees/fees_test.d.ts +5 -2
  24. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  25. package/dest/e2e_fees/fees_test.js +44 -11
  26. package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -3
  27. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  28. package/dest/e2e_nested_contract/nested_contract_test.js +6 -7
  29. package/dest/e2e_p2p/inactivity_slash_test.d.ts +1 -1
  30. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  31. package/dest/e2e_p2p/inactivity_slash_test.js +5 -3
  32. package/dest/e2e_p2p/p2p_network.d.ts +13 -11
  33. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  34. package/dest/e2e_p2p/p2p_network.js +65 -43
  35. package/dest/e2e_p2p/reqresp/utils.d.ts +1 -1
  36. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
  37. package/dest/e2e_p2p/reqresp/utils.js +42 -13
  38. package/dest/e2e_p2p/shared.d.ts +25 -7
  39. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  40. package/dest/e2e_p2p/shared.js +73 -50
  41. package/dest/e2e_token_contract/token_contract_test.d.ts +3 -3
  42. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  43. package/dest/e2e_token_contract/token_contract_test.js +15 -13
  44. package/dest/fixtures/authwit_proxy.d.ts +3 -3
  45. package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
  46. package/dest/fixtures/authwit_proxy.js +4 -0
  47. package/dest/fixtures/e2e_prover_test.d.ts +6 -5
  48. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  49. package/dest/fixtures/e2e_prover_test.js +13 -17
  50. package/dest/fixtures/fixtures.d.ts +73 -1
  51. package/dest/fixtures/fixtures.d.ts.map +1 -1
  52. package/dest/fixtures/fixtures.js +68 -0
  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 +5 -5
  56. package/dest/fixtures/ha_setup.d.ts +2 -2
  57. package/dest/fixtures/ha_setup.d.ts.map +1 -1
  58. package/dest/fixtures/ha_setup.js +1 -1
  59. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  60. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  61. package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
  62. package/dest/fixtures/setup.d.ts +43 -11
  63. package/dest/fixtures/setup.d.ts.map +1 -1
  64. package/dest/fixtures/setup.js +138 -29
  65. package/dest/fixtures/setup_p2p_test.d.ts +10 -6
  66. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  67. package/dest/fixtures/setup_p2p_test.js +8 -8
  68. package/dest/fixtures/token_utils.d.ts +1 -1
  69. package/dest/fixtures/token_utils.d.ts.map +1 -1
  70. package/dest/fixtures/token_utils.js +2 -5
  71. package/dest/fixtures/utils.d.ts +2 -2
  72. package/dest/fixtures/utils.d.ts.map +1 -1
  73. package/dest/fixtures/utils.js +1 -1
  74. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  75. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  76. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  77. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  78. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  79. package/dest/forward-compatibility/wallet_service.js +109 -0
  80. package/dest/install_legacy_contracts.d.cts +10 -0
  81. package/dest/install_legacy_contracts.d.cts.map +1 -0
  82. package/dest/legacy-jest-resolver.d.cts +3 -0
  83. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  84. package/dest/shared/cross_chain_test_harness.d.ts +4 -2
  85. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  86. package/dest/shared/cross_chain_test_harness.js +22 -18
  87. package/dest/shared/gas_portal_test_harness.d.ts +8 -5
  88. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  89. package/dest/shared/gas_portal_test_harness.js +19 -10
  90. package/dest/shared/submit-transactions.d.ts +1 -1
  91. package/dest/shared/submit-transactions.d.ts.map +1 -1
  92. package/dest/shared/submit-transactions.js +1 -1
  93. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  94. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  95. package/dest/shared/uniswap_l1_l2.js +60 -39
  96. package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
  97. package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
  98. package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
  99. package/dest/simulators/lending_simulator.d.ts +10 -3
  100. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  101. package/dest/simulators/lending_simulator.js +26 -14
  102. package/dest/simulators/token_simulator.d.ts +1 -1
  103. package/dest/simulators/token_simulator.d.ts.map +1 -1
  104. package/dest/simulators/token_simulator.js +2 -2
  105. package/dest/spartan/setup_test_wallets.d.ts +4 -2
  106. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  107. package/dest/spartan/setup_test_wallets.js +72 -39
  108. package/dest/spartan/tx_metrics.d.ts +18 -4
  109. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  110. package/dest/spartan/tx_metrics.js +74 -21
  111. package/dest/spartan/utils/config.d.ts +9 -32
  112. package/dest/spartan/utils/config.d.ts.map +1 -1
  113. package/dest/spartan/utils/config.js +1 -0
  114. package/dest/spartan/utils/index.d.ts +2 -1
  115. package/dest/spartan/utils/index.d.ts.map +1 -1
  116. package/dest/spartan/utils/index.js +2 -0
  117. package/dest/spartan/utils/nodes.js +2 -2
  118. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  119. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  120. package/dest/spartan/utils/pod_logs.js +74 -0
  121. package/dest/test-wallet/test_wallet.d.ts +25 -23
  122. package/dest/test-wallet/test_wallet.d.ts.map +1 -1
  123. package/dest/test-wallet/test_wallet.js +146 -87
  124. package/dest/test-wallet/utils.d.ts +3 -3
  125. package/dest/test-wallet/utils.d.ts.map +1 -1
  126. package/dest/test-wallet/utils.js +2 -7
  127. package/dest/test-wallet/wallet_worker_script.js +2 -2
  128. package/dest/test-wallet/worker_wallet.d.ts +5 -4
  129. package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
  130. package/dest/test-wallet/worker_wallet.js +5 -1
  131. package/dest/test-wallet/worker_wallet_schema.d.ts +110 -224
  132. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
  133. package/dest/test-wallet/worker_wallet_schema.js +14 -2
  134. package/package.json +46 -42
  135. package/src/bench/client_flows/benchmark.ts +19 -0
  136. package/src/bench/client_flows/client_flows_benchmark.ts +59 -41
  137. package/src/bench/utils.ts +9 -3
  138. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +42 -24
  139. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +49 -11
  140. package/src/e2e_deploy_contract/deploy_test.ts +3 -2
  141. package/src/e2e_epochs/epochs_test.ts +99 -11
  142. package/src/e2e_fees/fees_test.ts +49 -9
  143. package/src/e2e_nested_contract/nested_contract_test.ts +9 -5
  144. package/src/e2e_p2p/inactivity_slash_test.ts +5 -3
  145. package/src/e2e_p2p/p2p_network.ts +82 -60
  146. package/src/e2e_p2p/reqresp/utils.ts +51 -12
  147. package/src/e2e_p2p/shared.ts +92 -64
  148. package/src/e2e_token_contract/token_contract_test.ts +28 -10
  149. package/src/fixtures/authwit_proxy.ts +4 -0
  150. package/src/fixtures/e2e_prover_test.ts +22 -19
  151. package/src/fixtures/fixtures.ts +86 -0
  152. package/src/fixtures/get_bb_config.ts +7 -6
  153. package/src/fixtures/ha_setup.ts +4 -2
  154. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  155. package/src/fixtures/setup.ts +175 -33
  156. package/src/fixtures/setup_p2p_test.ts +13 -9
  157. package/src/fixtures/token_utils.ts +1 -2
  158. package/src/fixtures/utils.ts +2 -0
  159. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  160. package/src/forward-compatibility/wallet_service.ts +104 -0
  161. package/src/guides/up_quick_start.sh +0 -2
  162. package/src/install_legacy_contracts.cjs +75 -0
  163. package/src/legacy-jest-resolver.cjs +112 -0
  164. package/src/shared/cross_chain_test_harness.ts +27 -13
  165. package/src/shared/gas_portal_test_harness.ts +21 -11
  166. package/src/shared/submit-transactions.ts +1 -4
  167. package/src/shared/uniswap_l1_l2.ts +77 -50
  168. package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
  169. package/src/simulators/lending_simulator.ts +32 -14
  170. package/src/simulators/token_simulator.ts +6 -2
  171. package/src/spartan/setup_test_wallets.ts +91 -37
  172. package/src/spartan/tx_metrics.ts +82 -24
  173. package/src/spartan/utils/config.ts +1 -0
  174. package/src/spartan/utils/index.ts +3 -0
  175. package/src/spartan/utils/nodes.ts +2 -2
  176. package/src/spartan/utils/pod_logs.ts +99 -0
  177. package/src/test-wallet/test_wallet.ts +174 -104
  178. package/src/test-wallet/utils.ts +3 -7
  179. package/src/test-wallet/wallet_worker_script.ts +2 -2
  180. package/src/test-wallet/worker_wallet.ts +9 -4
  181. package/src/test-wallet/worker_wallet_schema.ts +2 -2
@@ -7,7 +7,15 @@ import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAcc
7
7
 
8
8
  import { jest } from '@jest/globals';
9
9
 
10
- import { type EndToEndContext, deployAccounts, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
10
+ import {
11
+ type EndToEndContext,
12
+ type SetupOptions,
13
+ deployAccounts,
14
+ ensureAuthRegistryPublished,
15
+ publicDeployAccounts,
16
+ setup,
17
+ teardown,
18
+ } from '../fixtures/setup.js';
11
19
  import { mintTokensToPrivate } from '../fixtures/token_utils.js';
12
20
  import { TokenSimulator } from '../simulators/token_simulator.js';
13
21
  import type { TestWallet } from '../test-wallet/test_wallet.js';
@@ -77,28 +85,33 @@ export class TokenContractTest {
77
85
  [this.adminAddress, this.account1Address, this.account2Address] = deployedAccounts.map(acc => acc.address);
78
86
 
79
87
  this.logger.info('Applying base setup - deploying token contract');
88
+ await ensureAuthRegistryPublished(this.wallet, this.adminAddress);
80
89
  this.logger.verbose(`Public deploy accounts...`);
81
90
  await publicDeployAccounts(this.wallet, [this.adminAddress, this.account1Address]);
82
91
 
83
92
  this.logger.verbose(`Deploying TokenContract...`);
84
- this.asset = await TokenContract.deploy(
93
+ ({ contract: this.asset } = await TokenContract.deploy(
85
94
  this.wallet,
86
95
  this.adminAddress,
87
96
  TokenContractTest.TOKEN_NAME,
88
97
  TokenContractTest.TOKEN_SYMBOL,
89
98
  TokenContractTest.TOKEN_DECIMALS,
90
- ).send({ from: this.adminAddress });
99
+ ).send({ from: this.adminAddress }));
91
100
  this.logger.verbose(`Token deployed to ${this.asset.address}`);
92
101
 
93
102
  this.logger.verbose(`Deploying bad account...`);
94
- this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress });
103
+ ({ contract: this.badAccount } = await InvalidAccountContract.deploy(this.wallet).send({
104
+ from: this.adminAddress,
105
+ }));
95
106
  this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
96
107
 
97
108
  // Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
98
109
  // (so their notes are in scope), but msg_sender in the target must differ from the note owner
99
110
  // to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
100
111
  this.logger.verbose(`Deploying generic proxy...`);
101
- this.authwitProxy = await GenericProxyContract.deploy(this.wallet).send({ from: this.adminAddress });
112
+ ({ contract: this.authwitProxy } = await GenericProxyContract.deploy(this.wallet).send({
113
+ from: this.adminAddress,
114
+ }));
102
115
  this.logger.verbose(`Deployed to ${this.authwitProxy.address}.`);
103
116
 
104
117
  this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
@@ -106,13 +119,14 @@ export class TokenContractTest {
106
119
  this.account1Address,
107
120
  ]);
108
121
 
109
- expect(await this.asset.methods.get_admin().simulate({ from: this.adminAddress })).toBe(
122
+ expect((await this.asset.methods.get_admin().simulate({ from: this.adminAddress })).result).toBe(
110
123
  this.adminAddress.toBigInt(),
111
124
  );
112
125
  }
113
126
 
114
- async setup() {
127
+ async setup(opts: Partial<SetupOptions> = {}) {
115
128
  this.context = await setup(0, {
129
+ ...opts,
116
130
  metricsPort: this.metricsPort,
117
131
  fundSponsoredFPC: true,
118
132
  skipAccountDeployment: true,
@@ -140,7 +154,9 @@ export class TokenContractTest {
140
154
  await asset.methods.mint_to_public(adminAddress, amount).send({ from: adminAddress });
141
155
  tokenSim.mintPublic(adminAddress, amount);
142
156
 
143
- const publicBalance = await asset.methods.balance_of_public(adminAddress).simulate({ from: adminAddress });
157
+ const { result: publicBalance } = await asset.methods
158
+ .balance_of_public(adminAddress)
159
+ .simulate({ from: adminAddress });
144
160
  this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
145
161
  expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(adminAddress));
146
162
 
@@ -148,11 +164,13 @@ export class TokenContractTest {
148
164
  await mintTokensToPrivate(asset, adminAddress, adminAddress, amount);
149
165
  tokenSim.mintPrivate(adminAddress, amount);
150
166
 
151
- const privateBalance = await asset.methods.balance_of_private(adminAddress).simulate({ from: adminAddress });
167
+ const { result: privateBalance } = await asset.methods
168
+ .balance_of_private(adminAddress)
169
+ .simulate({ from: adminAddress });
152
170
  this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
153
171
  expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(adminAddress));
154
172
 
155
- const totalSupply = await asset.methods.total_supply().simulate({ from: adminAddress });
173
+ const { result: totalSupply } = await asset.methods.total_supply().simulate({ from: adminAddress });
156
174
  this.logger.verbose(`Total supply: ${totalSupply}`);
157
175
  expect(totalSupply).toEqual(tokenSim.totalSupply);
158
176
 
@@ -17,6 +17,10 @@ async function buildProxyCall(proxy: GenericProxyContract, action: ContractFunct
17
17
  return proxy.methods.forward_private_3(call.to, call.selector, call.args);
18
18
  } else if (argCount === 4) {
19
19
  return proxy.methods.forward_private_4(call.to, call.selector, call.args);
20
+ } else if (argCount === 5) {
21
+ return proxy.methods.forward_private_5(call.to, call.selector, call.args);
22
+ } else if (argCount === 6) {
23
+ return proxy.methods.forward_private_6(call.to, call.selector, call.args);
20
24
  }
21
25
  throw new Error(`No forward_private_${argCount} method on proxy`);
22
26
  }
@@ -4,12 +4,7 @@ import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
4
4
  import { type Logger, createLogger } from '@aztec/aztec.js/log';
5
5
  import type { AztecNode } from '@aztec/aztec.js/node';
6
6
  import { CheatCodes } from '@aztec/aztec/testing';
7
- import {
8
- BBCircuitVerifier,
9
- type ClientProtocolCircuitVerifier,
10
- QueuedIVCVerifier,
11
- TestCircuitVerifier,
12
- } from '@aztec/bb-prover';
7
+ import type { ClientProtocolCircuitVerifier } from '@aztec/bb-prover';
13
8
  import { BackendType, Barretenberg } from '@aztec/bb.js';
14
9
  import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
15
10
  import { Buffer32 } from '@aztec/foundation/buffer';
@@ -29,6 +24,7 @@ import { getACVMConfig } from './get_acvm_config.js';
29
24
  import { getBBConfig } from './get_bb_config.js';
30
25
  import {
31
26
  type EndToEndContext,
27
+ type SetupOptions,
32
28
  deployAccounts,
33
29
  getPrivateKeyFromIndex,
34
30
  getSponsoredFPCAddress,
@@ -68,7 +64,10 @@ export class FullProverTest {
68
64
  private provenComponents: ProvenSetup[] = [];
69
65
  private bbConfigCleanup?: () => Promise<void>;
70
66
  private acvmConfigCleanup?: () => Promise<void>;
71
- circuitProofVerifier?: ClientProtocolCircuitVerifier;
67
+ /** Returns the proof verifier from the prover node (for test assertions). */
68
+ get circuitProofVerifier(): ClientProtocolCircuitVerifier | undefined {
69
+ return this.proverAztecNode?.getProofVerifier();
70
+ }
72
71
  provenAsset!: TokenContract;
73
72
  context!: EndToEndContext;
74
73
  private proverAztecNode!: AztecNodeService;
@@ -112,7 +111,7 @@ export class FullProverTest {
112
111
  FullProverTest.TOKEN_NAME,
113
112
  FullProverTest.TOKEN_SYMBOL,
114
113
  FullProverTest.TOKEN_DECIMALS,
115
- ).send({ from: this.accounts[0], wait: { returnReceipt: true } });
114
+ ).send({ from: this.accounts[0] });
116
115
  this.logger.verbose(`Token deployed to ${asset.address}`);
117
116
 
118
117
  this.fakeProofsAsset = asset;
@@ -121,14 +120,15 @@ export class FullProverTest {
121
120
 
122
121
  this.tokenSim = new TokenSimulator(this.fakeProofsAsset, this.wallet, this.accounts[0], this.logger, this.accounts);
123
122
 
124
- expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0] })).toBe(
123
+ expect((await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0] })).result).toBe(
125
124
  this.accounts[0].toBigInt(),
126
125
  );
127
126
  }
128
127
 
129
- async setup() {
128
+ async setup(opts: Partial<SetupOptions> = {}) {
130
129
  this.logger.info('Setting up subsystems from fresh');
131
130
  this.context = await setup(0, {
131
+ ...opts,
132
132
  startProverNode: true,
133
133
  coinbase: this.coinbase,
134
134
  fundSponsoredFPC: true,
@@ -168,9 +168,6 @@ export class FullProverTest {
168
168
 
169
169
  await Barretenberg.initSingleton({ backend: BackendType.NativeUnixSocket });
170
170
 
171
- const verifier = await BBCircuitVerifier.new(bbConfig);
172
- this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
173
-
174
171
  this.logger.debug(`Configuring the node for real proofs...`);
175
172
  await this.aztecNodeAdmin.setConfig({
176
173
  realProofs: true,
@@ -178,7 +175,6 @@ export class FullProverTest {
178
175
  });
179
176
  } else {
180
177
  this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
181
- this.circuitProofVerifier = new TestCircuitVerifier();
182
178
  await this.aztecNodeAdmin.setConfig({
183
179
  minTxsPerBlock: this.minNumberOfTxsPerBlock,
184
180
  });
@@ -229,8 +225,11 @@ export class FullProverTest {
229
225
 
230
226
  this.logger.verbose('Starting prover node');
231
227
  const sponsoredFPCAddress = await getSponsoredFPCAddress();
232
- const { prefilledPublicData } = await getGenesisValues(
228
+ const { genesis } = await getGenesisValues(
233
229
  this.context.initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
230
+ undefined,
231
+ undefined,
232
+ this.context.genesis!.genesisTimestamp,
234
233
  );
235
234
 
236
235
  const proverNodeConfig: Parameters<typeof AztecNodeService.createAndSync>[0] = {
@@ -258,7 +257,7 @@ export class FullProverTest {
258
257
  this.proverAztecNode = await AztecNodeService.createAndSync(
259
258
  proverNodeConfig,
260
259
  { dateProvider: this.context.dateProvider, p2pClientDeps: { rpcTxProviders: [this.aztecNode] } },
261
- { prefilledPublicData },
260
+ { genesis },
262
261
  );
263
262
  this.logger.warn(`Proofs are now enabled`, { realProofs: this.realProofs });
264
263
  return this;
@@ -310,16 +309,20 @@ export class FullProverTest {
310
309
  } = this;
311
310
  tokenSim.mintPublic(address, publicAmount);
312
311
 
313
- const publicBalance = await fakeProofsAsset.methods.balance_of_public(address).simulate({ from: address });
312
+ const { result: publicBalance } = await fakeProofsAsset.methods
313
+ .balance_of_public(address)
314
+ .simulate({ from: address });
314
315
  this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
315
316
  expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(address));
316
317
 
317
318
  tokenSim.mintPrivate(address, publicAmount);
318
- const privateBalance = await fakeProofsAsset.methods.balance_of_private(address).simulate({ from: address });
319
+ const { result: privateBalance } = await fakeProofsAsset.methods
320
+ .balance_of_private(address)
321
+ .simulate({ from: address });
319
322
  this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
320
323
  expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
321
324
 
322
- const totalSupply = await fakeProofsAsset.methods.total_supply().simulate({ from: address });
325
+ const { result: totalSupply } = await fakeProofsAsset.methods.total_supply().simulate({ from: address });
323
326
  this.logger.verbose(`Total supply: ${totalSupply}`);
324
327
  expect(totalSupply).toEqual(tokenSim.totalSupply);
325
328
  }
@@ -1,5 +1,91 @@
1
+ import type { AztecNode } from '@aztec/aztec.js/node';
2
+ import type { GasFees } from '@aztec/stdlib/gas';
3
+
1
4
  export const METRICS_PORT = 4318;
2
5
 
6
+ /** Default fee padding applied to predicted min fees in e2e tests. */
7
+ export const DEFAULT_MIN_FEE_PADDING = 5;
8
+
9
+ /**
10
+ * Large fee padding for txs that may be mined significantly later than when they were created,
11
+ * such as cloned txs in throughput/capacity benchmarks, where fees may spike between creation and mining.
12
+ */
13
+ export const LARGE_MIN_FEE_PADDING = 15;
14
+
15
+ /**
16
+ * Fee padding used by tests running under proposer pipelining. Under pipelining the fee-asset
17
+ * price modifier evolves faster across the build/publish gap, so client-set maxFeesPerGas (sized
18
+ * for the default 5x padding) was getting bumped past by the time the tx mined a few slots later.
19
+ * Observed worst case in CI: fee evolved ~20x between PXE snapshot and inclusion, exceeding even
20
+ * LARGE_MIN_FEE_PADDING (15x).
21
+ */
22
+ export const PIPELINED_FEE_PADDING = 30;
23
+
24
+ /**
25
+ * Setup option preset that opts a test into proposer pipelining. Use with `setup()`:
26
+ *
27
+ * await setup(N, { ...PIPELINING_SETUP_OPTS, ...otherOpts });
28
+ *
29
+ * The preset sets:
30
+ * - `enableProposerPipelining: true` so the sequencer builds for `slot + 1`.
31
+ * - `inboxLag: 2` so the sequencer sources L1->L2 messages from checkpoint N-1 (already sealed),
32
+ * avoiding `L1ToL2MessagesNotReadyError` when building for slot N during slot N-1.
33
+ * - `minTxsPerBlock: 0` so empty checkpoints land even when a tx arrives late in the build window
34
+ * (otherwise the chain stalls on alternating slots).
35
+ * - `aztecSlotDuration: 12` / `ethereumSlotDuration: 4` so the pipelined cycle fits inside the
36
+ * default 300s Jest hook budget. Tests that depend on the env-default 72s/12s should override.
37
+ * - `walletMinFeePadding: PIPELINED_FEE_PADDING` (30x) to absorb the wider fee evolution window.
38
+ */
39
+ export const PIPELINING_SETUP_OPTS = {
40
+ enableProposerPipelining: true,
41
+ inboxLag: 2,
42
+ minTxsPerBlock: 0,
43
+ aztecSlotDuration: 12,
44
+ ethereumSlotDuration: 4,
45
+ walletMinFeePadding: PIPELINED_FEE_PADDING,
46
+ } as const;
47
+
48
+ /**
49
+ * Setup option preset that opts a test into the deterministic AutomineSequencer path.
50
+ * Use only for single-sequencer tests that don't exercise block-building or consensus
51
+ * (e.g. e2e_token, e2e_amm, e2e_authwit). Not compatible with `e2e_p2p/*`,
52
+ * `e2e_epochs/*`, `e2e_slashing/*`, `e2e_block_building`, or any multi-validator suite.
53
+ *
54
+ * await setup(N, { ...AUTOMINE_E2E_OPTS, ...otherOpts });
55
+ *
56
+ * The preset:
57
+ * - Swaps the production Sequencer for an AutomineSequencer that builds one block per
58
+ * submitted tx, publishes synchronously to L1, and owns all time control through a
59
+ * serial queue (see `sequencer-client/src/sequencer/automine/automine_sequencer.ts`).
60
+ * - Disables the validator client and AnvilTestWatcher (the AutomineSequencer needs
61
+ * neither).
62
+ * - Disables proposer pipelining and uses `inboxLag: 1` (synchronous, non-pipelined).
63
+ * - Switches anvil into automine mode at setup time (no interval mining); each L1 tx
64
+ * mines an L1 block immediately.
65
+ *
66
+ * Requires `aztecTargetCommitteeSize: 0`, which is the e2e default at `setup.ts:317`.
67
+ */
68
+ export const AUTOMINE_E2E_OPTS = {
69
+ useAutomineSequencer: true,
70
+ disableAnvilTestWatcher: true,
71
+ enableProposerPipelining: false,
72
+ inboxLag: 1,
73
+ minTxsPerBlock: 0,
74
+ aztecSlotDuration: 12,
75
+ ethereumSlotDuration: 4,
76
+ walletMinFeePadding: PIPELINED_FEE_PADDING,
77
+ } as const;
78
+
79
+ /** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */
80
+ export async function getPaddedMaxFeesPerGas(node: AztecNode, padding = DEFAULT_MIN_FEE_PADDING): Promise<GasFees> {
81
+ const predicted = await node.getPredictedMinFees();
82
+ const worstCase =
83
+ predicted.length > 0
84
+ ? predicted.reduce((worst, fees) => (fees.feePerL2Gas > worst.feePerL2Gas ? fees : worst))
85
+ : await node.getCurrentMinFees();
86
+ return worstCase.mul(1 + padding);
87
+ }
88
+
3
89
  export const shouldCollectMetrics = () => {
4
90
  if (process.env.COLLECT_METRICS) {
5
91
  return METRICS_PORT;
@@ -13,8 +13,10 @@ const {
13
13
  BB_SKIP_CLEANUP = '',
14
14
  TEMP_DIR = tmpdir(),
15
15
  BB_WORKING_DIRECTORY = '',
16
- BB_NUM_IVC_VERIFIERS = '1',
16
+ BB_NUM_IVC_VERIFIERS = '8',
17
17
  BB_IVC_CONCURRENCY = '1',
18
+ BB_CHONK_VERIFY_MAX_BATCH = '16',
19
+ BB_CHONK_VERIFY_BATCH_CONCURRENCY = '6',
18
20
  } = process.env;
19
21
 
20
22
  export const getBBConfig = async (
@@ -41,16 +43,15 @@ export const getBBConfig = async (
41
43
  const bbSkipCleanup = ['1', 'true'].includes(BB_SKIP_CLEANUP);
42
44
  const cleanup = bbSkipCleanup ? () => Promise.resolve() : () => tryRmDir(directoryToCleanup);
43
45
 
44
- const numIvcVerifiers = Number(BB_NUM_IVC_VERIFIERS);
45
- const ivcConcurrency = Number(BB_IVC_CONCURRENCY);
46
-
47
46
  return {
48
47
  bbSkipCleanup,
49
48
  bbBinaryPath,
50
49
  bbWorkingDirectory,
51
50
  cleanup,
52
- numConcurrentIVCVerifiers: numIvcVerifiers,
53
- bbIVCConcurrency: ivcConcurrency,
51
+ numConcurrentIVCVerifiers: Number(BB_NUM_IVC_VERIFIERS),
52
+ bbIVCConcurrency: Number(BB_IVC_CONCURRENCY),
53
+ bbChonkVerifyMaxBatch: Number(BB_CHONK_VERIFY_MAX_BATCH),
54
+ bbChonkVerifyConcurrency: Number(BB_CHONK_VERIFY_BATCH_CONCURRENCY),
54
55
  };
55
56
  } catch (err) {
56
57
  logger.error(`Native BB not available, error: ${err}`);
@@ -11,7 +11,7 @@ import { privateKeyToAccount } from 'viem/accounts';
11
11
  */
12
12
  export interface HADatabaseConfig {
13
13
  /** PostgreSQL connection URL */
14
- databaseUrl: string;
14
+ databaseUrl: SecretValue<string>;
15
15
  /** Node ID for HA coordination */
16
16
  nodeId: string;
17
17
  /** Enable HA signing */
@@ -28,7 +28,9 @@ export interface HADatabaseConfig {
28
28
  * Get database configuration from environment variables
29
29
  */
30
30
  export function createHADatabaseConfig(nodeId: string): HADatabaseConfig {
31
- const databaseUrl = process.env.DATABASE_URL || 'postgresql://aztec:aztec@localhost:5432/aztec_ha_test';
31
+ const databaseUrl = new SecretValue(
32
+ process.env.DATABASE_URL || 'postgresql://aztec:aztec@localhost:5432/aztec_ha_test',
33
+ );
32
34
 
33
35
  return {
34
36
  databaseUrl,
@@ -0,0 +1,49 @@
1
+ import { DefaultAccountContract } from '@aztec/accounts/defaults';
2
+ import type { ContractArtifact } from '@aztec/aztec.js/abi';
3
+ import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
4
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
5
+ import { AuthWitness } from '@aztec/aztec.js/authorization';
6
+ import type { Fr } from '@aztec/aztec.js/fields';
7
+ import { Schnorr } from '@aztec/foundation/crypto/schnorr';
8
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
9
+ import { SchnorrHardcodedAccountContractArtifact } from '@aztec/noir-contracts.js/SchnorrHardcodedAccount';
10
+
11
+ /**
12
+ * The private key that matches the hardcoded public key in the SchnorrHardcodedAccountContract.
13
+ * The corresponding public key is baked into the Noir contract as a global constant.
14
+ */
15
+ export const SCHNORR_HARDCODED_PRIVATE_KEY = GrumpkinScalar.fromHexString(
16
+ '0xd35d743ac0dfe3d6dbe6be8c877cb524a00ab1e3d52d7bada095dfc8894ccfa',
17
+ );
18
+
19
+ /**
20
+ * Account contract backed by the SchnorrHardcodedAccount Noir contract.
21
+ * This contract verifies Schnorr signatures against a public key that is hardcoded
22
+ * in the contract artifact (not stored in a note), so it does not require on-chain
23
+ * deployment or initialization. Useful for tests that need a working account without
24
+ * mining any blocks.
25
+ */
26
+ export class SchnorrHardcodedKeyAccountContract extends DefaultAccountContract {
27
+ constructor(private privateKey: GrumpkinScalar = SCHNORR_HARDCODED_PRIVATE_KEY) {
28
+ super();
29
+ }
30
+
31
+ override getContractArtifact(): Promise<ContractArtifact> {
32
+ return Promise.resolve(SchnorrHardcodedAccountContractArtifact);
33
+ }
34
+
35
+ getInitializationFunctionAndArgs() {
36
+ return Promise.resolve(undefined);
37
+ }
38
+
39
+ getAuthWitnessProvider(_address: CompleteAddress): AuthWitnessProvider {
40
+ const privateKey = this.privateKey;
41
+ return {
42
+ async createAuthWit(messageHash: Fr): Promise<AuthWitness> {
43
+ const signer = new Schnorr();
44
+ const signature = await signer.constructSignature(messageHash, privateKey);
45
+ return new AuthWitness(messageHash, signature.toLimbFields());
46
+ },
47
+ };
48
+ }
49
+ }