@aztec/end-to-end 0.0.1-commit.2b2662070 → 0.0.1-commit.2c0ee1788

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 (64) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.js +2 -2
  2. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +1 -1
  3. package/dest/e2e_epochs/epochs_test.d.ts +16 -1
  4. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  5. package/dest/e2e_epochs/epochs_test.js +53 -5
  6. package/dest/e2e_fees/fees_test.d.ts +1 -1
  7. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  8. package/dest/e2e_fees/fees_test.js +3 -3
  9. package/dest/e2e_p2p/p2p_network.d.ts +6 -3
  10. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  11. package/dest/e2e_p2p/p2p_network.js +38 -20
  12. package/dest/e2e_p2p/reqresp/utils.d.ts +1 -1
  13. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
  14. package/dest/e2e_p2p/reqresp/utils.js +9 -6
  15. package/dest/e2e_p2p/shared.d.ts +1 -1
  16. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  17. package/dest/e2e_p2p/shared.js +20 -5
  18. package/dest/fixtures/fixtures.d.ts +12 -1
  19. package/dest/fixtures/fixtures.d.ts.map +1 -1
  20. package/dest/fixtures/fixtures.js +10 -0
  21. package/dest/fixtures/ha_setup.d.ts +2 -2
  22. package/dest/fixtures/ha_setup.d.ts.map +1 -1
  23. package/dest/fixtures/ha_setup.js +1 -1
  24. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  25. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  26. package/dest/fixtures/schnorr_hardcoded_account_contract.js +39 -0
  27. package/dest/fixtures/setup.d.ts +7 -3
  28. package/dest/fixtures/setup.d.ts.map +1 -1
  29. package/dest/fixtures/setup.js +19 -5
  30. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  31. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  32. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  33. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  34. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  35. package/dest/forward-compatibility/wallet_service.js +109 -0
  36. package/dest/shared/gas_portal_test_harness.js +1 -1
  37. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  38. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  39. package/dest/shared/uniswap_l1_l2.js +0 -4
  40. package/dest/spartan/tx_metrics.d.ts +1 -1
  41. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  42. package/dest/spartan/tx_metrics.js +18 -2
  43. package/dest/test-wallet/test_wallet.d.ts +1 -1
  44. package/dest/test-wallet/test_wallet.d.ts.map +1 -1
  45. package/dest/test-wallet/test_wallet.js +10 -4
  46. package/package.json +39 -39
  47. package/src/bench/client_flows/client_flows_benchmark.ts +2 -2
  48. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +1 -1
  49. package/src/e2e_epochs/epochs_test.ts +53 -4
  50. package/src/e2e_fees/fees_test.ts +5 -3
  51. package/src/e2e_p2p/p2p_network.ts +41 -18
  52. package/src/e2e_p2p/reqresp/utils.ts +7 -6
  53. package/src/e2e_p2p/shared.ts +17 -4
  54. package/src/fixtures/fixtures.ts +22 -0
  55. package/src/fixtures/ha_setup.ts +4 -2
  56. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  57. package/src/fixtures/setup.ts +27 -5
  58. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  59. package/src/forward-compatibility/wallet_service.ts +104 -0
  60. package/src/guides/up_quick_start.sh +0 -2
  61. package/src/shared/gas_portal_test_harness.ts +0 -1
  62. package/src/shared/uniswap_l1_l2.ts +0 -4
  63. package/src/spartan/tx_metrics.ts +16 -4
  64. package/src/test-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,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiBxF;IAED,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAE/C;IAED,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAEhD;IAED,oBAAoB,IAAI,OAAO,CAAC,WAAW,CAAC,CAE3C;IAED,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpB;IAED,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpB;CACF"}
@@ -16,6 +16,7 @@ import { deriveSigningKey } from '@aztec/stdlib/keys';
16
16
  import { SimulationOverrides } from '@aztec/stdlib/tx';
17
17
  import { mergeExecutionPayloads } from '@aztec/stdlib/tx';
18
18
  import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
19
+ import { DEFAULT_MIN_FEE_PADDING } from '../fixtures/fixtures.js';
19
20
  import { AztecNodeProxy, ProvenTx } from './utils.js';
20
21
  /**
21
22
  * Wallet implementation that stores accounts in memory and provides extra debugging
@@ -25,6 +26,7 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
25
26
  nodeRef;
26
27
  constructor(pxe, nodeRef){
27
28
  super(pxe, nodeRef), this.nodeRef = nodeRef, this.accounts = new Map(), this.simulationMode = 'kernelless';
29
+ this.minFeePadding = DEFAULT_MIN_FEE_PADDING;
28
30
  }
29
31
  static async create(node, overridePXEConfig, options = {
30
32
  loggers: {}
@@ -121,7 +123,7 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
121
123
  this.simulationMode = mode;
122
124
  }
123
125
  setMinFeePadding(value) {
124
- this.minFeePadding = value ?? 0.5;
126
+ this.minFeePadding = value ?? DEFAULT_MIN_FEE_PADDING;
125
127
  }
126
128
  getAccountFromAddress(address) {
127
129
  const entry = this.accounts.get(address?.toString() ?? '');
@@ -175,7 +177,7 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
175
177
  return account.createAuthWit(intentInnerHash, chainInfo);
176
178
  }
177
179
  async simulateViaEntrypoint(executionPayload, opts) {
178
- const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement } = opts;
180
+ const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement, sendMessagesAs } = opts;
179
181
  const scopes = this.scopesFrom(from, additionalScopes);
180
182
  const skipKernels = this.simulationMode !== 'full';
181
183
  const useOverride = this.simulationMode === 'kernelless-override';
@@ -216,7 +218,8 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
216
218
  skipFeeEnforcement,
217
219
  skipTxValidation,
218
220
  overrides,
219
- scopes
221
+ scopes,
222
+ senderForTags: this.senderForTagsFrom(from, sendMessagesAs)
220
223
  });
221
224
  const appCallOffset = await this.computeAppCallOffset(from, feeOptions);
222
225
  return TxSimulationResultWithAppOffset.fromResultAndOffset(result, appCallOffset);
@@ -228,7 +231,10 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
228
231
  gasSettings: opts.fee?.gasSettings
229
232
  });
230
233
  const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
231
- const txProvingResult = await this.pxe.proveTx(txRequest, this.scopesFrom(opts.from, opts.additionalScopes));
234
+ const txProvingResult = await this.pxe.proveTx(txRequest, {
235
+ scopes: this.scopesFrom(opts.from, opts.additionalScopes),
236
+ senderForTags: this.senderForTagsFrom(opts.from, opts.sendMessagesAs)
237
+ });
232
238
  return new ProvenTx(this.aztecNode, await txProvingResult.toTx(), txProvingResult.getOffchainEffects(), txProvingResult.stats);
233
239
  }
234
240
  getTxReceipt(txHash) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "0.0.1-commit.2b2662070",
3
+ "version": "0.0.1-commit.2c0ee1788",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "inherits": [
@@ -26,44 +26,44 @@
26
26
  "formatting": "run -T prettier --check ./src && run -T eslint ./src"
27
27
  },
28
28
  "dependencies": {
29
- "@aztec/accounts": "0.0.1-commit.2b2662070",
30
- "@aztec/archiver": "0.0.1-commit.2b2662070",
31
- "@aztec/aztec": "0.0.1-commit.2b2662070",
32
- "@aztec/aztec-node": "0.0.1-commit.2b2662070",
33
- "@aztec/aztec.js": "0.0.1-commit.2b2662070",
34
- "@aztec/bb-prover": "0.0.1-commit.2b2662070",
35
- "@aztec/bb.js": "0.0.1-commit.2b2662070",
36
- "@aztec/blob-client": "0.0.1-commit.2b2662070",
37
- "@aztec/blob-lib": "0.0.1-commit.2b2662070",
38
- "@aztec/bot": "0.0.1-commit.2b2662070",
39
- "@aztec/cli": "0.0.1-commit.2b2662070",
40
- "@aztec/constants": "0.0.1-commit.2b2662070",
41
- "@aztec/entrypoints": "0.0.1-commit.2b2662070",
42
- "@aztec/epoch-cache": "0.0.1-commit.2b2662070",
43
- "@aztec/ethereum": "0.0.1-commit.2b2662070",
44
- "@aztec/foundation": "0.0.1-commit.2b2662070",
45
- "@aztec/kv-store": "0.0.1-commit.2b2662070",
46
- "@aztec/l1-artifacts": "0.0.1-commit.2b2662070",
47
- "@aztec/node-keystore": "0.0.1-commit.2b2662070",
48
- "@aztec/noir-contracts.js": "0.0.1-commit.2b2662070",
49
- "@aztec/noir-noirc_abi": "0.0.1-commit.2b2662070",
50
- "@aztec/noir-protocol-circuits-types": "0.0.1-commit.2b2662070",
51
- "@aztec/noir-test-contracts.js": "0.0.1-commit.2b2662070",
52
- "@aztec/p2p": "0.0.1-commit.2b2662070",
53
- "@aztec/protocol-contracts": "0.0.1-commit.2b2662070",
54
- "@aztec/prover-client": "0.0.1-commit.2b2662070",
55
- "@aztec/prover-node": "0.0.1-commit.2b2662070",
56
- "@aztec/pxe": "0.0.1-commit.2b2662070",
57
- "@aztec/sequencer-client": "0.0.1-commit.2b2662070",
58
- "@aztec/simulator": "0.0.1-commit.2b2662070",
59
- "@aztec/slasher": "0.0.1-commit.2b2662070",
60
- "@aztec/stdlib": "0.0.1-commit.2b2662070",
61
- "@aztec/telemetry-client": "0.0.1-commit.2b2662070",
62
- "@aztec/validator-client": "0.0.1-commit.2b2662070",
63
- "@aztec/validator-ha-signer": "0.0.1-commit.2b2662070",
64
- "@aztec/wallet-sdk": "0.0.1-commit.2b2662070",
65
- "@aztec/wallets": "0.0.1-commit.2b2662070",
66
- "@aztec/world-state": "0.0.1-commit.2b2662070",
29
+ "@aztec/accounts": "0.0.1-commit.2c0ee1788",
30
+ "@aztec/archiver": "0.0.1-commit.2c0ee1788",
31
+ "@aztec/aztec": "0.0.1-commit.2c0ee1788",
32
+ "@aztec/aztec-node": "0.0.1-commit.2c0ee1788",
33
+ "@aztec/aztec.js": "0.0.1-commit.2c0ee1788",
34
+ "@aztec/bb-prover": "0.0.1-commit.2c0ee1788",
35
+ "@aztec/bb.js": "0.0.1-commit.2c0ee1788",
36
+ "@aztec/blob-client": "0.0.1-commit.2c0ee1788",
37
+ "@aztec/blob-lib": "0.0.1-commit.2c0ee1788",
38
+ "@aztec/bot": "0.0.1-commit.2c0ee1788",
39
+ "@aztec/cli": "0.0.1-commit.2c0ee1788",
40
+ "@aztec/constants": "0.0.1-commit.2c0ee1788",
41
+ "@aztec/entrypoints": "0.0.1-commit.2c0ee1788",
42
+ "@aztec/epoch-cache": "0.0.1-commit.2c0ee1788",
43
+ "@aztec/ethereum": "0.0.1-commit.2c0ee1788",
44
+ "@aztec/foundation": "0.0.1-commit.2c0ee1788",
45
+ "@aztec/kv-store": "0.0.1-commit.2c0ee1788",
46
+ "@aztec/l1-artifacts": "0.0.1-commit.2c0ee1788",
47
+ "@aztec/node-keystore": "0.0.1-commit.2c0ee1788",
48
+ "@aztec/noir-contracts.js": "0.0.1-commit.2c0ee1788",
49
+ "@aztec/noir-noirc_abi": "0.0.1-commit.2c0ee1788",
50
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.2c0ee1788",
51
+ "@aztec/noir-test-contracts.js": "0.0.1-commit.2c0ee1788",
52
+ "@aztec/p2p": "0.0.1-commit.2c0ee1788",
53
+ "@aztec/protocol-contracts": "0.0.1-commit.2c0ee1788",
54
+ "@aztec/prover-client": "0.0.1-commit.2c0ee1788",
55
+ "@aztec/prover-node": "0.0.1-commit.2c0ee1788",
56
+ "@aztec/pxe": "0.0.1-commit.2c0ee1788",
57
+ "@aztec/sequencer-client": "0.0.1-commit.2c0ee1788",
58
+ "@aztec/simulator": "0.0.1-commit.2c0ee1788",
59
+ "@aztec/slasher": "0.0.1-commit.2c0ee1788",
60
+ "@aztec/stdlib": "0.0.1-commit.2c0ee1788",
61
+ "@aztec/telemetry-client": "0.0.1-commit.2c0ee1788",
62
+ "@aztec/validator-client": "0.0.1-commit.2c0ee1788",
63
+ "@aztec/validator-ha-signer": "0.0.1-commit.2c0ee1788",
64
+ "@aztec/wallet-sdk": "0.0.1-commit.2c0ee1788",
65
+ "@aztec/wallets": "0.0.1-commit.2c0ee1788",
66
+ "@aztec/world-state": "0.0.1-commit.2c0ee1788",
67
67
  "@iarna/toml": "^2.2.5",
68
68
  "@jest/globals": "^30.0.0",
69
69
  "@noble/curves": "=1.0.0",
@@ -28,7 +28,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
28
28
  import { GasSettings } from '@aztec/stdlib/gas';
29
29
  import { deriveSigningKey } from '@aztec/stdlib/keys';
30
30
 
31
- import { MNEMONIC } from '../../fixtures/fixtures.js';
31
+ import { MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
32
32
  import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
33
33
  import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
34
34
  import { setupSponsoredFPC } from '../../fixtures/utils.js';
@@ -386,7 +386,7 @@ export class ClientFlowsBenchmark {
386
386
  public async getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress) {
387
387
  // The private fee paying method assembled on the app side requires knowledge of the maximum
388
388
  // fee the user is willing to pay
389
- const maxFeesPerGas = (await this.aztecNode.getCurrentMinFees()).mul(1.5);
389
+ const maxFeesPerGas = await getPaddedMaxFeesPerGas(this.aztecNode);
390
390
  const gasSettings = GasSettings.fallback({ maxFeesPerGas });
391
391
  return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
392
392
  }
@@ -98,7 +98,7 @@ export class CrossChainMessagingTest {
98
98
 
99
99
  async catchUpProvenChain() {
100
100
  const bn = await this.aztecNode.getBlockNumber();
101
- while ((await this.aztecNode.getProvenBlockNumber()) < bn) {
101
+ while ((await this.aztecNode.getBlockNumber('proven')) < bn) {
102
102
  await sleep(1000);
103
103
  }
104
104
  }
@@ -1,5 +1,7 @@
1
+ import type { InitialAccountData } from '@aztec/accounts/testing';
1
2
  import type { Archiver } from '@aztec/archiver';
2
3
  import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
4
+ import { getAccountContractAddress } from '@aztec/aztec.js/account';
3
5
  import { getTimestampRangeForEpoch } from '@aztec/aztec.js/block';
4
6
  import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
5
7
  import { Fr } from '@aztec/aztec.js/fields';
@@ -34,6 +36,10 @@ import { join } from 'path';
34
36
  import type { Hex } from 'viem';
35
37
  import { privateKeyToAccount } from 'viem/accounts';
36
38
 
39
+ import {
40
+ SCHNORR_HARDCODED_PRIVATE_KEY,
41
+ SchnorrHardcodedKeyAccountContract,
42
+ } from '../fixtures/schnorr_hardcoded_account_contract.js';
37
43
  import {
38
44
  type EndToEndContext,
39
45
  type SetupOptions,
@@ -41,6 +47,7 @@ import {
41
47
  getPrivateKeyFromIndex,
42
48
  setup,
43
49
  } from '../fixtures/utils.js';
50
+ import type { TestWallet } from '../test-wallet/test_wallet.js';
44
51
 
45
52
  export const WORLD_STATE_CHECKPOINT_HISTORY = 2;
46
53
  export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
@@ -51,6 +58,8 @@ export type EpochsTestOpts = Partial<SetupOptions> & {
51
58
  numberOfAccounts?: number;
52
59
  pxeOpts?: Partial<PXEConfig>;
53
60
  aztecSlotDurationInL1Slots?: number;
61
+ /** Skip creating/registering the hardcoded account during setup (for tests that handle accounts themselves). */
62
+ skipHardcodedAccount?: boolean;
54
63
  };
55
64
 
56
65
  export type TrackedSequencerEvent = {
@@ -121,10 +130,18 @@ export class EpochsTestContext {
121
130
  this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
122
131
  this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
123
132
 
133
+ // When skipInitialSequencer is set, auto-create a hardcoded account funded via genesis.
134
+ // This avoids needing to deploy accounts on-chain (which would require a running sequencer).
135
+ const useHardcodedAccount = opts.skipInitialSequencer && !opts.skipHardcodedAccount;
136
+ let hardcodedAccountData: InitialAccountData | undefined;
137
+ if (useHardcodedAccount) {
138
+ hardcodedAccountData = await EpochsTestContext.getHardcodedAccountData(Fr.random(), Fr.random());
139
+ }
140
+
124
141
  // Set up system without any account nor protocol contracts
125
142
  // and with faster block times and shorter epochs.
126
143
  const context = await setup(
127
- opts.numberOfAccounts ?? 0,
144
+ useHardcodedAccount ? 0 : (opts.numberOfAccounts ?? 0),
128
145
  {
129
146
  automineL1Setup: true,
130
147
  checkIntervalMs: 50,
@@ -139,15 +156,13 @@ export class EpochsTestContext {
139
156
  realProofs: false,
140
157
  startProverNode: true,
141
158
  proverTestDelayMs: opts.proverTestDelayMs ?? 0,
142
- // We use numeric incremental prover ids for simplicity, but we can switch to
143
- // using the prover's eth address if the proverId is used for something in the rollup contract
144
- // Use numeric EthAddress for deterministic prover id
145
159
  proverId: EthAddress.fromNumber(1),
146
160
  worldStateCheckpointHistory: WORLD_STATE_CHECKPOINT_HISTORY,
147
161
  exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
148
162
  slasherEnabled: false,
149
163
  l1PublishingTime,
150
164
  ...opts,
165
+ ...(hardcodedAccountData ? { initialFundedAccounts: [hardcodedAccountData], numberOfAccounts: 0 } : {}),
151
166
  },
152
167
  // Use checkpointed chain tip for PXE by default to avoid issues with blocks being dropped due to pruned anchor blocks.
153
168
  // Can be overridden via opts.pxeOpts.
@@ -155,6 +170,11 @@ export class EpochsTestContext {
155
170
  );
156
171
 
157
172
  this.context = context;
173
+
174
+ // Register the hardcoded account in PXE (local only, no on-chain deployment needed).
175
+ if (hardcodedAccountData) {
176
+ await this.registerHardcodedAccount(hardcodedAccountData);
177
+ }
158
178
  this.proverNodes = context.proverNode ? [context.proverNode] : [];
159
179
  this.nodes = context.aztecNode ? [context.aztecNode as AztecNodeService] : [];
160
180
  this.logger = context.logger;
@@ -197,6 +217,35 @@ export class EpochsTestContext {
197
217
  await this.context.teardown();
198
218
  }
199
219
 
220
+ /**
221
+ * Computes InitialAccountData for a SchnorrHardcodedKeyAccountContract.
222
+ * This contract has a hardcoded signing key and no initializer, so it can be used without
223
+ * on-chain deployment. Pass the returned data in `initialFundedAccounts` so the address
224
+ * gets funded with fee juice in genesis.
225
+ */
226
+ public static async getHardcodedAccountData(secret: Fr, salt: Fr): Promise<InitialAccountData> {
227
+ const contract = new SchnorrHardcodedKeyAccountContract();
228
+ const address = await getAccountContractAddress(contract, secret, salt);
229
+ const signingKey = SCHNORR_HARDCODED_PRIVATE_KEY;
230
+ return { secret, salt, signingKey, address };
231
+ }
232
+
233
+ /**
234
+ * Registers a SchnorrHardcodedKeyAccountContract in PXE. The account must have been funded
235
+ * at genesis (via getHardcodedAccountData). No on-chain deployment or block mining needed.
236
+ */
237
+ public async registerHardcodedAccount(accountData: InitialAccountData) {
238
+ const contract = new SchnorrHardcodedKeyAccountContract();
239
+ const wallet = this.context.wallet;
240
+ const accountManager = await (wallet as TestWallet).createAccount({
241
+ secret: accountData.secret,
242
+ salt: accountData.salt,
243
+ contract,
244
+ });
245
+ this.context.accounts = [accountManager.address];
246
+ return accountManager.address;
247
+ }
248
+
200
249
  public async createProverNode(opts: { dontStart?: boolean } & Partial<ProverNodeConfig> = {}) {
201
250
  this.logger.warn('Creating and syncing a simulated prover node...');
202
251
  const proverNodePrivateKey = this.getNextPrivateKey();
@@ -23,7 +23,7 @@ import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
23
23
 
24
24
  import { getContract } from 'viem';
25
25
 
26
- import { MNEMONIC } from '../fixtures/fixtures.js';
26
+ import { MNEMONIC, getPaddedMaxFeesPerGas } from '../fixtures/fixtures.js';
27
27
  import {
28
28
  type EndToEndContext,
29
29
  type SetupOptions,
@@ -134,7 +134,7 @@ export class FeesTest {
134
134
 
135
135
  async catchUpProvenChain() {
136
136
  const bn = await this.aztecNode.getBlockNumber();
137
- while ((await this.aztecNode.getProvenBlockNumber()) < bn) {
137
+ while ((await this.aztecNode.getBlockNumber('proven')) < bn) {
138
138
  await sleep(1000);
139
139
  }
140
140
  }
@@ -193,7 +193,9 @@ export class FeesTest {
193
193
  this.wallet = this.context.wallet;
194
194
  this.aztecNode = this.context.aztecNodeService;
195
195
  this.aztecNodeAdmin = this.context.aztecNodeService;
196
- this.gasSettings = GasSettings.fallback({ maxFeesPerGas: (await this.aztecNode.getCurrentMinFees()).mul(2) });
196
+ this.gasSettings = GasSettings.fallback({
197
+ maxFeesPerGas: await getPaddedMaxFeesPerGas(this.aztecNode),
198
+ });
197
199
  this.cheatCodes = this.context.cheatCodes;
198
200
  this.accounts = deployedAccounts.map(a => a.address);
199
201
  this.accounts.forEach((a, i) => this.logger.verbose(`Account ${i} address: ${a}`));
@@ -1,5 +1,6 @@
1
- import type { InitialAccountData } from '@aztec/accounts/testing';
1
+ import { type InitialAccountData, generateSchnorrAccounts } from '@aztec/accounts/testing';
2
2
  import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
3
+ import { getAccountContractAddress } from '@aztec/aztec.js/account';
3
4
  import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
4
5
  import { Fr } from '@aztec/aztec.js/fields';
5
6
  import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
@@ -20,7 +21,6 @@ import type { BootstrapNode } from '@aztec/p2p/bootstrap';
20
21
  import { createBootstrapNodeFromPrivateKey, getBootstrapNodeEnr } from '@aztec/p2p/test-helpers';
21
22
  import { tryStop } from '@aztec/stdlib/interfaces/server';
22
23
  import { TopicType } from '@aztec/stdlib/p2p';
23
- import { TxStatus } from '@aztec/stdlib/tx';
24
24
  import type { GenesisData } from '@aztec/stdlib/world-state';
25
25
  import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
26
26
  import { getGenesisValues } from '@aztec/world-state/testing';
@@ -29,10 +29,13 @@ import getPort from 'get-port';
29
29
  import { type GetContractReturnType, getAddress, getContract } from 'viem';
30
30
  import { privateKeyToAccount } from 'viem/accounts';
31
31
 
32
+ import {
33
+ SCHNORR_HARDCODED_PRIVATE_KEY,
34
+ SchnorrHardcodedKeyAccountContract,
35
+ } from '../fixtures/schnorr_hardcoded_account_contract.js';
32
36
  import {
33
37
  type EndToEndContext,
34
38
  type SetupOptions,
35
- deployAccounts,
36
39
  getPrivateKeyFromIndex,
37
40
  getSponsoredFPCAddress,
38
41
  setup,
@@ -71,7 +74,7 @@ export class P2PNetworkTest {
71
74
  public peerIdPrivateKeys: string[] = [];
72
75
  public validators: Operator[] = [];
73
76
 
74
- public deployedAccounts: InitialAccountData[] = [];
77
+ public hardcodedAccountData!: InitialAccountData;
75
78
  public genesis: GenesisData | undefined;
76
79
 
77
80
  // The re-execution test needs a wallet and a spam contract
@@ -124,7 +127,6 @@ export class P2PNetworkTest {
124
127
  metricsPort: metricsPort,
125
128
  numberOfInitialFundedAccounts: 2,
126
129
  startProverNode,
127
- walletMinFeePadding: 2.0,
128
130
  };
129
131
 
130
132
  this.deployL1ContractsArgs = {
@@ -187,10 +189,10 @@ export class P2PNetworkTest {
187
189
  }
188
190
 
189
191
  get fundedAccount() {
190
- if (!this.deployedAccounts[0]) {
191
- throw new Error('Call setupAccount to create a funded account.');
192
+ if (!this.hardcodedAccountData) {
193
+ throw new Error('Call setup to initialize the hardcoded account.');
192
194
  }
193
- return this.deployedAccounts[0];
195
+ return this.hardcodedAccountData;
194
196
  }
195
197
 
196
198
  async addBootstrapNode() {
@@ -298,18 +300,22 @@ export class P2PNetworkTest {
298
300
  await this._sendDummyTx(this.context.deployL1ContractsValues.l1Client);
299
301
  }
300
302
 
303
+ /** Points the wallet to a P2P-enabled node so transactions can propagate through the network. */
304
+ setupWalletOnNode(node: AztecNodeService) {
305
+ this.logger.info('Pointing wallet to a P2P-enabled node');
306
+ this.context.wallet.updateNode(node);
307
+ }
308
+
309
+ /** Registers the hardcoded account in PXE without on-chain deployment. No sequencer needed. */
301
310
  async setupAccount() {
302
- this.logger.info('Setting up account');
303
- const { deployedAccounts } = await deployAccounts(1, this.logger, {
304
- wait: {
305
- waitForStatus: TxStatus.CHECKPOINTED,
306
- },
307
- })({
308
- wallet: this.context.wallet,
309
- initialFundedAccounts: this.context.initialFundedAccounts,
311
+ this.logger.info('Registering hardcoded account (no deployment)');
312
+ const contract = new SchnorrHardcodedKeyAccountContract();
313
+ const accountManager = await (this.context.wallet as TestWallet).createAccount({
314
+ secret: this.hardcodedAccountData.secret,
315
+ salt: this.hardcodedAccountData.salt,
316
+ contract,
310
317
  });
311
- this.deployedAccounts = deployedAccounts;
312
- [{ address: this.defaultAccountAddress }] = deployedAccounts;
318
+ this.defaultAccountAddress = accountManager.address;
313
319
  this.wallet = this.context.wallet;
314
320
  }
315
321
 
@@ -350,12 +356,29 @@ export class P2PNetworkTest {
350
356
 
351
357
  async setup() {
352
358
  this.logger.info('Setting up subsystems from fresh');
359
+
360
+ // Pre-compute hardcoded account data so it gets funded in genesis.
361
+ const contract = new SchnorrHardcodedKeyAccountContract();
362
+ const secret = Fr.random();
363
+ const salt = Fr.random();
364
+ this.hardcodedAccountData = {
365
+ secret,
366
+ salt,
367
+ signingKey: SCHNORR_HARDCODED_PRIVATE_KEY,
368
+ address: await getAccountContractAddress(contract, secret, salt),
369
+ };
370
+
371
+ // Generate regular Schnorr accounts for tests that need deployable accounts (e.g. add_rollup).
372
+ const regularAccounts = await generateSchnorrAccounts(this.setupOptions.numberOfInitialFundedAccounts ?? 2);
373
+
353
374
  this.context = await setup(
354
375
  0,
355
376
  {
356
377
  ...this.setupOptions,
357
378
  fundSponsoredFPC: true,
358
379
  skipAccountDeployment: true,
380
+ skipInitialSequencer: true,
381
+ initialFundedAccounts: [...regularAccounts, this.hardcodedAccountData],
359
382
  slasherEnabled: this.setupOptions.slasherEnabled ?? this.deployL1ContractsArgs.slasherEnabled ?? false,
360
383
  aztecTargetCommitteeSize: 0,
361
384
  l1ContractsArgs: this.deployL1ContractsArgs,
@@ -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
  }
@@ -19,6 +19,7 @@ import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
19
19
  import { getRoundForOffense } from '@aztec/slasher';
20
20
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
21
21
 
22
+ import { SchnorrHardcodedKeyAccountContract } from '../fixtures/schnorr_hardcoded_account_contract.js';
22
23
  import { submitTxsTo } from '../shared/submit-transactions.js';
23
24
  import { TestWallet } from '../test-wallet/test_wallet.js';
24
25
  import { type ProvenTx, proveInteraction } from '../test-wallet/utils.js';
@@ -55,10 +56,17 @@ export const submitTransactions = async (
55
56
  rpcConfig.proverEnabled = false;
56
57
  const wallet = await TestWallet.create(
57
58
  node,
58
- { ...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' },
59
62
  { loggerActorLabel: 'pxe-tx' },
60
63
  );
61
- 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
+ });
62
70
  return submitTxsTo(wallet, fundedAccountManager.address, numTxs, logger);
63
71
  };
64
72
 
@@ -73,10 +81,15 @@ export async function prepareTransactions(
73
81
 
74
82
  const wallet = await TestWallet.create(
75
83
  node,
76
- { ...getPXEConfig(), proverEnabled: false },
84
+ { ...getPXEConfig(), proverEnabled: false, syncChainTip: 'checkpointed' },
77
85
  { loggerActorLabel: 'pxe-tx' },
78
86
  );
79
- 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
+ });
80
93
 
81
94
  const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
82
95
  salt: Fr.random(),
@@ -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;
@@ -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
+ }