@aztec/end-to-end 0.0.1-commit.5de5ca79e → 0.0.1-commit.6201a7b05

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 (109) hide show
  1. package/README.md +27 -0
  2. package/dest/bench/client_flows/client_flows_benchmark.d.ts +1 -1
  3. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  4. package/dest/bench/client_flows/client_flows_benchmark.js +15 -30
  5. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -2
  6. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  7. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +1 -1
  8. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +1 -1
  9. package/dest/e2e_epochs/epochs_test.d.ts +16 -1
  10. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  11. package/dest/e2e_epochs/epochs_test.js +56 -8
  12. package/dest/e2e_fees/fees_test.d.ts +1 -1
  13. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  14. package/dest/e2e_fees/fees_test.js +4 -4
  15. package/dest/e2e_p2p/inactivity_slash_test.js +3 -3
  16. package/dest/e2e_p2p/p2p_network.d.ts +10 -9
  17. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  18. package/dest/e2e_p2p/p2p_network.js +46 -27
  19. package/dest/e2e_p2p/reqresp/utils.d.ts +1 -1
  20. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
  21. package/dest/e2e_p2p/reqresp/utils.js +10 -7
  22. package/dest/e2e_p2p/shared.d.ts +5 -7
  23. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  24. package/dest/e2e_p2p/shared.js +36 -47
  25. package/dest/fixtures/authwit_proxy.d.ts +1 -1
  26. package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
  27. package/dest/fixtures/authwit_proxy.js +4 -0
  28. package/dest/fixtures/e2e_prover_test.d.ts +4 -3
  29. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  30. package/dest/fixtures/e2e_prover_test.js +7 -12
  31. package/dest/fixtures/fixtures.d.ts +12 -1
  32. package/dest/fixtures/fixtures.d.ts.map +1 -1
  33. package/dest/fixtures/fixtures.js +10 -0
  34. package/dest/fixtures/get_bb_config.d.ts +1 -1
  35. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  36. package/dest/fixtures/get_bb_config.js +5 -5
  37. package/dest/fixtures/ha_setup.d.ts +2 -2
  38. package/dest/fixtures/ha_setup.d.ts.map +1 -1
  39. package/dest/fixtures/ha_setup.js +1 -1
  40. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  41. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  42. package/dest/fixtures/schnorr_hardcoded_account_contract.js +39 -0
  43. package/dest/fixtures/setup.d.ts +17 -10
  44. package/dest/fixtures/setup.d.ts.map +1 -1
  45. package/dest/fixtures/setup.js +41 -22
  46. package/dest/fixtures/setup_p2p_test.d.ts +6 -6
  47. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  48. package/dest/fixtures/setup_p2p_test.js +8 -8
  49. package/dest/fixtures/token_utils.d.ts +1 -1
  50. package/dest/fixtures/token_utils.d.ts.map +1 -1
  51. package/dest/fixtures/token_utils.js +2 -5
  52. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  53. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  54. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  55. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  56. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  57. package/dest/forward-compatibility/wallet_service.js +109 -0
  58. package/dest/legacy-jest-resolver.d.cts +3 -0
  59. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  60. package/dest/shared/gas_portal_test_harness.js +1 -1
  61. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  62. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  63. package/dest/shared/uniswap_l1_l2.js +0 -4
  64. package/dest/simulators/lending_simulator.d.ts +1 -1
  65. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  66. package/dest/simulators/lending_simulator.js +2 -2
  67. package/dest/spartan/setup_test_wallets.d.ts +1 -1
  68. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  69. package/dest/spartan/setup_test_wallets.js +63 -45
  70. package/dest/spartan/tx_metrics.d.ts +1 -1
  71. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  72. package/dest/spartan/tx_metrics.js +18 -2
  73. package/dest/test-wallet/test_wallet.d.ts +16 -8
  74. package/dest/test-wallet/test_wallet.d.ts.map +1 -1
  75. package/dest/test-wallet/test_wallet.js +111 -70
  76. package/dest/test-wallet/worker_wallet.d.ts +4 -4
  77. package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
  78. package/dest/test-wallet/worker_wallet_schema.d.ts +9 -4
  79. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
  80. package/package.json +40 -39
  81. package/src/bench/client_flows/client_flows_benchmark.ts +33 -24
  82. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +3 -6
  83. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +1 -1
  84. package/src/e2e_epochs/epochs_test.ts +56 -7
  85. package/src/e2e_fees/fees_test.ts +5 -3
  86. package/src/e2e_p2p/inactivity_slash_test.ts +3 -3
  87. package/src/e2e_p2p/p2p_network.ts +57 -39
  88. package/src/e2e_p2p/reqresp/utils.ts +8 -7
  89. package/src/e2e_p2p/shared.ts +33 -61
  90. package/src/fixtures/authwit_proxy.ts +4 -0
  91. package/src/fixtures/e2e_prover_test.ts +12 -17
  92. package/src/fixtures/fixtures.ts +22 -0
  93. package/src/fixtures/get_bb_config.ts +7 -6
  94. package/src/fixtures/ha_setup.ts +4 -2
  95. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  96. package/src/fixtures/setup.ts +55 -26
  97. package/src/fixtures/setup_p2p_test.ts +9 -9
  98. package/src/fixtures/token_utils.ts +1 -4
  99. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  100. package/src/forward-compatibility/wallet_service.ts +104 -0
  101. package/src/guides/up_quick_start.sh +0 -2
  102. package/src/legacy-jest-resolver.cjs +135 -0
  103. package/src/shared/gas_portal_test_harness.ts +0 -1
  104. package/src/shared/uniswap_l1_l2.ts +0 -4
  105. package/src/simulators/lending_simulator.ts +4 -2
  106. package/src/spartan/setup_test_wallets.ts +63 -39
  107. package/src/spartan/tx_metrics.ts +16 -4
  108. package/src/test-wallet/test_wallet.ts +137 -74
  109. package/src/test-wallet/worker_wallet.ts +3 -2
@@ -91,7 +91,7 @@ export async function runReqrespTxTest(params: {
91
91
  t.bootstrapNodeEnr,
92
92
  NUM_VALIDATORS,
93
93
  BOOT_NODE_UDP_PORT,
94
- t.prefilledPublicData,
94
+ t.genesis,
95
95
  dataDir,
96
96
  shouldCollectMetrics(),
97
97
  );
@@ -194,8 +194,8 @@ export async function runReqrespTxTest(params: {
194
194
  // Wait for L1 checkpoint sync, which may lag behind P2P block propagation.
195
195
  const checkpoints = await retryUntil(
196
196
  async () => {
197
- const cps = await nodes[0].getCheckpoints(CheckpointNumber(1), 50);
198
- return cps.length > 0 && cps.some(cp => cp.checkpoint.blocks.length >= 2) ? cps : undefined;
197
+ const cps = await nodes[0].getCheckpoints(CheckpointNumber(1), 50, { includeBlocks: true });
198
+ return cps.length > 0 && cps.some(cp => (cp.blocks?.length ?? 0) >= 2) ? cps : undefined;
199
199
  },
200
200
  'waiting for multi-block checkpoint to sync from L1',
201
201
  30,
@@ -203,16 +203,17 @@ export async function runReqrespTxTest(params: {
203
203
  );
204
204
 
205
205
  let mbpsFound = false;
206
- let expectedBlockNumber = checkpoints[0].checkpoint.blocks[0].number;
206
+ let expectedBlockNumber = checkpoints[0].blocks![0].number;
207
207
 
208
208
  for (const published of checkpoints) {
209
- const blockCount = published.checkpoint.blocks.length;
209
+ const blocks = published.blocks!;
210
+ const blockCount = blocks.length;
210
211
  mbpsFound = mbpsFound || blockCount >= 2;
211
212
 
212
213
  for (let i = 0; i < blockCount; i++) {
213
- const block = published.checkpoint.blocks[i];
214
+ const block = blocks[i];
214
215
  expect(block.indexWithinCheckpoint).toBe(i);
215
- expect(block.checkpointNumber).toBe(published.checkpoint.number);
216
+ expect(block.checkpointNumber).toBe(published.number);
216
217
  expect(block.number).toBe(expectedBlockNumber);
217
218
  expectedBlockNumber++;
218
219
  }
@@ -7,11 +7,7 @@ import type { Logger } from '@aztec/aztec.js/log';
7
7
  import { TxHash } from '@aztec/aztec.js/tx';
8
8
  import type { RollupCheatCodes } from '@aztec/aztec/testing';
9
9
  import type { EpochCacheInterface } from '@aztec/epoch-cache';
10
- import type {
11
- EmpireSlashingProposerContract,
12
- RollupContract,
13
- TallySlashingProposerContract,
14
- } from '@aztec/ethereum/contracts';
10
+ import type { RollupContract, SlashingProposerContract } from '@aztec/ethereum/contracts';
15
11
  import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
16
12
  import { timesAsync, unique } from '@aztec/foundation/collection';
17
13
  import { EthAddress } from '@aztec/foundation/eth-address';
@@ -22,8 +18,8 @@ import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.j
22
18
  import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
23
19
  import { getRoundForOffense } from '@aztec/slasher';
24
20
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
25
- import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
26
21
 
22
+ import { SchnorrHardcodedKeyAccountContract } from '../fixtures/schnorr_hardcoded_account_contract.js';
27
23
  import { submitTxsTo } from '../shared/submit-transactions.js';
28
24
  import { TestWallet } from '../test-wallet/test_wallet.js';
29
25
  import { type ProvenTx, proveInteraction } from '../test-wallet/utils.js';
@@ -60,10 +56,17 @@ export const submitTransactions = async (
60
56
  rpcConfig.proverEnabled = false;
61
57
  const wallet = await TestWallet.create(
62
58
  node,
63
- { ...getPXEConfig(), proverEnabled: false },
59
+ // Use checkpointed chain tip to avoid anchoring on provisional blocks that the archiver can prune
60
+ // when their slot ends without a checkpoint landing on L1.
61
+ { ...getPXEConfig(), proverEnabled: false, syncChainTip: 'checkpointed' },
64
62
  { loggerActorLabel: 'pxe-tx' },
65
63
  );
66
- const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
64
+ const contract = new SchnorrHardcodedKeyAccountContract();
65
+ const fundedAccountManager = await wallet.createAccount({
66
+ secret: fundedAccount.secret,
67
+ salt: fundedAccount.salt,
68
+ contract,
69
+ });
67
70
  return submitTxsTo(wallet, fundedAccountManager.address, numTxs, logger);
68
71
  };
69
72
 
@@ -78,10 +81,15 @@ export async function prepareTransactions(
78
81
 
79
82
  const wallet = await TestWallet.create(
80
83
  node,
81
- { ...getPXEConfig(), proverEnabled: false },
84
+ { ...getPXEConfig(), proverEnabled: false, syncChainTip: 'checkpointed' },
82
85
  { loggerActorLabel: 'pxe-tx' },
83
86
  );
84
- const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
87
+ const accountContract = new SchnorrHardcodedKeyAccountContract();
88
+ const fundedAccountManager = await wallet.createAccount({
89
+ secret: fundedAccount.secret,
90
+ salt: fundedAccount.salt,
91
+ contract: accountContract,
92
+ });
85
93
 
86
94
  const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
87
95
  salt: Fr.random(),
@@ -99,7 +107,7 @@ export async function prepareTransactions(
99
107
  }
100
108
 
101
109
  export function awaitProposalExecution(
102
- slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract,
110
+ slashingProposer: SlashingProposerContract,
103
111
  timeoutSeconds: number,
104
112
  logger: Logger,
105
113
  ): Promise<bigint> {
@@ -109,24 +117,12 @@ export function awaitProposalExecution(
109
117
  reject(new Error(`Timeout waiting for proposal execution after ${timeoutSeconds}s`));
110
118
  }, timeoutSeconds * 1000);
111
119
 
112
- if (slashingProposer.type === 'empire') {
113
- const unwatch = slashingProposer.listenToPayloadSubmitted(args => {
114
- logger.warn(`Proposal ${args.payload} from round ${args.round} executed`);
115
- clearTimeout(timeout);
116
- unwatch();
117
- resolve(args.round);
118
- });
119
- } else if (slashingProposer.type === 'tally') {
120
- const unwatch = slashingProposer.listenToRoundExecuted(args => {
121
- logger.warn(`Slash from round ${args.round} executed`);
122
- clearTimeout(timeout);
123
- unwatch();
124
- resolve(args.round);
125
- });
126
- } else {
120
+ const unwatch = slashingProposer.listenToRoundExecuted(args => {
121
+ logger.warn(`Slash from round ${args.round} executed`);
127
122
  clearTimeout(timeout);
128
- reject(new Error(`Unknown slashing proposer type: ${(slashingProposer as any).type}`));
129
- }
123
+ unwatch();
124
+ resolve(args.round);
125
+ });
130
126
  });
131
127
  }
132
128
 
@@ -245,7 +241,6 @@ export async function awaitCommitteeKicked({
245
241
  rollup,
246
242
  cheatCodes,
247
243
  committee,
248
- slashFactory,
249
244
  slashingProposer,
250
245
  slashingRoundSize,
251
246
  aztecSlotDuration,
@@ -256,8 +251,7 @@ export async function awaitCommitteeKicked({
256
251
  rollup: RollupContract;
257
252
  cheatCodes: RollupCheatCodes;
258
253
  committee: readonly `0x${string}`[];
259
- slashFactory: SlashFactoryContract;
260
- slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
254
+ slashingProposer: SlashingProposerContract | undefined;
261
255
  slashingRoundSize: number;
262
256
  aztecSlotDuration: number;
263
257
  aztecEpochDuration: number;
@@ -270,36 +264,14 @@ export async function awaitCommitteeKicked({
270
264
 
271
265
  await cheatCodes.debugRollup();
272
266
 
273
- if (slashingProposer.type === 'empire') {
274
- // Await for the slash payload to be created if empire (no payload is created on tally until execution time)
275
- const targetEpoch = EpochNumber((await cheatCodes.getEpoch()) + (await rollup.getLagInEpochsForValidatorSet()) + 1);
276
- logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
277
- await cheatCodes.advanceToEpoch(targetEpoch);
278
-
279
- const slashPayloadEvents = await retryUntil(
280
- async () => {
281
- const events = await slashFactory.getSlashPayloadCreatedEvents();
282
- return events.length > 0 ? events : undefined;
283
- },
284
- 'slash payload created',
285
- 120,
286
- 1,
287
- );
288
- expect(slashPayloadEvents.length).toBe(1);
289
- // The uniqueness check is needed since a validator may be slashed more than once on the same round (eg because they let two epochs be pruned)
290
- expect(unique(slashPayloadEvents[0].slashes.map(slash => slash.validator.toString()))).toHaveLength(
291
- committee.length,
292
- );
293
- } else {
294
- // Use the slash offset to ensure we are in the right epoch for tally
295
- const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
296
- const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
297
- const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
298
- const firstEpochInOffenseRound = offenseEpoch - (offenseEpoch % slashingRoundSizeInEpochs);
299
- const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
300
- logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
301
- await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), { offset: -aztecSlotDuration / 2 });
302
- }
267
+ // Use the slash offset to ensure we are in the right epoch for tally
268
+ const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
269
+ const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
270
+ const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
271
+ const firstEpochInOffenseRound = offenseEpoch - (offenseEpoch % slashingRoundSizeInEpochs);
272
+ const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
273
+ logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
274
+ await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), { offset: -aztecSlotDuration / 2 });
303
275
 
304
276
  const attestersPre = await rollup.getAttesters();
305
277
  expect(attestersPre.length).toBe(committee.length);
@@ -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';
@@ -68,7 +63,10 @@ export class FullProverTest {
68
63
  private provenComponents: ProvenSetup[] = [];
69
64
  private bbConfigCleanup?: () => Promise<void>;
70
65
  private acvmConfigCleanup?: () => Promise<void>;
71
- circuitProofVerifier?: ClientProtocolCircuitVerifier;
66
+ /** Returns the proof verifier from the prover node (for test assertions). */
67
+ get circuitProofVerifier(): ClientProtocolCircuitVerifier | undefined {
68
+ return this.proverAztecNode?.getProofVerifier();
69
+ }
72
70
  provenAsset!: TokenContract;
73
71
  context!: EndToEndContext;
74
72
  private proverAztecNode!: AztecNodeService;
@@ -106,15 +104,13 @@ export class FullProverTest {
106
104
  await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
107
105
 
108
106
  this.logger.info('Applying base setup: deploying token contract');
109
- const {
110
- receipt: { contract: asset, instance },
111
- } = await TokenContract.deploy(
107
+ const { contract: asset, instance } = await TokenContract.deploy(
112
108
  this.wallet,
113
109
  this.accounts[0],
114
110
  FullProverTest.TOKEN_NAME,
115
111
  FullProverTest.TOKEN_SYMBOL,
116
112
  FullProverTest.TOKEN_DECIMALS,
117
- ).send({ from: this.accounts[0], wait: { returnReceipt: true } });
113
+ ).send({ from: this.accounts[0] });
118
114
  this.logger.verbose(`Token deployed to ${asset.address}`);
119
115
 
120
116
  this.fakeProofsAsset = asset;
@@ -170,9 +166,6 @@ export class FullProverTest {
170
166
 
171
167
  await Barretenberg.initSingleton({ backend: BackendType.NativeUnixSocket });
172
168
 
173
- const verifier = await BBCircuitVerifier.new(bbConfig);
174
- this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
175
-
176
169
  this.logger.debug(`Configuring the node for real proofs...`);
177
170
  await this.aztecNodeAdmin.setConfig({
178
171
  realProofs: true,
@@ -180,7 +173,6 @@ export class FullProverTest {
180
173
  });
181
174
  } else {
182
175
  this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
183
- this.circuitProofVerifier = new TestCircuitVerifier();
184
176
  await this.aztecNodeAdmin.setConfig({
185
177
  minTxsPerBlock: this.minNumberOfTxsPerBlock,
186
178
  });
@@ -231,8 +223,11 @@ export class FullProverTest {
231
223
 
232
224
  this.logger.verbose('Starting prover node');
233
225
  const sponsoredFPCAddress = await getSponsoredFPCAddress();
234
- const { prefilledPublicData } = await getGenesisValues(
226
+ const { genesis } = await getGenesisValues(
235
227
  this.context.initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
228
+ undefined,
229
+ undefined,
230
+ this.context.genesis!.genesisTimestamp,
236
231
  );
237
232
 
238
233
  const proverNodeConfig: Parameters<typeof AztecNodeService.createAndSync>[0] = {
@@ -260,7 +255,7 @@ export class FullProverTest {
260
255
  this.proverAztecNode = await AztecNodeService.createAndSync(
261
256
  proverNodeConfig,
262
257
  { dateProvider: this.context.dateProvider, p2pClientDeps: { rpcTxProviders: [this.aztecNode] } },
263
- { prefilledPublicData },
258
+ { genesis },
264
259
  );
265
260
  this.logger.warn(`Proofs are now enabled`, { realProofs: this.realProofs });
266
261
  return this;
@@ -1,5 +1,27 @@
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
+ /** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */
16
+ export async function getPaddedMaxFeesPerGas(node: AztecNode, padding = DEFAULT_MIN_FEE_PADDING): Promise<GasFees> {
17
+ const predicted = await node.getPredictedMinFees();
18
+ const worstCase =
19
+ predicted.length > 0
20
+ ? predicted.reduce((worst, fees) => (fees.feePerL2Gas > worst.feePerL2Gas ? fees : worst))
21
+ : await node.getCurrentMinFees();
22
+ return worstCase.mul(1 + padding);
23
+ }
24
+
3
25
  export const shouldCollectMetrics = () => {
4
26
  if (process.env.COLLECT_METRICS) {
5
27
  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.toBuffer(), privateKey);
45
+ return new AuthWitness(messageHash, [...signature.toBuffer()]);
46
+ },
47
+ };
48
+ }
49
+ }