@aztec/end-to-end 0.0.1-commit.f5d02921e → 0.0.1-commit.f7ea82942

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 (87) hide show
  1. package/README.md +27 -0
  2. package/dest/bench/client_flows/client_flows_benchmark.js +3 -3
  3. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -2
  4. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  5. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +1 -1
  6. package/dest/e2e_epochs/epochs_test.d.ts +16 -1
  7. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  8. package/dest/e2e_epochs/epochs_test.js +56 -8
  9. package/dest/e2e_fees/fees_test.d.ts +1 -1
  10. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  11. package/dest/e2e_fees/fees_test.js +3 -3
  12. package/dest/e2e_p2p/inactivity_slash_test.js +2 -2
  13. package/dest/e2e_p2p/p2p_network.d.ts +10 -9
  14. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  15. package/dest/e2e_p2p/p2p_network.js +46 -27
  16. package/dest/e2e_p2p/reqresp/utils.js +1 -1
  17. package/dest/e2e_p2p/shared.d.ts +5 -7
  18. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  19. package/dest/e2e_p2p/shared.js +36 -47
  20. package/dest/fixtures/authwit_proxy.d.ts +1 -1
  21. package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
  22. package/dest/fixtures/authwit_proxy.js +4 -0
  23. package/dest/fixtures/e2e_prover_test.d.ts +1 -1
  24. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  25. package/dest/fixtures/e2e_prover_test.js +2 -2
  26. package/dest/fixtures/fixtures.d.ts +12 -1
  27. package/dest/fixtures/fixtures.d.ts.map +1 -1
  28. package/dest/fixtures/fixtures.js +10 -0
  29. package/dest/fixtures/ha_setup.d.ts +2 -2
  30. package/dest/fixtures/ha_setup.d.ts.map +1 -1
  31. package/dest/fixtures/ha_setup.js +1 -1
  32. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  33. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  34. package/dest/fixtures/schnorr_hardcoded_account_contract.js +39 -0
  35. package/dest/fixtures/setup.d.ts +17 -10
  36. package/dest/fixtures/setup.d.ts.map +1 -1
  37. package/dest/fixtures/setup.js +28 -12
  38. package/dest/fixtures/setup_p2p_test.d.ts +6 -6
  39. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  40. package/dest/fixtures/setup_p2p_test.js +8 -8
  41. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  42. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  43. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  44. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  45. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  46. package/dest/forward-compatibility/wallet_service.js +109 -0
  47. package/dest/legacy-jest-resolver.d.cts +3 -0
  48. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  49. package/dest/shared/gas_portal_test_harness.js +1 -1
  50. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  51. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  52. package/dest/shared/uniswap_l1_l2.js +0 -4
  53. package/dest/spartan/setup_test_wallets.d.ts +1 -1
  54. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  55. package/dest/spartan/setup_test_wallets.js +7 -39
  56. package/dest/test-wallet/test_wallet.d.ts +16 -8
  57. package/dest/test-wallet/test_wallet.d.ts.map +1 -1
  58. package/dest/test-wallet/test_wallet.js +85 -47
  59. package/dest/test-wallet/worker_wallet.d.ts +4 -4
  60. package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
  61. package/dest/test-wallet/worker_wallet_schema.d.ts +7 -2
  62. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
  63. package/package.json +40 -39
  64. package/src/bench/client_flows/client_flows_benchmark.ts +3 -3
  65. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +3 -6
  66. package/src/e2e_epochs/epochs_test.ts +56 -7
  67. package/src/e2e_fees/fees_test.ts +4 -2
  68. package/src/e2e_p2p/inactivity_slash_test.ts +2 -2
  69. package/src/e2e_p2p/p2p_network.ts +57 -39
  70. package/src/e2e_p2p/reqresp/utils.ts +1 -1
  71. package/src/e2e_p2p/shared.ts +33 -61
  72. package/src/fixtures/authwit_proxy.ts +4 -0
  73. package/src/fixtures/e2e_prover_test.ts +5 -2
  74. package/src/fixtures/fixtures.ts +22 -0
  75. package/src/fixtures/ha_setup.ts +4 -2
  76. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  77. package/src/fixtures/setup.ts +43 -17
  78. package/src/fixtures/setup_p2p_test.ts +9 -9
  79. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  80. package/src/forward-compatibility/wallet_service.ts +104 -0
  81. package/src/guides/up_quick_start.sh +0 -2
  82. package/src/legacy-jest-resolver.cjs +135 -0
  83. package/src/shared/gas_portal_test_harness.ts +0 -1
  84. package/src/shared/uniswap_l1_l2.ts +0 -4
  85. package/src/spartan/setup_test_wallets.ts +5 -31
  86. package/src/test-wallet/test_wallet.ts +103 -51
  87. package/src/test-wallet/worker_wallet.ts +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "0.0.1-commit.f5d02921e",
3
+ "version": "0.0.1-commit.f7ea82942",
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.f5d02921e",
30
- "@aztec/archiver": "0.0.1-commit.f5d02921e",
31
- "@aztec/aztec": "0.0.1-commit.f5d02921e",
32
- "@aztec/aztec-node": "0.0.1-commit.f5d02921e",
33
- "@aztec/aztec.js": "0.0.1-commit.f5d02921e",
34
- "@aztec/bb-prover": "0.0.1-commit.f5d02921e",
35
- "@aztec/bb.js": "0.0.1-commit.f5d02921e",
36
- "@aztec/blob-client": "0.0.1-commit.f5d02921e",
37
- "@aztec/blob-lib": "0.0.1-commit.f5d02921e",
38
- "@aztec/bot": "0.0.1-commit.f5d02921e",
39
- "@aztec/cli": "0.0.1-commit.f5d02921e",
40
- "@aztec/constants": "0.0.1-commit.f5d02921e",
41
- "@aztec/entrypoints": "0.0.1-commit.f5d02921e",
42
- "@aztec/epoch-cache": "0.0.1-commit.f5d02921e",
43
- "@aztec/ethereum": "0.0.1-commit.f5d02921e",
44
- "@aztec/foundation": "0.0.1-commit.f5d02921e",
45
- "@aztec/kv-store": "0.0.1-commit.f5d02921e",
46
- "@aztec/l1-artifacts": "0.0.1-commit.f5d02921e",
47
- "@aztec/node-keystore": "0.0.1-commit.f5d02921e",
48
- "@aztec/noir-contracts.js": "0.0.1-commit.f5d02921e",
49
- "@aztec/noir-noirc_abi": "0.0.1-commit.f5d02921e",
50
- "@aztec/noir-protocol-circuits-types": "0.0.1-commit.f5d02921e",
51
- "@aztec/noir-test-contracts.js": "0.0.1-commit.f5d02921e",
52
- "@aztec/p2p": "0.0.1-commit.f5d02921e",
53
- "@aztec/protocol-contracts": "0.0.1-commit.f5d02921e",
54
- "@aztec/prover-client": "0.0.1-commit.f5d02921e",
55
- "@aztec/prover-node": "0.0.1-commit.f5d02921e",
56
- "@aztec/pxe": "0.0.1-commit.f5d02921e",
57
- "@aztec/sequencer-client": "0.0.1-commit.f5d02921e",
58
- "@aztec/simulator": "0.0.1-commit.f5d02921e",
59
- "@aztec/slasher": "0.0.1-commit.f5d02921e",
60
- "@aztec/stdlib": "0.0.1-commit.f5d02921e",
61
- "@aztec/telemetry-client": "0.0.1-commit.f5d02921e",
62
- "@aztec/validator-client": "0.0.1-commit.f5d02921e",
63
- "@aztec/validator-ha-signer": "0.0.1-commit.f5d02921e",
64
- "@aztec/wallet-sdk": "0.0.1-commit.f5d02921e",
65
- "@aztec/wallets": "0.0.1-commit.f5d02921e",
66
- "@aztec/world-state": "0.0.1-commit.f5d02921e",
29
+ "@aztec/accounts": "0.0.1-commit.f7ea82942",
30
+ "@aztec/archiver": "0.0.1-commit.f7ea82942",
31
+ "@aztec/aztec": "0.0.1-commit.f7ea82942",
32
+ "@aztec/aztec-node": "0.0.1-commit.f7ea82942",
33
+ "@aztec/aztec.js": "0.0.1-commit.f7ea82942",
34
+ "@aztec/bb-prover": "0.0.1-commit.f7ea82942",
35
+ "@aztec/bb.js": "0.0.1-commit.f7ea82942",
36
+ "@aztec/blob-client": "0.0.1-commit.f7ea82942",
37
+ "@aztec/blob-lib": "0.0.1-commit.f7ea82942",
38
+ "@aztec/bot": "0.0.1-commit.f7ea82942",
39
+ "@aztec/cli": "0.0.1-commit.f7ea82942",
40
+ "@aztec/constants": "0.0.1-commit.f7ea82942",
41
+ "@aztec/entrypoints": "0.0.1-commit.f7ea82942",
42
+ "@aztec/epoch-cache": "0.0.1-commit.f7ea82942",
43
+ "@aztec/ethereum": "0.0.1-commit.f7ea82942",
44
+ "@aztec/foundation": "0.0.1-commit.f7ea82942",
45
+ "@aztec/kv-store": "0.0.1-commit.f7ea82942",
46
+ "@aztec/l1-artifacts": "0.0.1-commit.f7ea82942",
47
+ "@aztec/node-keystore": "0.0.1-commit.f7ea82942",
48
+ "@aztec/noir-contracts.js": "0.0.1-commit.f7ea82942",
49
+ "@aztec/noir-noirc_abi": "0.0.1-commit.f7ea82942",
50
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.f7ea82942",
51
+ "@aztec/noir-test-contracts.js": "0.0.1-commit.f7ea82942",
52
+ "@aztec/p2p": "0.0.1-commit.f7ea82942",
53
+ "@aztec/protocol-contracts": "0.0.1-commit.f7ea82942",
54
+ "@aztec/prover-client": "0.0.1-commit.f7ea82942",
55
+ "@aztec/prover-node": "0.0.1-commit.f7ea82942",
56
+ "@aztec/pxe": "0.0.1-commit.f7ea82942",
57
+ "@aztec/sequencer-client": "0.0.1-commit.f7ea82942",
58
+ "@aztec/simulator": "0.0.1-commit.f7ea82942",
59
+ "@aztec/slasher": "0.0.1-commit.f7ea82942",
60
+ "@aztec/stdlib": "0.0.1-commit.f7ea82942",
61
+ "@aztec/telemetry-client": "0.0.1-commit.f7ea82942",
62
+ "@aztec/validator-client": "0.0.1-commit.f7ea82942",
63
+ "@aztec/validator-ha-signer": "0.0.1-commit.f7ea82942",
64
+ "@aztec/wallet-sdk": "0.0.1-commit.f7ea82942",
65
+ "@aztec/wallets": "0.0.1-commit.f7ea82942",
66
+ "@aztec/world-state": "0.0.1-commit.f7ea82942",
67
67
  "@iarna/toml": "^2.2.5",
68
68
  "@jest/globals": "^30.0.0",
69
69
  "@noble/curves": "=1.0.0",
@@ -159,6 +159,7 @@
159
159
  "moduleNameMapper": {
160
160
  "^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
161
161
  },
162
+ "resolver": "<rootDir>/legacy-jest-resolver.cjs",
162
163
  "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
163
164
  "rootDir": "./src",
164
165
  "testTimeout": 120000,
@@ -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,8 +386,8 @@ 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);
390
- const gasSettings = GasSettings.default({ maxFeesPerGas });
389
+ const maxFeesPerGas = await getPaddedMaxFeesPerGas(this.aztecNode);
390
+ const gasSettings = GasSettings.fallback({ maxFeesPerGas });
391
391
  return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
392
392
  }
393
393
 
@@ -10,6 +10,7 @@ import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist'
10
10
  import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
11
11
  import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
12
12
  import type { SequencerClient } from '@aztec/sequencer-client';
13
+ import type { AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
13
14
 
14
15
  import { jest } from '@jest/globals';
15
16
 
@@ -57,7 +58,7 @@ export class BlacklistTokenContractTest {
57
58
  authwitProxy!: GenericProxyContract;
58
59
  cheatCodes!: CheatCodes;
59
60
  sequencer!: SequencerClient;
60
- aztecNode!: AztecNode;
61
+ aztecNode!: AztecNode & AztecNodeDebug;
61
62
 
62
63
  adminAddress!: AztecAddress;
63
64
  otherAddress!: AztecAddress;
@@ -68,11 +69,7 @@ export class BlacklistTokenContractTest {
68
69
  }
69
70
 
70
71
  async crossTimestampOfChange() {
71
- await this.cheatCodes.warpL2TimeAtLeastBy(
72
- this.sequencer,
73
- this.aztecNode,
74
- BlacklistTokenContractTest.CHANGE_ROLES_DELAY,
75
- );
72
+ await this.cheatCodes.warpL2TimeAtLeastBy(this.aztecNode, BlacklistTokenContractTest.CHANGE_ROLES_DELAY);
76
73
  }
77
74
 
78
75
  /**
@@ -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
- slasherFlavor: 'none',
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();
@@ -223,7 +272,7 @@ export class EpochsTestContext {
223
272
  },
224
273
  },
225
274
  {
226
- prefilledPublicData: this.context.prefilledPublicData ?? [],
275
+ genesis: this.context.genesis,
227
276
  dontStart: opts.dontStart,
228
277
  },
229
278
  ),
@@ -278,7 +327,7 @@ export class EpochsTestContext {
278
327
  slashingProtectionDb: opts.slashingProtectionDb,
279
328
  },
280
329
  {
281
- prefilledPublicData: this.context.prefilledPublicData,
330
+ genesis: this.context.genesis,
282
331
  ...opts,
283
332
  },
284
333
  ),
@@ -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,
@@ -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.default({ 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}`));
@@ -108,7 +108,7 @@ export class P2PInactivityTest {
108
108
  this.test.bootstrapNodeEnr,
109
109
  NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode),
110
110
  BOOT_NODE_UDP_PORT,
111
- this.test.prefilledPublicData,
111
+ this.test.genesis,
112
112
  this.dataDir,
113
113
  undefined,
114
114
  Number(this.keepInitialNode),
@@ -122,7 +122,7 @@ export class P2PInactivityTest {
122
122
  this.test.bootstrapNodeEnr,
123
123
  this.inactiveNodeCount,
124
124
  BOOT_NODE_UDP_PORT,
125
- this.test.prefilledPublicData,
125
+ this.test.genesis,
126
126
  this.dataDir,
127
127
  undefined,
128
128
  NUM_NODES - this.inactiveNodeCount,
@@ -1,14 +1,10 @@
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';
6
- import {
7
- type EmpireSlashingProposerContract,
8
- GSEContract,
9
- RollupContract,
10
- type TallySlashingProposerContract,
11
- } from '@aztec/ethereum/contracts';
7
+ import { GSEContract, RollupContract, type SlashingProposerContract } from '@aztec/ethereum/contracts';
12
8
  import type { Operator } from '@aztec/ethereum/deploy-aztec-l1-contracts';
13
9
  import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
14
10
  import { MultiAdderArtifact } from '@aztec/ethereum/l1-artifacts';
@@ -24,9 +20,8 @@ import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
24
20
  import type { BootstrapNode } from '@aztec/p2p/bootstrap';
25
21
  import { createBootstrapNodeFromPrivateKey, getBootstrapNodeEnr } from '@aztec/p2p/test-helpers';
26
22
  import { tryStop } from '@aztec/stdlib/interfaces/server';
27
- import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
28
23
  import { TopicType } from '@aztec/stdlib/p2p';
29
- import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
24
+ import type { GenesisData } from '@aztec/stdlib/world-state';
30
25
  import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
31
26
  import { getGenesisValues } from '@aztec/world-state/testing';
32
27
 
@@ -34,10 +29,13 @@ import getPort from 'get-port';
34
29
  import { type GetContractReturnType, getAddress, getContract } from 'viem';
35
30
  import { privateKeyToAccount } from 'viem/accounts';
36
31
 
32
+ import {
33
+ SCHNORR_HARDCODED_PRIVATE_KEY,
34
+ SchnorrHardcodedKeyAccountContract,
35
+ } from '../fixtures/schnorr_hardcoded_account_contract.js';
37
36
  import {
38
37
  type EndToEndContext,
39
38
  type SetupOptions,
40
- deployAccounts,
41
39
  getPrivateKeyFromIndex,
42
40
  getSponsoredFPCAddress,
43
41
  setup,
@@ -76,8 +74,8 @@ export class P2PNetworkTest {
76
74
  public peerIdPrivateKeys: string[] = [];
77
75
  public validators: Operator[] = [];
78
76
 
79
- public deployedAccounts: InitialAccountData[] = [];
80
- public prefilledPublicData: PublicDataTreeLeaf[] = [];
77
+ public hardcodedAccountData!: InitialAccountData;
78
+ public genesis: GenesisData | undefined;
81
79
 
82
80
  // The re-execution test needs a wallet and a spam contract
83
81
  public wallet?: TestWallet;
@@ -124,12 +122,11 @@ export class P2PNetworkTest {
124
122
  initialValidatorConfig.aztecProofSubmissionEpochs ?? l1ContractsConfig.aztecProofSubmissionEpochs,
125
123
  slashingRoundSizeInEpochs:
126
124
  initialValidatorConfig.slashingRoundSizeInEpochs ?? l1ContractsConfig.slashingRoundSizeInEpochs,
127
- slasherFlavor: initialValidatorConfig.slasherFlavor ?? 'tally',
125
+ slasherEnabled: initialValidatorConfig.slasherEnabled ?? true,
128
126
  aztecTargetCommitteeSize: numberOfValidators,
129
127
  metricsPort: metricsPort,
130
128
  numberOfInitialFundedAccounts: 2,
131
129
  startProverNode,
132
- walletMinFeePadding: 2.0,
133
130
  };
134
131
 
135
132
  this.deployL1ContractsArgs = {
@@ -137,7 +134,7 @@ export class P2PNetworkTest {
137
134
  aztecEpochDuration: initialValidatorConfig.aztecEpochDuration ?? l1ContractsConfig.aztecEpochDuration,
138
135
  slashingRoundSizeInEpochs:
139
136
  initialValidatorConfig.slashingRoundSizeInEpochs ?? l1ContractsConfig.slashingRoundSizeInEpochs,
140
- slasherFlavor: initialValidatorConfig.slasherFlavor ?? 'tally',
137
+ slasherEnabled: initialValidatorConfig.slasherEnabled ?? true,
141
138
 
142
139
  ethereumSlotDuration: initialValidatorConfig.ethereumSlotDuration ?? l1ContractsConfig.ethereumSlotDuration,
143
140
  aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
@@ -192,10 +189,10 @@ export class P2PNetworkTest {
192
189
  }
193
190
 
194
191
  get fundedAccount() {
195
- if (!this.deployedAccounts[0]) {
196
- 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.');
197
194
  }
198
- return this.deployedAccounts[0];
195
+ return this.hardcodedAccountData;
199
196
  }
200
197
 
201
198
  async addBootstrapNode() {
@@ -303,17 +300,22 @@ export class P2PNetworkTest {
303
300
  await this._sendDummyTx(this.context.deployL1ContractsValues.l1Client);
304
301
  }
305
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. */
306
310
  async setupAccount() {
307
- this.logger.info('Setting up account');
308
- const { deployedAccounts } = await deployAccounts(
309
- 1,
310
- this.logger,
311
- )({
312
- wallet: this.context.wallet,
313
- 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,
314
317
  });
315
- this.deployedAccounts = deployedAccounts;
316
- [{ address: this.defaultAccountAddress }] = deployedAccounts;
318
+ this.defaultAccountAddress = accountManager.address;
317
319
  this.wallet = this.context.wallet;
318
320
  }
319
321
 
@@ -354,13 +356,30 @@ export class P2PNetworkTest {
354
356
 
355
357
  async setup() {
356
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
+
357
374
  this.context = await setup(
358
375
  0,
359
376
  {
360
377
  ...this.setupOptions,
361
378
  fundSponsoredFPC: true,
362
379
  skipAccountDeployment: true,
363
- slasherFlavor: this.setupOptions.slasherFlavor ?? this.deployL1ContractsArgs.slasherFlavor ?? 'none',
380
+ skipInitialSequencer: true,
381
+ initialFundedAccounts: [...regularAccounts, this.hardcodedAccountData],
382
+ slasherEnabled: this.setupOptions.slasherEnabled ?? this.deployL1ContractsArgs.slasherEnabled ?? false,
364
383
  aztecTargetCommitteeSize: 0,
365
384
  l1ContractsArgs: this.deployL1ContractsArgs,
366
385
  },
@@ -372,8 +391,13 @@ export class P2PNetworkTest {
372
391
  const sponsoredFPCAddress = await getSponsoredFPCAddress();
373
392
  const initialFundedAccounts = [...this.context.initialFundedAccounts.map(a => a.address), sponsoredFPCAddress];
374
393
 
375
- const { prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
376
- this.prefilledPublicData = prefilledPublicData;
394
+ const { genesis } = await getGenesisValues(
395
+ initialFundedAccounts,
396
+ undefined,
397
+ undefined,
398
+ this.context.genesis!.genesisTimestamp,
399
+ );
400
+ this.genesis = genesis;
377
401
 
378
402
  const rollupContract = RollupContract.getFromL1ContractsValues(this.context.deployL1ContractsValues);
379
403
  this.monitor = new ChainMonitor(rollupContract, this.context.dateProvider).start();
@@ -468,8 +492,7 @@ export class P2PNetworkTest {
468
492
  async getContracts(): Promise<{
469
493
  rollup: RollupContract;
470
494
  slasherContract: GetContractReturnType<typeof SlasherAbi, ViemClient>;
471
- slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
472
- slashFactory: SlashFactoryContract;
495
+ slashingProposer: SlashingProposerContract | undefined;
473
496
  }> {
474
497
  if (!this.ctx.deployL1ContractsValues) {
475
498
  throw new Error('DeployAztecL1ContractsValues not set');
@@ -486,14 +509,9 @@ export class P2PNetworkTest {
486
509
  client: this.ctx.deployL1ContractsValues.l1Client,
487
510
  });
488
511
 
489
- // Get the actual slashing proposer from rollup (which handles both empire and tally)
512
+ // Get the actual slashing proposer from rollup
490
513
  const slashingProposer = await rollup.getSlashingProposer();
491
514
 
492
- const slashFactory = new SlashFactoryContract(
493
- this.ctx.deployL1ContractsValues.l1Client,
494
- getAddress(this.ctx.deployL1ContractsValues.l1ContractAddresses.slashFactoryAddress!.toString()),
495
- );
496
-
497
- return { rollup, slasherContract, slashingProposer, slashFactory };
515
+ return { rollup, slasherContract, slashingProposer };
498
516
  }
499
517
  }
@@ -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
  );