@aztec/end-to-end 0.85.0-nightly.20250423 → 0.85.0-nightly.20250424

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 (46) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  2. package/dest/bench/client_flows/client_flows_benchmark.js +6 -7
  3. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +2 -2
  4. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  5. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +11 -11
  6. package/dest/e2e_epochs/epochs_test.d.ts +2 -2
  7. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  8. package/dest/e2e_epochs/epochs_test.js +1 -1
  9. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  10. package/dest/e2e_fees/fees_test.js +7 -11
  11. package/dest/e2e_p2p/p2p_network.d.ts +62 -62
  12. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  13. package/dest/e2e_p2p/p2p_network.js +12 -12
  14. package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
  15. package/dest/e2e_prover/e2e_prover_test.js +5 -5
  16. package/dest/fixtures/l1_to_l2_messaging.d.ts +2 -3
  17. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  18. package/dest/fixtures/l1_to_l2_messaging.js +3 -3
  19. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  20. package/dest/fixtures/snapshot_manager.js +8 -9
  21. package/dest/fixtures/utils.d.ts.map +1 -1
  22. package/dest/fixtures/utils.js +12 -13
  23. package/dest/shared/cross_chain_test_harness.d.ts +7 -11
  24. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  25. package/dest/shared/cross_chain_test_harness.js +14 -16
  26. package/dest/shared/gas_portal_test_harness.d.ts +6 -11
  27. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  28. package/dest/shared/gas_portal_test_harness.js +8 -10
  29. package/dest/shared/uniswap_l1_l2.d.ts +3 -5
  30. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  31. package/dest/shared/uniswap_l1_l2.js +18 -19
  32. package/dest/spartan/setup_test_wallets.js +3 -3
  33. package/package.json +33 -33
  34. package/src/bench/client_flows/client_flows_benchmark.ts +6 -8
  35. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +14 -18
  36. package/src/e2e_epochs/epochs_test.ts +4 -3
  37. package/src/e2e_fees/fees_test.ts +7 -11
  38. package/src/e2e_p2p/p2p_network.ts +13 -23
  39. package/src/e2e_prover/e2e_prover_test.ts +5 -10
  40. package/src/fixtures/l1_to_l2_messaging.ts +5 -14
  41. package/src/fixtures/snapshot_manager.ts +8 -9
  42. package/src/fixtures/utils.ts +13 -15
  43. package/src/shared/cross_chain_test_harness.ts +14 -31
  44. package/src/shared/gas_portal_test_harness.ts +9 -14
  45. package/src/shared/uniswap_l1_l2.ts +25 -43
  46. package/src/spartan/setup_test_wallets.ts +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "0.85.0-nightly.20250423",
3
+ "version": "0.85.0-nightly.20250424",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "inherits": [
@@ -25,38 +25,38 @@
25
25
  "formatting": "run -T prettier --check ./src && run -T eslint ./src"
26
26
  },
27
27
  "dependencies": {
28
- "@aztec/accounts": "0.85.0-nightly.20250423",
29
- "@aztec/archiver": "0.85.0-nightly.20250423",
30
- "@aztec/aztec": "0.85.0-nightly.20250423",
31
- "@aztec/aztec-node": "0.85.0-nightly.20250423",
32
- "@aztec/aztec.js": "0.85.0-nightly.20250423",
33
- "@aztec/bb-prover": "0.85.0-nightly.20250423",
34
- "@aztec/blob-lib": "0.85.0-nightly.20250423",
35
- "@aztec/blob-sink": "0.85.0-nightly.20250423",
36
- "@aztec/bot": "0.85.0-nightly.20250423",
37
- "@aztec/cli": "0.85.0-nightly.20250423",
38
- "@aztec/constants": "0.85.0-nightly.20250423",
39
- "@aztec/entrypoints": "0.85.0-nightly.20250423",
40
- "@aztec/epoch-cache": "0.85.0-nightly.20250423",
41
- "@aztec/ethereum": "0.85.0-nightly.20250423",
42
- "@aztec/foundation": "0.85.0-nightly.20250423",
43
- "@aztec/kv-store": "0.85.0-nightly.20250423",
44
- "@aztec/l1-artifacts": "0.85.0-nightly.20250423",
45
- "@aztec/merkle-tree": "0.85.0-nightly.20250423",
46
- "@aztec/noir-contracts.js": "0.85.0-nightly.20250423",
47
- "@aztec/noir-noirc_abi": "0.85.0-nightly.20250423",
48
- "@aztec/noir-protocol-circuits-types": "0.85.0-nightly.20250423",
49
- "@aztec/p2p": "0.85.0-nightly.20250423",
50
- "@aztec/protocol-contracts": "0.85.0-nightly.20250423",
51
- "@aztec/prover-client": "0.85.0-nightly.20250423",
52
- "@aztec/prover-node": "0.85.0-nightly.20250423",
53
- "@aztec/pxe": "0.85.0-nightly.20250423",
54
- "@aztec/sequencer-client": "0.85.0-nightly.20250423",
55
- "@aztec/simulator": "0.85.0-nightly.20250423",
56
- "@aztec/stdlib": "0.85.0-nightly.20250423",
57
- "@aztec/telemetry-client": "0.85.0-nightly.20250423",
58
- "@aztec/validator-client": "0.85.0-nightly.20250423",
59
- "@aztec/world-state": "0.85.0-nightly.20250423",
28
+ "@aztec/accounts": "0.85.0-nightly.20250424",
29
+ "@aztec/archiver": "0.85.0-nightly.20250424",
30
+ "@aztec/aztec": "0.85.0-nightly.20250424",
31
+ "@aztec/aztec-node": "0.85.0-nightly.20250424",
32
+ "@aztec/aztec.js": "0.85.0-nightly.20250424",
33
+ "@aztec/bb-prover": "0.85.0-nightly.20250424",
34
+ "@aztec/blob-lib": "0.85.0-nightly.20250424",
35
+ "@aztec/blob-sink": "0.85.0-nightly.20250424",
36
+ "@aztec/bot": "0.85.0-nightly.20250424",
37
+ "@aztec/cli": "0.85.0-nightly.20250424",
38
+ "@aztec/constants": "0.85.0-nightly.20250424",
39
+ "@aztec/entrypoints": "0.85.0-nightly.20250424",
40
+ "@aztec/epoch-cache": "0.85.0-nightly.20250424",
41
+ "@aztec/ethereum": "0.85.0-nightly.20250424",
42
+ "@aztec/foundation": "0.85.0-nightly.20250424",
43
+ "@aztec/kv-store": "0.85.0-nightly.20250424",
44
+ "@aztec/l1-artifacts": "0.85.0-nightly.20250424",
45
+ "@aztec/merkle-tree": "0.85.0-nightly.20250424",
46
+ "@aztec/noir-contracts.js": "0.85.0-nightly.20250424",
47
+ "@aztec/noir-noirc_abi": "0.85.0-nightly.20250424",
48
+ "@aztec/noir-protocol-circuits-types": "0.85.0-nightly.20250424",
49
+ "@aztec/p2p": "0.85.0-nightly.20250424",
50
+ "@aztec/protocol-contracts": "0.85.0-nightly.20250424",
51
+ "@aztec/prover-client": "0.85.0-nightly.20250424",
52
+ "@aztec/prover-node": "0.85.0-nightly.20250424",
53
+ "@aztec/pxe": "0.85.0-nightly.20250424",
54
+ "@aztec/sequencer-client": "0.85.0-nightly.20250424",
55
+ "@aztec/simulator": "0.85.0-nightly.20250424",
56
+ "@aztec/stdlib": "0.85.0-nightly.20250424",
57
+ "@aztec/telemetry-client": "0.85.0-nightly.20250424",
58
+ "@aztec/validator-client": "0.85.0-nightly.20250424",
59
+ "@aztec/world-state": "0.85.0-nightly.20250424",
60
60
  "@iarna/toml": "^2.2.5",
61
61
  "@jest/globals": "^29.5.0",
62
62
  "@noble/curves": "^1.0.0",
@@ -16,7 +16,7 @@ import {
16
16
  } from '@aztec/aztec.js';
17
17
  import { CheatCodes } from '@aztec/aztec.js/testing';
18
18
  import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
19
- import { type DeployL1ContractsArgs, RollupContract, createL1Clients, deployL1Contract } from '@aztec/ethereum';
19
+ import { type DeployL1ContractsArgs, RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
20
20
  import { ChainMonitor } from '@aztec/ethereum/test';
21
21
  import { randomBytes } from '@aztec/foundation/crypto';
22
22
  import { EthAddress } from '@aztec/foundation/eth-address';
@@ -234,8 +234,7 @@ export class ClientFlowsBenchmark {
234
234
  aztecNode: context.aztecNode,
235
235
  aztecNodeAdmin: context.aztecNode,
236
236
  pxeService: context.pxe,
237
- publicClient: context.deployL1ContractsValues.publicClient,
238
- walletClient: context.deployL1ContractsValues.walletClient,
237
+ l1Client: context.deployL1ContractsValues.l1Client,
239
238
  wallet: this.adminWallet,
240
239
  logger: this.logger,
241
240
  });
@@ -314,20 +313,19 @@ export class ClientFlowsBenchmark {
314
313
  }
315
314
 
316
315
  public async createCrossChainTestHarness(owner: AccountWallet) {
317
- const { publicClient, walletClient } = createL1Clients(this.context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
316
+ const l1Client = createExtendedL1Client(this.context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
318
317
 
319
- const underlyingERC20Address = await deployL1Contract(walletClient, publicClient, TestERC20Abi, TestERC20Bytecode, [
318
+ const underlyingERC20Address = await deployL1Contract(l1Client, TestERC20Abi, TestERC20Bytecode, [
320
319
  'Underlying',
321
320
  'UND',
322
- walletClient.account.address,
321
+ l1Client.account.address,
323
322
  ]).then(({ address }) => address);
324
323
 
325
324
  this.logger.verbose(`Setting up cross chain harness...`);
326
325
  const crossChainTestHarness = await CrossChainTestHarness.new(
327
326
  this.aztecNode,
328
327
  this.pxe,
329
- publicClient,
330
- walletClient,
328
+ l1Client,
331
329
  owner,
332
330
  this.logger,
333
331
  underlyingERC20Address,
@@ -11,7 +11,7 @@ import {
11
11
  createLogger,
12
12
  } from '@aztec/aztec.js';
13
13
  import { CheatCodes } from '@aztec/aztec.js/testing';
14
- import { type ViemPublicClient, createL1Clients, deployL1Contract } from '@aztec/ethereum';
14
+ import { type ExtendedViemWalletClient, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
15
15
  import { InboxAbi, OutboxAbi, TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
16
16
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
17
17
  import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
@@ -39,7 +39,7 @@ export class CrossChainMessagingTest {
39
39
  pxe!: PXE;
40
40
  aztecNodeConfig!: AztecNodeConfig;
41
41
 
42
- publicClient!: ViemPublicClient | undefined;
42
+ l1Client!: ExtendedViemWalletClient | undefined;
43
43
 
44
44
  user1Wallet!: AccountWallet;
45
45
  user2Wallet!: AccountWallet;
@@ -109,22 +109,19 @@ export class CrossChainMessagingTest {
109
109
  this.logger.verbose(`Public deploy accounts...`);
110
110
  await publicDeployAccounts(this.wallets[0], this.accounts.slice(0, 3));
111
111
 
112
- const { publicClient, walletClient } = createL1Clients(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
112
+ this.l1Client = createExtendedL1Client(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
113
113
 
114
- const underlyingERC20Address = await deployL1Contract(
115
- walletClient,
116
- publicClient,
117
- TestERC20Abi,
118
- TestERC20Bytecode,
119
- ['Underlying', 'UND', walletClient.account.address],
120
- ).then(({ address }) => address);
114
+ const underlyingERC20Address = await deployL1Contract(this.l1Client, TestERC20Abi, TestERC20Bytecode, [
115
+ 'Underlying',
116
+ 'UND',
117
+ this.l1Client.account.address,
118
+ ]).then(({ address }) => address);
121
119
 
122
120
  this.logger.verbose(`Setting up cross chain harness...`);
123
121
  this.crossChainTestHarness = await CrossChainTestHarness.new(
124
122
  this.aztecNode,
125
123
  this.pxe,
126
- publicClient,
127
- walletClient,
124
+ this.l1Client,
128
125
  this.wallets[0],
129
126
  this.logger,
130
127
  underlyingERC20Address,
@@ -143,17 +140,17 @@ export class CrossChainMessagingTest {
143
140
  this.ownerAddress = AztecAddress.fromString(crossChainContext.ownerAddress.toString());
144
141
  const tokenPortalAddress = EthAddress.fromString(crossChainContext.tokenPortal.toString());
145
142
 
146
- const { publicClient, walletClient } = createL1Clients(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
143
+ const l1Client = createExtendedL1Client(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
147
144
 
148
145
  const inbox = getContract({
149
146
  address: this.aztecNodeConfig.l1Contracts.inboxAddress.toString(),
150
147
  abi: InboxAbi,
151
- client: walletClient,
148
+ client: l1Client,
152
149
  });
153
150
  const outbox = getContract({
154
151
  address: this.aztecNodeConfig.l1Contracts.outboxAddress.toString(),
155
152
  abi: OutboxAbi,
156
- client: walletClient,
153
+ client: l1Client,
157
154
  });
158
155
 
159
156
  this.crossChainTestHarness = new CrossChainTestHarness(
@@ -165,13 +162,12 @@ export class CrossChainMessagingTest {
165
162
  this.ethAccount,
166
163
  tokenPortalAddress,
167
164
  crossChainContext.underlying,
168
- publicClient,
169
- walletClient,
165
+ l1Client,
170
166
  this.aztecNodeConfig.l1Contracts,
171
167
  this.user1Wallet,
172
168
  );
173
169
 
174
- this.publicClient = publicClient;
170
+ this.l1Client = l1Client;
175
171
  this.inbox = inbox;
176
172
  this.outbox = outbox;
177
173
  },
@@ -1,5 +1,6 @@
1
1
  import { AztecNodeService } from '@aztec/aztec-node';
2
2
  import { Fr, type Logger, MerkleTreeId, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js';
3
+ import type { ViemClient } from '@aztec/ethereum';
3
4
  import { RollupContract } from '@aztec/ethereum/contracts';
4
5
  import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp } from '@aztec/ethereum/test';
5
6
  import { randomBytes } from '@aztec/foundation/crypto';
@@ -12,7 +13,7 @@ import type { L2BlockNumber } from '@aztec/stdlib/block';
12
13
  import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
13
14
 
14
15
  import { join } from 'path';
15
- import type { Hex, PublicClient } from 'viem';
16
+ import type { Hex } from 'viem';
16
17
 
17
18
  import {
18
19
  type EndToEndContext,
@@ -40,7 +41,7 @@ export type EpochsTestOpts = Partial<
40
41
  */
41
42
  export class EpochsTestContext {
42
43
  public context!: EndToEndContext;
43
- public l1Client!: PublicClient;
44
+ public l1Client!: ViemClient;
44
45
  public rollup!: RollupContract;
45
46
  public constants!: L1RollupConstants;
46
47
  public logger!: Logger;
@@ -92,7 +93,7 @@ export class EpochsTestContext {
92
93
  this.proverNodes = context.proverNode ? [context.proverNode] : [];
93
94
  this.nodes = context.aztecNode ? [context.aztecNode as AztecNodeService] : [];
94
95
  this.logger = context.logger;
95
- this.l1Client = context.deployL1ContractsValues.publicClient;
96
+ this.l1Client = context.deployL1ContractsValues.l1Client;
96
97
  this.rollup = RollupContract.getFromConfig(context.config);
97
98
 
98
99
  // Loop that tracks L1 and L2 block numbers and logs whenever there's a new one.
@@ -13,7 +13,7 @@ import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
13
13
  import {
14
14
  type DeployL1ContractsArgs,
15
15
  RollupContract,
16
- createL1Clients,
16
+ createExtendedL1Client,
17
17
  getPublicClient,
18
18
  l1Artifacts,
19
19
  } from '@aztec/ethereum';
@@ -150,7 +150,7 @@ export class FeesTest {
150
150
  const rewardDistributor = getContract({
151
151
  address: this.context.deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress.toString(),
152
152
  abi: l1Artifacts.rewardDistributor.contractAbi,
153
- client: this.context.deployL1ContractsValues.publicClient,
153
+ client: this.context.deployL1ContractsValues.l1Client,
154
154
  });
155
155
 
156
156
  const blockReward = await rewardDistributor.read.BLOCK_REWARD();
@@ -235,8 +235,7 @@ export class FeesTest {
235
235
  aztecNode: context.aztecNode,
236
236
  aztecNodeAdmin: context.aztecNode,
237
237
  pxeService: context.pxe,
238
- publicClient: context.deployL1ContractsValues.publicClient,
239
- walletClient: context.deployL1ContractsValues.walletClient,
238
+ l1Client: context.deployL1ContractsValues.l1Client,
240
239
  wallet: this.aliceWallet,
241
240
  logger: this.logger,
242
241
  });
@@ -295,21 +294,18 @@ export class FeesTest {
295
294
  this.bananaFPC = bananaFPC;
296
295
 
297
296
  this.getCoinbaseBalance = async () => {
298
- const { walletClient } = createL1Clients(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
297
+ const l1Client = createExtendedL1Client(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
299
298
  const gasL1 = getContract({
300
299
  address: data.l1FeeJuiceAddress.toString(),
301
300
  abi: TestERC20Abi,
302
- client: walletClient,
301
+ client: l1Client,
303
302
  });
304
303
  return await gasL1.read.balanceOf([this.coinbase.toString()]);
305
304
  };
306
305
 
307
306
  this.getCoinbaseSequencerRewards = async () => {
308
- const publicClient = getPublicClient({
309
- l1RpcUrls: context.aztecNodeConfig.l1RpcUrls,
310
- l1ChainId: context.aztecNodeConfig.l1ChainId,
311
- });
312
- const rollup = new RollupContract(publicClient, data.rollupAddress);
307
+ const l1Client = createExtendedL1Client(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
308
+ const rollup = new RollupContract(l1Client, data.rollupAddress);
313
309
  return await rollup.getSequencerRewards(this.coinbase);
314
310
  };
315
311
 
@@ -3,10 +3,9 @@ import type { InitialAccountData } from '@aztec/accounts/testing';
3
3
  import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
4
4
  import type { AccountWalletWithSecretKey } from '@aztec/aztec.js';
5
5
  import {
6
+ type ExtendedViemWalletClient,
6
7
  L1TxUtils,
7
8
  RollupContract,
8
- type ViemPublicClient,
9
- type ViemWalletClient,
10
9
  getExpectedAddress,
11
10
  getL1ContractsConfigEnvVars,
12
11
  } from '@aztec/ethereum';
@@ -197,7 +196,7 @@ export class P2PNetworkTest {
197
196
  const rollup = getContract({
198
197
  address: deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(),
199
198
  abi: RollupAbi,
200
- client: deployL1ContractsValues.walletClient,
199
+ client: deployL1ContractsValues.l1Client,
201
200
  });
202
201
 
203
202
  this.logger.verbose(`Adding ${this.numberOfNodes} validators`);
@@ -205,26 +204,23 @@ export class P2PNetworkTest {
205
204
  const stakingAsset = getContract({
206
205
  address: deployL1ContractsValues.l1ContractAddresses.stakingAssetAddress.toString(),
207
206
  abi: TestERC20Abi,
208
- client: deployL1ContractsValues.walletClient,
207
+ client: deployL1ContractsValues.l1Client,
209
208
  });
210
209
 
211
210
  const stakeNeeded = l1ContractsConfig.minimumStake * BigInt(this.numberOfNodes);
212
211
  await Promise.all(
213
212
  [
214
- await stakingAsset.write.mint(
215
- [deployL1ContractsValues.walletClient.account.address, stakeNeeded],
216
- {} as any,
217
- ),
213
+ await stakingAsset.write.mint([deployL1ContractsValues.l1Client.account.address, stakeNeeded], {} as any),
218
214
  await stakingAsset.write.approve(
219
215
  [deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(), stakeNeeded],
220
216
  {} as any,
221
217
  ),
222
- ].map(txHash => deployL1ContractsValues.publicClient.waitForTransactionReceipt({ hash: txHash })),
218
+ ].map(txHash => deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: txHash })),
223
219
  );
224
220
 
225
221
  const { validators } = this.getValidators();
226
222
  this.validators = validators;
227
- await deployL1ContractsValues.publicClient.waitForTransactionReceipt({
223
+ await deployL1ContractsValues.l1Client.waitForTransactionReceipt({
228
224
  hash: await rollup.write.cheat__InitialiseValidatorSet([this.validators]),
229
225
  });
230
226
 
@@ -238,7 +234,7 @@ export class P2PNetworkTest {
238
234
  }
239
235
 
240
236
  // Send and await a tx to make sure we mine a block for the warp to correctly progress.
241
- await this._sendDummyTx(deployL1ContractsValues.publicClient, deployL1ContractsValues.walletClient);
237
+ await this._sendDummyTx(deployL1ContractsValues.l1Client);
242
238
 
243
239
  // Set the system time in the node, only after we have warped the time and waited for a block
244
240
  // Time is only set in the NEXT block
@@ -284,11 +280,8 @@ export class P2PNetworkTest {
284
280
  'remove-inital-validator',
285
281
  async ({ deployL1ContractsValues, aztecNode, dateProvider }) => {
286
282
  // Send and await a tx to make sure we mine a block for the warp to correctly progress.
287
- const { receipt } = await this._sendDummyTx(
288
- deployL1ContractsValues.publicClient,
289
- deployL1ContractsValues.walletClient,
290
- );
291
- const block = await deployL1ContractsValues.publicClient.getBlock({
283
+ const { receipt } = await this._sendDummyTx(deployL1ContractsValues.l1Client);
284
+ const block = await deployL1ContractsValues.l1Client.getBlock({
292
285
  blockNumber: receipt.blockNumber,
293
286
  });
294
287
  dateProvider.setTime(Number(block.timestamp) * 1000);
@@ -299,16 +292,13 @@ export class P2PNetworkTest {
299
292
  }
300
293
 
301
294
  async sendDummyTx() {
302
- return await this._sendDummyTx(
303
- this.ctx.deployL1ContractsValues.publicClient,
304
- this.ctx.deployL1ContractsValues.walletClient,
305
- );
295
+ return await this._sendDummyTx(this.ctx.deployL1ContractsValues.l1Client);
306
296
  }
307
297
 
308
- private async _sendDummyTx(publicClient: ViemPublicClient, walletClient: ViemWalletClient) {
309
- const l1TxUtils = new L1TxUtils(publicClient, walletClient);
298
+ private async _sendDummyTx(l1Client: ExtendedViemWalletClient) {
299
+ const l1TxUtils = new L1TxUtils(l1Client);
310
300
  return await l1TxUtils.sendAndMonitorTransaction({
311
- to: walletClient.account!.address,
301
+ to: l1Client.account!.address,
312
302
  value: 1n,
313
303
  });
314
304
  }
@@ -316,10 +316,10 @@ export class FullProverTest {
316
316
 
317
317
  private async mintL1ERC20(recipient: Hex, amount: bigint) {
318
318
  const erc20Address = this.context.deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress;
319
- const client = this.context.deployL1ContractsValues.walletClient;
319
+ const client = this.context.deployL1ContractsValues.l1Client;
320
320
  const erc20 = getContract({ abi: TestERC20Abi, address: erc20Address.toString(), client });
321
321
  const hash = await erc20.write.mint([recipient, amount]);
322
- await this.context.deployL1ContractsValues.publicClient.waitForTransactionReceipt({ hash });
322
+ await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash });
323
323
  }
324
324
 
325
325
  snapshot = <T>(
@@ -399,19 +399,14 @@ export class FullProverTest {
399
399
  throw new Error('No verifier');
400
400
  }
401
401
 
402
- const { walletClient, publicClient, l1ContractAddresses } = this.context.deployL1ContractsValues;
402
+ const { l1Client, l1ContractAddresses } = this.context.deployL1ContractsValues;
403
403
  const rollup = getContract({
404
404
  abi: RollupAbi,
405
405
  address: l1ContractAddresses.rollupAddress.toString(),
406
- client: walletClient,
406
+ client: l1Client,
407
407
  });
408
408
 
409
- const { address: verifierAddress } = await deployL1Contract(
410
- walletClient,
411
- publicClient,
412
- HonkVerifierAbi,
413
- HonkVerifierBytecode,
414
- );
409
+ const { address: verifierAddress } = await deployL1Contract(l1Client, HonkVerifierAbi, HonkVerifierBytecode);
415
410
  this.logger.info(`Deployed honk verifier at ${verifierAddress}`);
416
411
 
417
412
  await rollup.write.setEpochVerifier([verifierAddress.toString()]);
@@ -1,9 +1,4 @@
1
- import {
2
- type L1ContractAddresses,
3
- RollupContract,
4
- type ViemPublicClient,
5
- type ViemWalletClient,
6
- } from '@aztec/ethereum';
1
+ import { type ExtendedViemWalletClient, type L1ContractAddresses, RollupContract } from '@aztec/ethereum';
7
2
  import { Fr } from '@aztec/foundation/fields';
8
3
  import { InboxAbi } from '@aztec/l1-artifacts';
9
4
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
@@ -14,23 +9,19 @@ import { decodeEventLog, getContract } from 'viem';
14
9
  export async function sendL1ToL2Message(
15
10
  message: { recipient: AztecAddress; content: Fr; secretHash: Fr },
16
11
  ctx: {
17
- walletClient: ViemWalletClient;
18
- publicClient: ViemPublicClient;
12
+ l1Client: ExtendedViemWalletClient;
19
13
  l1ContractAddresses: Pick<L1ContractAddresses, 'inboxAddress' | 'rollupAddress'>;
20
14
  },
21
15
  ) {
22
16
  const inbox = getContract({
23
17
  address: ctx.l1ContractAddresses.inboxAddress.toString(),
24
18
  abi: InboxAbi,
25
- client: ctx.walletClient,
19
+ client: ctx.l1Client,
26
20
  });
27
21
 
28
22
  const { recipient, content, secretHash } = message;
29
23
 
30
- const version = await new RollupContract(
31
- ctx.publicClient,
32
- ctx.l1ContractAddresses.rollupAddress.toString(),
33
- ).getVersion();
24
+ const version = await new RollupContract(ctx.l1Client, ctx.l1ContractAddresses.rollupAddress.toString()).getVersion();
34
25
 
35
26
  // We inject the message to Inbox
36
27
  const txHash = await inbox.write.sendL2Message([
@@ -40,7 +31,7 @@ export async function sendL1ToL2Message(
40
31
  ]);
41
32
 
42
33
  // We check that the message was correctly injected by checking the emitted event
43
- const txReceipt = await ctx.publicClient.waitForTransactionReceipt({ hash: txHash });
34
+ const txReceipt = await ctx.l1Client.waitForTransactionReceipt({ hash: txHash });
44
35
 
45
36
  // Exactly 1 event should be emitted in the transaction
46
37
  expect(txReceipt.logs.length).toBe(1);
@@ -20,7 +20,7 @@ import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/serv
20
20
  import {
21
21
  type DeployL1ContractsArgs,
22
22
  type DeployL1ContractsReturnType,
23
- createL1Clients,
23
+ createExtendedL1Client,
24
24
  getL1ContractsConfigEnvVars,
25
25
  l1Artifacts,
26
26
  } from '@aztec/ethereum';
@@ -370,7 +370,7 @@ async function setupFromFresh(
370
370
  const rewardDistributor = getContract({
371
371
  address: deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress.toString(),
372
372
  abi: l1Artifacts.rewardDistributor.contractAbi,
373
- client: deployL1ContractsValues.publicClient,
373
+ client: deployL1ContractsValues.l1Client,
374
374
  });
375
375
 
376
376
  const blockReward = await rewardDistributor.read.BLOCK_REWARD();
@@ -379,18 +379,18 @@ async function setupFromFresh(
379
379
  const feeJuice = getContract({
380
380
  address: deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress.toString(),
381
381
  abi: l1Artifacts.feeAsset.contractAbi,
382
- client: deployL1ContractsValues.walletClient,
382
+ client: deployL1ContractsValues.l1Client,
383
383
  });
384
384
 
385
385
  const rewardDistributorMintTxHash = await feeJuice.write.mint([rewardDistributor.address, mintAmount], {} as any);
386
- await deployL1ContractsValues.publicClient.waitForTransactionReceipt({ hash: rewardDistributorMintTxHash });
386
+ await deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: rewardDistributorMintTxHash });
387
387
  logger.info(`Funding rewardDistributor in ${rewardDistributorMintTxHash}`);
388
388
  }
389
389
 
390
390
  const watcher = new AnvilTestWatcher(
391
391
  new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls),
392
392
  deployL1ContractsValues.l1ContractAddresses.rollupAddress,
393
- deployL1ContractsValues.publicClient,
393
+ deployL1ContractsValues.l1Client,
394
394
  );
395
395
  await watcher.start();
396
396
 
@@ -521,12 +521,12 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
521
521
  }
522
522
 
523
523
  logger.verbose('Creating ETH clients...');
524
- const { publicClient, walletClient } = createL1Clients(aztecNodeConfig.l1RpcUrls, mnemonicToAccount(MNEMONIC));
524
+ const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, mnemonicToAccount(MNEMONIC));
525
525
 
526
526
  const watcher = new AnvilTestWatcher(
527
527
  new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls),
528
528
  aztecNodeConfig.l1Contracts.rollupAddress,
529
- publicClient,
529
+ l1Client,
530
530
  );
531
531
  await watcher.start();
532
532
 
@@ -582,8 +582,7 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
582
582
  bbConfig,
583
583
  proverNode,
584
584
  deployL1ContractsValues: {
585
- walletClient,
586
- publicClient,
585
+ l1Client,
587
586
  l1ContractAddresses: aztecNodeConfig.l1Contracts,
588
587
  },
589
588
  watcher,
@@ -36,7 +36,7 @@ import {
36
36
  type DeployL1ContractsReturnType,
37
37
  ForwarderContract,
38
38
  NULL_KEY,
39
- createL1Clients,
39
+ createExtendedL1Client,
40
40
  deployL1Contracts,
41
41
  getL1ContractsConfigEnvVars,
42
42
  isAnvilTestChain,
@@ -223,12 +223,11 @@ async function setupWithRemoteEnvironment(
223
223
  logger.verbose(`Retrieving contract addresses from ${PXE_URL}`);
224
224
  const l1Contracts = (await pxeClient.getNodeInfo()).l1ContractAddresses;
225
225
 
226
- const { walletClient, publicClient } = createL1Clients(config.l1RpcUrls, account, foundry);
226
+ const l1Client = createExtendedL1Client(config.l1RpcUrls, account, foundry);
227
227
 
228
228
  const deployL1ContractsValues: DeployL1ContractsReturnType = {
229
229
  l1ContractAddresses: l1Contracts,
230
- walletClient,
231
- publicClient,
230
+ l1Client,
232
231
  };
233
232
  const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxeClient!);
234
233
  const teardown = () => Promise.resolve();
@@ -448,7 +447,7 @@ export async function setup(
448
447
  const rewardDistributor = getContract({
449
448
  address: deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress.toString(),
450
449
  abi: l1Artifacts.rewardDistributor.contractAbi,
451
- client: deployL1ContractsValues.publicClient,
450
+ client: deployL1ContractsValues.l1Client,
452
451
  });
453
452
 
454
453
  const blockReward = await rewardDistributor.read.BLOCK_REWARD();
@@ -457,11 +456,11 @@ export async function setup(
457
456
  const feeJuice = getContract({
458
457
  address: deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress.toString(),
459
458
  abi: l1Artifacts.feeAsset.contractAbi,
460
- client: deployL1ContractsValues.walletClient,
459
+ client: deployL1ContractsValues.l1Client,
461
460
  });
462
461
 
463
462
  const rewardDistributorMintTxHash = await feeJuice.write.mint([rewardDistributor.address, mintAmount], {} as any);
464
- await deployL1ContractsValues.publicClient.waitForTransactionReceipt({ hash: rewardDistributorMintTxHash });
463
+ await deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: rewardDistributorMintTxHash });
465
464
  logger.info(`Funding rewardDistributor in ${rewardDistributorMintTxHash}`);
466
465
  }
467
466
 
@@ -476,7 +475,7 @@ export async function setup(
476
475
  const watcher = new AnvilTestWatcher(
477
476
  new EthCheatCodesWithState(config.l1RpcUrls),
478
477
  deployL1ContractsValues.l1ContractAddresses.rollupAddress,
479
- deployL1ContractsValues.publicClient,
478
+ deployL1ContractsValues.l1Client,
480
479
  dateProvider,
481
480
  );
482
481
 
@@ -826,16 +825,16 @@ export async function createAndSyncProverNode(
826
825
  },
827
826
  { prefilledPublicData },
828
827
  );
829
- getLogger().info(`Created and synced prover node`, { publisherAddress: l1TxUtils.walletClient.account.address });
828
+ getLogger().info(`Created and synced prover node`, { publisherAddress: l1TxUtils.client.account!.address });
830
829
  await proverNode.start();
831
830
  return proverNode;
832
831
  }
833
832
 
834
833
  function createDelayedL1TxUtils(aztecNodeConfig: AztecNodeConfig, privateKey: `0x${string}`, logName: string) {
835
- const { publicClient, walletClient } = createL1Clients(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
834
+ const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
836
835
 
837
836
  const log = createLogger(logName);
838
- const l1TxUtils = new DelayedTxUtils(publicClient, walletClient, log, aztecNodeConfig);
837
+ const l1TxUtils = new DelayedTxUtils(l1Client, log, aztecNodeConfig);
839
838
  l1TxUtils.enableDelayer(aztecNodeConfig.ethereumSlotDuration);
840
839
  return l1TxUtils;
841
840
  }
@@ -845,11 +844,10 @@ export async function createForwarderContract(
845
844
  privateKey: `0x${string}`,
846
845
  rollupAddress: Hex,
847
846
  ) {
848
- const { walletClient, publicClient } = createL1Clients(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
847
+ const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
849
848
  const forwarderContract = await ForwarderContract.create(
850
- walletClient.account.address,
851
- walletClient,
852
- publicClient,
849
+ l1Client.account.address,
850
+ l1Client,
853
851
  createLogger('forwarder'),
854
852
  rollupAddress,
855
853
  );