@aztec/end-to-end 0.81.0 → 0.82.1-alpha-testnet.1

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 (65) hide show
  1. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -2
  2. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  3. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +7 -7
  4. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -1
  5. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  6. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +3 -18
  7. package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -0
  8. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  9. package/dest/e2e_deploy_contract/deploy_test.js +2 -0
  10. package/dest/e2e_epochs/epochs_test.d.ts +1 -2
  11. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  12. package/dest/e2e_epochs/epochs_test.js +7 -6
  13. package/dest/e2e_fees/fees_test.d.ts +4 -0
  14. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  15. package/dest/e2e_fees/fees_test.js +41 -33
  16. package/dest/e2e_prover/e2e_prover_test.d.ts +2 -0
  17. package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
  18. package/dest/e2e_prover/e2e_prover_test.js +10 -10
  19. package/dest/e2e_token_contract/token_contract_test.d.ts +2 -1
  20. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  21. package/dest/e2e_token_contract/token_contract_test.js +3 -1
  22. package/dest/fixtures/snapshot_manager.d.ts +4 -2
  23. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  24. package/dest/fixtures/snapshot_manager.js +24 -18
  25. package/dest/fixtures/utils.d.ts +17 -6
  26. package/dest/fixtures/utils.d.ts.map +1 -1
  27. package/dest/fixtures/utils.js +50 -11
  28. package/dest/shared/capture_private_execution_steps.d.ts +7 -0
  29. package/dest/shared/capture_private_execution_steps.d.ts.map +1 -0
  30. package/dest/shared/capture_private_execution_steps.js +40 -0
  31. package/dest/shared/cross_chain_test_harness.d.ts +2 -2
  32. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  33. package/dest/shared/cross_chain_test_harness.js +16 -4
  34. package/dest/shared/gas_portal_test_harness.d.ts +11 -1
  35. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  36. package/dest/shared/gas_portal_test_harness.js +27 -12
  37. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  38. package/dest/shared/uniswap_l1_l2.js +24 -16
  39. package/dest/simulators/lending_simulator.d.ts +3 -5
  40. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  41. package/dest/simulators/lending_simulator.js +5 -13
  42. package/dest/spartan/setup_test_wallets.d.ts +1 -1
  43. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  44. package/dest/spartan/setup_test_wallets.js +6 -4
  45. package/dest/spartan/utils.d.ts +18 -5
  46. package/dest/spartan/utils.d.ts.map +1 -1
  47. package/dest/spartan/utils.js +8 -5
  48. package/package.json +33 -31
  49. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +9 -5
  50. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +3 -19
  51. package/src/e2e_deploy_contract/deploy_test.ts +3 -0
  52. package/src/e2e_epochs/epochs_test.ts +6 -5
  53. package/src/e2e_fees/fees_test.ts +53 -36
  54. package/src/e2e_prover/e2e_prover_test.ts +13 -9
  55. package/src/e2e_token_contract/token_contract_test.ts +4 -2
  56. package/src/fixtures/snapshot_manager.ts +37 -12
  57. package/src/fixtures/utils.ts +69 -12
  58. package/src/guides/up_quick_start.sh +2 -3
  59. package/src/shared/capture_private_execution_steps.ts +43 -0
  60. package/src/shared/cross_chain_test_harness.ts +14 -3
  61. package/src/shared/gas_portal_test_harness.ts +29 -9
  62. package/src/shared/uniswap_l1_l2.ts +16 -16
  63. package/src/simulators/lending_simulator.ts +7 -12
  64. package/src/spartan/setup_test_wallets.ts +7 -7
  65. package/src/spartan/utils.ts +8 -5
@@ -1,13 +1,15 @@
1
1
  import { EthAddress, Fr, L1FeeJuicePortalManager, retryUntil } from '@aztec/aztec.js';
2
+ import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
2
3
  import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
3
4
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
5
+ import { getContract } from 'viem';
4
6
  export class FeeJuicePortalTestingHarnessFactory {
5
7
  config;
6
8
  constructor(config){
7
9
  this.config = config;
8
10
  }
9
11
  async createReal() {
10
- const { aztecNode, pxeService, publicClient, walletClient, wallet, logger } = this.config;
12
+ const { aztecNode, aztecNodeAdmin, pxeService, publicClient, walletClient, wallet, logger } = this.config;
11
13
  const ethAccount = EthAddress.fromString((await walletClient.getAddresses())[0]);
12
14
  const l1ContractAddresses = (await pxeService.getNodeInfo()).l1ContractAddresses;
13
15
  const feeJuiceAddress = l1ContractAddresses.feeJuiceAddress;
@@ -16,7 +18,7 @@ export class FeeJuicePortalTestingHarnessFactory {
16
18
  throw new Error('Fee Juice portal not deployed on L1');
17
19
  }
18
20
  const gasL2 = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, wallet);
19
- return new GasBridgingTestHarness(aztecNode, pxeService, logger, gasL2, ethAccount, feeJuicePortalAddress, feeJuiceAddress, publicClient, walletClient);
21
+ return new GasBridgingTestHarness(aztecNode, aztecNodeAdmin, pxeService, logger, gasL2, ethAccount, feeJuicePortalAddress, feeJuiceAddress, l1ContractAddresses.feeAssetHandlerAddress, publicClient, walletClient);
20
22
  }
21
23
  static create(config) {
22
24
  const factory = new FeeJuicePortalTestingHarnessFactory(config);
@@ -28,39 +30,52 @@ export class FeeJuicePortalTestingHarnessFactory {
28
30
  * shared between cross chain tests.
29
31
  */ export class GasBridgingTestHarness {
30
32
  aztecNode;
33
+ aztecNodeAdmin;
31
34
  pxeService;
32
35
  logger;
33
36
  feeJuice;
34
37
  ethAccount;
35
38
  feeJuicePortalAddress;
36
39
  l1FeeJuiceAddress;
40
+ feeAssetHandlerAddress;
37
41
  publicClient;
38
42
  walletClient;
39
43
  l1TokenManager;
40
44
  feeJuicePortalManager;
41
- constructor(/** Aztec node */ aztecNode, /** Private eXecution Environment (PXE). */ pxeService, /** Logger. */ logger, /** L2 Token/Bridge contract. */ feeJuice, /** Eth account to interact with. */ ethAccount, /** Portal address. */ feeJuicePortalAddress, /** Underlying token for portal tests. */ l1FeeJuiceAddress, /** Viem Public client instance. */ publicClient, /** Viem Wallet Client instance. */ walletClient){
45
+ constructor(/** Aztec node */ aztecNode, /** Aztec node admin interface */ aztecNodeAdmin, /** Private eXecution Environment (PXE). */ pxeService, /** Logger. */ logger, /** L2 Token/Bridge contract. */ feeJuice, /** Eth account to interact with. */ ethAccount, /** Portal address. */ feeJuicePortalAddress, /** Underlying token for portal tests. */ l1FeeJuiceAddress, /** Fee asset handler address. */ feeAssetHandlerAddress, /** Viem Public client instance. */ publicClient, /** Viem Wallet Client instance. */ walletClient){
42
46
  this.aztecNode = aztecNode;
47
+ this.aztecNodeAdmin = aztecNodeAdmin;
43
48
  this.pxeService = pxeService;
44
49
  this.logger = logger;
45
50
  this.feeJuice = feeJuice;
46
51
  this.ethAccount = ethAccount;
47
52
  this.feeJuicePortalAddress = feeJuicePortalAddress;
48
53
  this.l1FeeJuiceAddress = l1FeeJuiceAddress;
54
+ this.feeAssetHandlerAddress = feeAssetHandlerAddress;
49
55
  this.publicClient = publicClient;
50
56
  this.walletClient = walletClient;
51
- this.feeJuicePortalManager = new L1FeeJuicePortalManager(this.feeJuicePortalAddress, this.l1FeeJuiceAddress, this.publicClient, this.walletClient, this.logger);
57
+ this.feeJuicePortalManager = new L1FeeJuicePortalManager(this.feeJuicePortalAddress, this.l1FeeJuiceAddress, this.feeAssetHandlerAddress, this.publicClient, this.walletClient, this.logger);
52
58
  this.l1TokenManager = this.feeJuicePortalManager.getTokenManager();
53
59
  }
54
60
  async mintTokensOnL1(amount, to = this.ethAccount) {
55
- const balanceBefore = await this.l1TokenManager.getL1TokenBalance(to.toString());
56
- await this.l1TokenManager.mint(amount, to.toString());
57
- expect(await this.l1TokenManager.getL1TokenBalance(to.toString())).toEqual(balanceBefore + amount);
61
+ // const balanceBefore = await this.l1TokenManager.getL1TokenBalance(to.toString());
62
+ await this.l1TokenManager.mint(to.toString());
63
+ const feeAssetL1 = getContract({
64
+ address: this.l1FeeJuiceAddress.toString(),
65
+ abi: TestERC20Abi,
66
+ client: this.walletClient
67
+ });
68
+ await feeAssetL1.write.mint([
69
+ to.toString(),
70
+ amount
71
+ ]);
72
+ // expect(await this.l1TokenManager.getL1TokenBalance(to.toString())).toEqual(balanceBefore + amount);
58
73
  }
59
74
  async getL1FeeJuiceBalance(address) {
60
75
  return await this.l1TokenManager.getL1TokenBalance(address.toString());
61
76
  }
62
- sendTokensToPortalPublic(bridgeAmount, l2Address, mint = false) {
63
- return this.feeJuicePortalManager.bridgeTokensPublic(l2Address, bridgeAmount, mint);
77
+ sendTokensToPortalPublic(bridgeAmount, l2Address) {
78
+ return this.feeJuicePortalManager.bridgeTokensPublic(l2Address, bridgeAmount, false);
64
79
  }
65
80
  async consumeMessageOnAztecAndClaimPrivately(owner, claim) {
66
81
  this.logger.info('Consuming messages on L2 Privately');
@@ -75,7 +90,8 @@ export class FeeJuicePortalTestingHarnessFactory {
75
90
  expect(balance).toBe(expectedBalance);
76
91
  }
77
92
  async prepareTokensOnL1(bridgeAmount, owner) {
78
- const claim = await this.sendTokensToPortalPublic(bridgeAmount, owner, true);
93
+ await this.mintTokensOnL1(bridgeAmount);
94
+ const claim = await this.sendTokensToPortalPublic(bridgeAmount, owner);
79
95
  const isSynced = async ()=>await this.aztecNode.isL1ToL2MessageSynced(Fr.fromHexString(claim.messageHash));
80
96
  await retryUntil(isSynced, `message ${claim.messageHash} sync`, 24, 1);
81
97
  // Progress by 2 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
@@ -88,11 +104,10 @@ export class FeeJuicePortalTestingHarnessFactory {
88
104
  const claim = await this.prepareTokensOnL1(bridgeAmount, owner);
89
105
  // Consume L1 -> L2 message and claim tokens privately on L2
90
106
  await this.consumeMessageOnAztecAndClaimPrivately(owner, claim);
91
- await this.expectPublicBalanceOnL2(owner, bridgeAmount);
92
107
  }
93
108
  async advanceL2Block() {
94
109
  const initialBlockNumber = await this.aztecNode.getBlockNumber();
95
- await this.aztecNode.flushTxs();
110
+ await this.aztecNodeAdmin?.flushTxs();
96
111
  await retryUntil(async ()=>await this.aztecNode.getBlockNumber() >= initialBlockNumber + 1);
97
112
  }
98
113
  } // docs:end:cross_chain_test_harness
@@ -1 +1 @@
1
- {"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAGd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAGtB,MAAM,iBAAiB,CAAC;AAqBzB,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,+CAA+C;IAC/C,GAAG,EAAE,GAAG,CAAC;IACT,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,mCAAmC;IACnC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,wBAAwB;IACxB,WAAW,EAAE,aAAa,CAAC;IAC3B,0BAA0B;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAGF,eAAO,MAAM,oBAAoB,UACxB,MAAM,QAAQ,mBAAmB,CAAC,WAChC,MAAM,QAAQ,IAAI,CAAC,2CA89B7B,CAAC"}
1
+ {"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAGd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,KAAK,2BAA2B,EAEhC,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAGtB,MAAM,iBAAiB,CAAC;AAqBzB,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,+CAA+C;IAC/C,GAAG,EAAE,GAAG,CAAC;IACT,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,mCAAmC;IACnC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,wBAAwB;IACxB,WAAW,EAAE,aAAa,CAAC;IAC3B,0BAA0B;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAGF,eAAO,MAAM,oBAAoB,UACxB,MAAM,QAAQ,mBAAmB,CAAC,WAChC,MAAM,QAAQ,IAAI,CAAC,2CA69B7B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { AztecAddress, EthAddress, Fr, computeAuthWitMessageHash, generateClaimSecret } from '@aztec/aztec.js';
2
- import { deployL1Contract, extractEvent } from '@aztec/ethereum';
2
+ import { RollupContract, deployL1Contract, extractEvent } from '@aztec/ethereum';
3
3
  import { sha256ToField } from '@aztec/foundation/crypto';
4
- import { InboxAbi, RollupAbi, UniswapPortalAbi, UniswapPortalBytecode } from '@aztec/l1-artifacts';
4
+ import { InboxAbi, UniswapPortalAbi, UniswapPortalBytecode } from '@aztec/l1-artifacts';
5
5
  import { UniswapContract } from '@aztec/noir-contracts.js/Uniswap';
6
6
  import { jest } from '@jest/globals';
7
7
  import { getContract, parseEther, toFunctionSelector } from 'viem';
@@ -49,11 +49,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
49
49
  if (Number(await publicClient.getBlockNumber()) < expectedForkBlockNumber) {
50
50
  throw new Error('This test must be run on a fork of mainnet with the expected fork block');
51
51
  }
52
- rollup = getContract({
53
- address: deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(),
54
- abi: RollupAbi,
55
- client: deployL1ContractsValues.walletClient
56
- });
52
+ rollup = new RollupContract(deployL1ContractsValues.publicClient, deployL1ContractsValues.l1ContractAddresses.rollupAddress);
57
53
  ownerAddress = ownerWallet.getAddress();
58
54
  // sponsorAddress = sponsorWallet.getAddress();
59
55
  ownerEthAddress = EthAddress.fromString((await walletClient.getAddresses())[0]);
@@ -114,14 +110,18 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
114
110
  // 3. Owner gives uniswap approval to transfer the funds to public to self on its behalf
115
111
  logger.info('Approving uniswap to transfer funds to public to self on my behalf');
116
112
  const nonceForWETHTransferToPublicApproval = new Fr(1n);
117
- await ownerWallet.createAuthWit({
113
+ const transferToPublicAuhtwit = await ownerWallet.createAuthWit({
118
114
  caller: uniswapL2Contract.address,
119
115
  action: wethCrossChainHarness.l2Token.methods.transfer_to_public(ownerAddress, uniswapL2Contract.address, wethAmountToBridge, nonceForWETHTransferToPublicApproval)
120
116
  });
121
117
  // 4. Swap on L1 - sends L2 to L1 message to withdraw WETH to L1 and another message to swap assets.
122
118
  logger.info('Withdrawing weth to L1 and sending message to swap to dai');
123
119
  const [secretForDepositingSwappedDai, secretHashForDepositingSwappedDai] = await generateClaimSecret();
124
- const l2UniswapInteractionReceipt = await uniswapL2Contract.methods.swap_private(wethCrossChainHarness.l2Token.address, wethCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferToPublicApproval, uniswapFeeTier, minimumOutputAmount, secretHashForDepositingSwappedDai, ownerEthAddress).send().wait();
120
+ const l2UniswapInteractionReceipt = await uniswapL2Contract.methods.swap_private(wethCrossChainHarness.l2Token.address, wethCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferToPublicApproval, uniswapFeeTier, minimumOutputAmount, secretHashForDepositingSwappedDai, ownerEthAddress).send({
121
+ authWitnesses: [
122
+ transferToPublicAuhtwit
123
+ ]
124
+ }).wait();
125
125
  const swapPrivateFunction = 'swap_private(address,uint256,uint24,address,uint256,bytes32,address)';
126
126
  const swapPrivateContent = sha256ToField([
127
127
  Buffer.from(toFunctionSelector(swapPrivateFunction).substring(2), 'hex'),
@@ -158,7 +158,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
158
158
  // ensure that uniswap contract didn't eat the funds.
159
159
  await wethCrossChainHarness.expectPublicBalanceOnL2(uniswapL2Contract.address, 0n);
160
160
  // Since the outbox is only consumable when the block is proven, we need to set the block to be proven
161
- await cheatCodes.rollup.markAsProven(await rollup.read.getPendingBlockNumber());
161
+ await cheatCodes.rollup.markAsProven(await rollup.getBlockNumber());
162
162
  // 5. Consume L2 to L1 message by calling uniswapPortal.swap_private()
163
163
  logger.info('Execute withdraw and swap on the uniswapPortal!');
164
164
  const daiL1BalanceOfPortalBeforeSwap = await daiCrossChainHarness.getL1BalanceOf(daiCrossChainHarness.tokenPortalAddress);
@@ -446,13 +446,17 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
446
446
  // 2. owner gives uniswap approval to transfer the funds to public:
447
447
  logger.info('Approving uniswap to transfer funds to public to self on my behalf');
448
448
  const nonceForWETHTransferToPublicApproval = new Fr(3n);
449
- await ownerWallet.createAuthWit({
449
+ const transferToPublicAuthwith = await ownerWallet.createAuthWit({
450
450
  caller: uniswapL2Contract.address,
451
451
  action: wethCrossChainHarness.l2Token.methods.transfer_to_public(ownerAddress, uniswapL2Contract.address, wethAmountToBridge, nonceForWETHTransferToPublicApproval)
452
452
  });
453
453
  // 3. Swap but send the wrong token address
454
454
  logger.info('Swap but send the wrong token address');
455
- await expect(uniswapL2Contract.methods.swap_private(wethCrossChainHarness.l2Token.address, daiCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferToPublicApproval, uniswapFeeTier, minimumOutputAmount, Fr.random(), ownerEthAddress).prove()).rejects.toThrow('Assertion failed: input_asset address is not the same as seen in the bridge contract');
455
+ await expect(uniswapL2Contract.methods.swap_private(wethCrossChainHarness.l2Token.address, daiCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferToPublicApproval, uniswapFeeTier, minimumOutputAmount, Fr.random(), ownerEthAddress).prove({
456
+ authWitnesses: [
457
+ transferToPublicAuthwith
458
+ ]
459
+ })).rejects.toThrow('Assertion failed: input_asset address is not the same as seen in the bridge contract');
456
460
  });
457
461
  // edge cases for public flow:
458
462
  it("I don't need approval to call swap_public if I'm swapping on my own behalf", async ()=>{
@@ -503,7 +507,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
503
507
  // Owner gives uniswap approval to transfer the funds to public to self on its behalf
504
508
  logger.info('Approving uniswap to transfer the funds to public to self on my behalf');
505
509
  const nonceForWETHTransferToPublicApproval = new Fr(4n);
506
- await ownerWallet.createAuthWit({
510
+ const transferToPublicAuhtwit = await ownerWallet.createAuthWit({
507
511
  caller: uniswapL2Contract.address,
508
512
  action: wethCrossChainHarness.l2Token.methods.transfer_to_public(ownerAddress, uniswapL2Contract.address, wethAmountToBridge, nonceForWETHTransferToPublicApproval)
509
513
  });
@@ -511,7 +515,11 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
511
515
  // Swap
512
516
  logger.info('Withdrawing weth to L1 and sending message to swap to dai');
513
517
  const [, secretHashForDepositingSwappedDai] = await generateClaimSecret();
514
- const withdrawReceipt = await uniswapL2Contract.methods.swap_private(wethCrossChainHarness.l2Token.address, wethCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferToPublicApproval, uniswapFeeTier, minimumOutputAmount, secretHashForDepositingSwappedDai, ownerEthAddress).send().wait();
518
+ const withdrawReceipt = await uniswapL2Contract.methods.swap_private(wethCrossChainHarness.l2Token.address, wethCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferToPublicApproval, uniswapFeeTier, minimumOutputAmount, secretHashForDepositingSwappedDai, ownerEthAddress).send({
519
+ authWitnesses: [
520
+ transferToPublicAuhtwit
521
+ ]
522
+ }).wait();
515
523
  const swapPrivateContent = sha256ToField([
516
524
  Buffer.from(toFunctionSelector('swap_private(address,uint256,uint24,address,uint256,bytes32,address)').substring(2), 'hex'),
517
525
  wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
@@ -557,7 +565,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
557
565
  // ensure that user's funds were burnt
558
566
  await wethCrossChainHarness.expectPrivateBalanceOnL2(ownerAddress, wethL2BalanceBeforeSwap - wethAmountToBridge);
559
567
  // Since the outbox is only consumable when the block is proven, we need to set the block to be proven
560
- await cheatCodes.rollup.markAsProven(await rollup.read.getPendingBlockNumber());
568
+ await cheatCodes.rollup.markAsProven(await rollup.getBlockNumber());
561
569
  // On L1 call swap_public!
562
570
  logger.info('call swap_public on L1');
563
571
  const swapArgs = [
@@ -637,7 +645,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
637
645
  // check weth balance of owner on L2 (we first bridged `wethAmountToBridge` into L2 and now withdrew it!)
638
646
  await wethCrossChainHarness.expectPublicBalanceOnL2(ownerAddress, 0n);
639
647
  // Since the outbox is only consumable when the block is proven, we need to set the block to be proven
640
- await cheatCodes.rollup.markAsProven(await rollup.read.getPendingBlockNumber());
648
+ await cheatCodes.rollup.markAsProven(await rollup.getBlockNumber());
641
649
  // Call swap_private on L1
642
650
  logger.info('Execute withdraw and swap on the uniswapPortal!');
643
651
  const swapArgs = [
@@ -1,10 +1,8 @@
1
1
  import { AztecAddress, Fr } from '@aztec/aztec.js';
2
2
  import { CheatCodes } from '@aztec/aztec.js/testing';
3
+ import type { RollupContract } from '@aztec/ethereum';
3
4
  import type { TestDateProvider } from '@aztec/foundation/timer';
4
- import type { RollupAbi } from '@aztec/l1-artifacts';
5
5
  import type { LendingContract } from '@aztec/noir-contracts.js/Lending';
6
- import type { Account, GetContractReturnType, HttpTransport, WalletClient } from 'viem';
7
- import type * as chains from 'viem/chains';
8
6
  import type { TokenSimulator } from './token_simulator.js';
9
7
  /**
10
8
  * Contains utilities to compute the "key" for private holdings in the public state.
@@ -30,7 +28,7 @@ export declare class LendingSimulator {
30
28
  private rate;
31
29
  private ethereumSlotDuration;
32
30
  /** the rollup contract */
33
- rollup: GetContractReturnType<typeof RollupAbi, WalletClient<HttpTransport, chains.Chain, Account>>;
31
+ rollup: RollupContract;
34
32
  /** the lending contract */
35
33
  lendingContract: LendingContract;
36
34
  /** the collateral asset used in the lending contract */
@@ -47,7 +45,7 @@ export declare class LendingSimulator {
47
45
  private mintedOutside;
48
46
  constructor(cc: CheatCodes, account: LendingAccount, rate: bigint, ethereumSlotDuration: number,
49
47
  /** the rollup contract */
50
- rollup: GetContractReturnType<typeof RollupAbi, WalletClient<HttpTransport, chains.Chain, Account>>,
48
+ rollup: RollupContract,
51
49
  /** the lending contract */
52
50
  lendingContract: LendingContract,
53
51
  /** the collateral asset used in the lending contract */
@@ -1 +1 @@
1
- {"version":3,"file":"lending_simulator.d.ts","sourceRoot":"","sources":["../../src/simulators/lending_simulator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACxF,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;GAEG;AACH,qBAAa,cAAc;IACzB,yCAAyC;IACzC,SAAgB,OAAO,EAAE,YAAY,CAAC;IACtC,2CAA2C;IAC3C,SAAgB,MAAM,EAAE,EAAE,CAAC;gBAEf,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE;IAK7C;;;OAGG;IACI,GAAG;CAGX;AAgCD;;GAEG;AACH,qBAAa,gBAAgB;IAYzB,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,oBAAoB;IAC5B,0BAA0B;IACnB,MAAM,EAAE,qBAAqB,CAAC,OAAO,SAAS,EAAE,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC1G,2BAA2B;IACpB,eAAe,EAAE,eAAe;IACvC,wDAAwD;IACjD,eAAe,EAAE,cAAc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,QAAQ,CAAc;IAC9B,OAAO,CAAC,aAAa,CAAc;gBAGzB,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,oBAAoB,EAAE,MAAM;IACpC,0BAA0B;IACnB,MAAM,EAAE,cAAc;IAC7B,2BAA2B;IACpB,eAAe,EAAE,eAAe;IACvC,wDAAwD;IACjD,eAAe,EAAE,cAAc;IACtC,uDAAuD;IAChD,UAAU,EAAE,cAAc;IAG7B,OAAO;IAMP,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,gBAAgB;IAmBjE,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM;IAKjE,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM;IAKhE,OAAO,CAAC,OAAO;IAKf,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;IAM3D,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;IASzD,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM;IAK/D,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM;IAK9D,OAAO,CAAC,KAAK;IAQb,yBAAyB,CAAC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,UAAQ;IASzE,KAAK;CA0BZ"}
@@ -76,23 +76,15 @@ const computeMultiplier = (rate, dt)=>{
76
76
  }
77
77
  async prepare() {
78
78
  this.accumulator = BASE;
79
- const slot = await this.rollup.read.getSlotAt([
80
- BigInt(await this.cc.eth.timestamp()) + BigInt(this.ethereumSlotDuration)
81
- ]);
82
- this.time = Number(await this.rollup.read.getTimestampForSlot([
83
- slot
84
- ]));
79
+ const slot = await this.rollup.getSlotAt(BigInt(await this.cc.eth.timestamp()) + BigInt(this.ethereumSlotDuration));
80
+ this.time = Number(await this.rollup.getTimestampForSlot(slot));
85
81
  }
86
82
  async progressSlots(diff, dateProvider) {
87
83
  if (diff <= 1) {
88
84
  return;
89
85
  }
90
- const slot = await this.rollup.read.getSlotAt([
91
- BigInt(await this.cc.eth.timestamp())
92
- ]);
93
- const ts = Number(await this.rollup.read.getTimestampForSlot([
94
- slot + BigInt(diff)
95
- ]));
86
+ const slot = await this.rollup.getSlotAt(BigInt(await this.cc.eth.timestamp()));
87
+ const ts = Number(await this.rollup.getTimestampForSlot(slot + BigInt(diff)));
96
88
  const timeDiff = ts - this.time;
97
89
  this.time = ts;
98
90
  // Mine ethereum blocks such that the next block will be in a new slot
@@ -100,7 +92,7 @@ const computeMultiplier = (rate, dt)=>{
100
92
  if (dateProvider) {
101
93
  dateProvider.setTime(this.time * 1000);
102
94
  }
103
- await this.cc.rollup.markAsProven(await this.rollup.read.getPendingBlockNumber());
95
+ await this.cc.rollup.markAsProven(await this.rollup.getBlockNumber());
104
96
  this.accumulator = muldivDown(this.accumulator, computeMultiplier(this.rate, BigInt(timeDiff)), BASE);
105
97
  }
106
98
  depositPrivate(from, onBehalfOf, amount) {
@@ -10,7 +10,7 @@ export interface TestWallets {
10
10
  tokenAddress: AztecAddress;
11
11
  }
12
12
  export declare function setupTestWalletsWithTokens(pxeUrl: string, mintAmount: bigint, logger: Logger): Promise<TestWallets>;
13
- export declare function deployTestWalletWithTokens(pxeUrl: string, nodeUrl: string, l1RpcUrls: string[], mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number, initialFeeJuice?: bigint): Promise<TestWallets>;
13
+ export declare function deployTestWalletWithTokens(pxeUrl: string, nodeUrl: string, l1RpcUrls: string[], mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestWallets>;
14
14
  export declare function performTransfers({ testWallets, rounds, transferAmount, logger, }: {
15
15
  testWallets: TestWallets;
16
16
  rounds: number;
@@ -1 +1 @@
1
- {"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EAKjB,KAAK,GAAG,EAIT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACtC,gBAAgB,EAAE,aAAa,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,0BAA0B,CAAC;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,EACzB,eAAe,SAAa,GAC3B,OAAO,CAAC,WAAW,CAAC,CAsCtB;AA2DD,wBAAsB,gBAAgB,CAAC,EACrC,WAAW,EACX,MAAM,EACN,cAAc,EACd,MAAM,GACP,EAAE;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,iBAkBA"}
1
+ {"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EAKjB,KAAK,GAAG,EAIT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACtC,gBAAgB,EAAE,aAAa,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,0BAA0B,CAAC;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,WAAW,CAAC,CAoCtB;AA6DD,wBAAsB,gBAAgB,CAAC,EACrC,WAAW,EACX,MAAM,EACN,cAAc,EACd,MAAM,GACP,EAAE;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,iBAkBA"}
@@ -22,13 +22,13 @@ export async function setupTestWalletsWithTokens(pxeUrl, mintAmount, logger) {
22
22
  recipientWallet
23
23
  };
24
24
  }
25
- export async function deployTestWalletWithTokens(pxeUrl, nodeUrl, l1RpcUrls, mnemonicOrPrivateKey, mintAmount, logger, numberOfFundedWallets = 1, initialFeeJuice = 10n ** 22n) {
25
+ export async function deployTestWalletWithTokens(pxeUrl, nodeUrl, l1RpcUrls, mnemonicOrPrivateKey, mintAmount, logger, numberOfFundedWallets = 1) {
26
26
  const pxe = await createCompatibleClient(pxeUrl, logger);
27
27
  const node = createAztecNodeClient(nodeUrl);
28
28
  const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
29
29
  const recipientWallet = await getSchnorrWalletWithSecretKey(pxe, recipient.secret, recipient.signingKey, recipient.salt);
30
30
  const fundedAccounts = await Promise.all(funded.map((a)=>getSchnorrAccount(pxe, a.secret, a.signingKey, a.salt)));
31
- const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, a.getAddress(), initialFeeJuice, logger)));
31
+ const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, a.getAddress(), undefined, logger)));
32
32
  // Progress by 2 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
33
33
  await advanceL2Block(node);
34
34
  await advanceL2Block(node);
@@ -59,16 +59,18 @@ async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, recipient,
59
59
  const { l1ChainId } = await pxe.getNodeInfo();
60
60
  const chain = createEthereumChain(l1RpcUrls, l1ChainId);
61
61
  const { publicClient, walletClient } = createL1Clients(chain.rpcUrls, mnemonicOrPrivateKey, chain.chainInfo);
62
+ // docs:start:bridge_fee_juice
62
63
  const portal = await L1FeeJuicePortalManager.new(pxe, publicClient, walletClient, log);
63
64
  const claim = await portal.bridgeTokensPublic(recipient, amount, true);
65
+ // docs:end:bridge_fee_juice
64
66
  const isSynced = async ()=>await pxe.isL1ToL2MessageSynced(Fr.fromHexString(claim.messageHash));
65
67
  await retryUntil(isSynced, `message ${claim.messageHash} sync`, 24, 0.5);
66
68
  log.info(`Created a claim for ${amount} L1 fee juice to ${recipient}.`, claim);
67
69
  return claim;
68
70
  }
69
- async function advanceL2Block(node) {
71
+ async function advanceL2Block(node, nodeAdmin) {
70
72
  const initialBlockNumber = await node.getBlockNumber();
71
- await node.flushTxs();
73
+ await nodeAdmin?.flushTxs();
72
74
  await retryUntil(async ()=>await node.getBlockNumber() >= initialBlockNumber + 1);
73
75
  }
74
76
  async function deployTokenAndMint(wallets, admin, mintAmount, logger) {
@@ -13,6 +13,7 @@ declare const k8sLocalConfigSchema: z.ZodObject<{
13
13
  INSTANCE_NAME: z.ZodString;
14
14
  NAMESPACE: z.ZodString;
15
15
  CONTAINER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
16
+ CONTAINER_NODE_ADMIN_PORT: z.ZodDefault<z.ZodNumber>;
16
17
  CONTAINER_SEQUENCER_PORT: z.ZodDefault<z.ZodNumber>;
17
18
  CONTAINER_PROVER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
18
19
  CONTAINER_PXE_PORT: z.ZodDefault<z.ZodNumber>;
@@ -33,6 +34,7 @@ declare const k8sLocalConfigSchema: z.ZodObject<{
33
34
  INSTANCE_NAME: string;
34
35
  NAMESPACE: string;
35
36
  CONTAINER_NODE_PORT: number;
37
+ CONTAINER_NODE_ADMIN_PORT: number;
36
38
  CONTAINER_SEQUENCER_PORT: number;
37
39
  CONTAINER_PROVER_NODE_PORT: number;
38
40
  CONTAINER_PXE_PORT: number;
@@ -56,6 +58,7 @@ declare const k8sLocalConfigSchema: z.ZodObject<{
56
58
  K8S: "local";
57
59
  ETHEREUM_HOSTS?: string | undefined;
58
60
  CONTAINER_NODE_PORT?: number | undefined;
61
+ CONTAINER_NODE_ADMIN_PORT?: number | undefined;
59
62
  CONTAINER_SEQUENCER_PORT?: number | undefined;
60
63
  CONTAINER_PROVER_NODE_PORT?: number | undefined;
61
64
  CONTAINER_PXE_PORT?: number | undefined;
@@ -74,6 +77,7 @@ declare const k8sGCloudConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
74
77
  INSTANCE_NAME: z.ZodString;
75
78
  NAMESPACE: z.ZodString;
76
79
  CONTAINER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
80
+ CONTAINER_NODE_ADMIN_PORT: z.ZodDefault<z.ZodNumber>;
77
81
  CONTAINER_SEQUENCER_PORT: z.ZodDefault<z.ZodNumber>;
78
82
  CONTAINER_PROVER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
79
83
  CONTAINER_PXE_PORT: z.ZodDefault<z.ZodNumber>;
@@ -98,6 +102,7 @@ declare const k8sGCloudConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
98
102
  INSTANCE_NAME: string;
99
103
  NAMESPACE: string;
100
104
  CONTAINER_NODE_PORT: number;
105
+ CONTAINER_NODE_ADMIN_PORT: number;
101
106
  CONTAINER_SEQUENCER_PORT: number;
102
107
  CONTAINER_PROVER_NODE_PORT: number;
103
108
  CONTAINER_PXE_PORT: number;
@@ -125,6 +130,7 @@ declare const k8sGCloudConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
125
130
  REGION: string;
126
131
  ETHEREUM_HOSTS?: string | undefined;
127
132
  CONTAINER_NODE_PORT?: number | undefined;
133
+ CONTAINER_NODE_ADMIN_PORT?: number | undefined;
128
134
  CONTAINER_SEQUENCER_PORT?: number | undefined;
129
135
  CONTAINER_PROVER_NODE_PORT?: number | undefined;
130
136
  CONTAINER_PXE_PORT?: number | undefined;
@@ -138,6 +144,7 @@ declare const k8sGCloudConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
138
144
  declare const directConfigSchema: z.ZodObject<{
139
145
  PXE_URL: z.ZodString;
140
146
  NODE_URL: z.ZodString;
147
+ NODE_ADMIN_URL: z.ZodString;
141
148
  ETHEREUM_HOSTS: z.ZodEffects<z.ZodString, string, string>;
142
149
  K8S: z.ZodLiteral<"false">;
143
150
  }, "strip", z.ZodTypeAny, {
@@ -145,11 +152,13 @@ declare const directConfigSchema: z.ZodObject<{
145
152
  ETHEREUM_HOSTS: string;
146
153
  K8S: "false";
147
154
  NODE_URL: string;
155
+ NODE_ADMIN_URL: string;
148
156
  }, {
149
157
  PXE_URL: string;
150
158
  ETHEREUM_HOSTS: string;
151
159
  K8S: "false";
152
160
  NODE_URL: string;
161
+ NODE_ADMIN_URL: string;
153
162
  }>;
154
163
  declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
155
164
  ETHEREUM_SLOT_DURATION: z.ZodNumber;
@@ -159,6 +168,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
159
168
  INSTANCE_NAME: z.ZodString;
160
169
  NAMESPACE: z.ZodString;
161
170
  CONTAINER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
171
+ CONTAINER_NODE_ADMIN_PORT: z.ZodDefault<z.ZodNumber>;
162
172
  CONTAINER_SEQUENCER_PORT: z.ZodDefault<z.ZodNumber>;
163
173
  CONTAINER_PROVER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
164
174
  CONTAINER_PXE_PORT: z.ZodDefault<z.ZodNumber>;
@@ -179,6 +189,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
179
189
  INSTANCE_NAME: string;
180
190
  NAMESPACE: string;
181
191
  CONTAINER_NODE_PORT: number;
192
+ CONTAINER_NODE_ADMIN_PORT: number;
182
193
  CONTAINER_SEQUENCER_PORT: number;
183
194
  CONTAINER_PROVER_NODE_PORT: number;
184
195
  CONTAINER_PXE_PORT: number;
@@ -202,6 +213,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
202
213
  K8S: "local";
203
214
  ETHEREUM_HOSTS?: string | undefined;
204
215
  CONTAINER_NODE_PORT?: number | undefined;
216
+ CONTAINER_NODE_ADMIN_PORT?: number | undefined;
205
217
  CONTAINER_SEQUENCER_PORT?: number | undefined;
206
218
  CONTAINER_PROVER_NODE_PORT?: number | undefined;
207
219
  CONTAINER_PXE_PORT?: number | undefined;
@@ -219,6 +231,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
219
231
  INSTANCE_NAME: z.ZodString;
220
232
  NAMESPACE: z.ZodString;
221
233
  CONTAINER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
234
+ CONTAINER_NODE_ADMIN_PORT: z.ZodDefault<z.ZodNumber>;
222
235
  CONTAINER_SEQUENCER_PORT: z.ZodDefault<z.ZodNumber>;
223
236
  CONTAINER_PROVER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
224
237
  CONTAINER_PXE_PORT: z.ZodDefault<z.ZodNumber>;
@@ -243,6 +256,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
243
256
  INSTANCE_NAME: string;
244
257
  NAMESPACE: string;
245
258
  CONTAINER_NODE_PORT: number;
259
+ CONTAINER_NODE_ADMIN_PORT: number;
246
260
  CONTAINER_SEQUENCER_PORT: number;
247
261
  CONTAINER_PROVER_NODE_PORT: number;
248
262
  CONTAINER_PXE_PORT: number;
@@ -270,6 +284,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
270
284
  REGION: string;
271
285
  ETHEREUM_HOSTS?: string | undefined;
272
286
  CONTAINER_NODE_PORT?: number | undefined;
287
+ CONTAINER_NODE_ADMIN_PORT?: number | undefined;
273
288
  CONTAINER_SEQUENCER_PORT?: number | undefined;
274
289
  CONTAINER_PROVER_NODE_PORT?: number | undefined;
275
290
  CONTAINER_PXE_PORT?: number | undefined;
@@ -282,6 +297,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
282
297
  }>, z.ZodObject<{
283
298
  PXE_URL: z.ZodString;
284
299
  NODE_URL: z.ZodString;
300
+ NODE_ADMIN_URL: z.ZodString;
285
301
  ETHEREUM_HOSTS: z.ZodEffects<z.ZodString, string, string>;
286
302
  K8S: z.ZodLiteral<"false">;
287
303
  }, "strip", z.ZodTypeAny, {
@@ -289,11 +305,13 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
289
305
  ETHEREUM_HOSTS: string;
290
306
  K8S: "false";
291
307
  NODE_URL: string;
308
+ NODE_ADMIN_URL: string;
292
309
  }, {
293
310
  PXE_URL: string;
294
311
  ETHEREUM_HOSTS: string;
295
312
  K8S: "false";
296
313
  NODE_URL: string;
314
+ NODE_ADMIN_URL: string;
297
315
  }>]>;
298
316
  export type K8sLocalConfig = z.infer<typeof k8sLocalConfigSchema>;
299
317
  export type K8sGCloudConfig = z.infer<typeof k8sGCloudConfigSchema>;
@@ -407,11 +425,6 @@ export declare function enableValidatorDynamicBootNode(instanceName: string, nam
407
425
  export declare function runAlertCheck(config: EnvConfig, alerts: AlertConfig[], logger: Logger): Promise<void>;
408
426
  export declare function updateSequencerConfig(url: string, config: Partial<SequencerConfig>): Promise<void>;
409
427
  export declare function getSequencers(namespace: string): Promise<string[]>;
410
- export declare function updateK8sSequencersConfig(args: {
411
- containerPort: number;
412
- namespace: string;
413
- config: Partial<SequencerConfig>;
414
- }): Promise<void>;
415
428
  export declare function updateSequencersConfig(env: EnvConfig, config: Partial<SequencerConfig>): Promise<void>;
416
429
  /**
417
430
  * Rolls the Aztec pods in the given namespace.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/spartan/utils.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAyB,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAmBxF,QAAA,MAAM,oBAAoB;;;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EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAMjE;AAED,wBAAsB,8BAA8B,CAClD,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,iBAgBf;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,MAAM,iBAgB3F;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,iBAIxF;AAED,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,qBAIpD;AAsBD,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,iBAU5F;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,iBAcpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAW1C"}
@@ -1,5 +1,6 @@
1
- import { createAztecNodeClient, createLogger, sleep } from '@aztec/aztec.js';
1
+ import { createLogger, sleep } from '@aztec/aztec.js';
2
2
  import { makeBackoff, retry } from '@aztec/foundation/retry';
3
+ import { createAztecNodeAdminClient } from '@aztec/stdlib/interfaces/client';
3
4
  import { exec, execSync, spawn } from 'child_process';
4
5
  import path from 'path';
5
6
  import { promisify } from 'util';
@@ -23,6 +24,7 @@ const k8sLocalConfigSchema = z.object({
23
24
  INSTANCE_NAME: z.string().min(1, 'INSTANCE_NAME env variable must be set'),
24
25
  NAMESPACE: z.string().min(1, 'NAMESPACE env variable must be set'),
25
26
  CONTAINER_NODE_PORT: z.coerce.number().default(8080),
27
+ CONTAINER_NODE_ADMIN_PORT: z.coerce.number().default(8880),
26
28
  CONTAINER_SEQUENCER_PORT: z.coerce.number().default(8080),
27
29
  CONTAINER_PROVER_NODE_PORT: z.coerce.number().default(8080),
28
30
  CONTAINER_PXE_PORT: z.coerce.number().default(8080),
@@ -44,6 +46,7 @@ const k8sGCloudConfigSchema = k8sLocalConfigSchema.extend({
44
46
  const directConfigSchema = z.object({
45
47
  PXE_URL: z.string().url('PXE_URL must be a valid URL'),
46
48
  NODE_URL: z.string().url('NODE_URL must be a valid URL'),
49
+ NODE_ADMIN_URL: z.string().url('NODE_ADMIN_URL must be a valid URL'),
47
50
  ETHEREUM_HOSTS: ethereumHostsSchema,
48
51
  K8S: z.literal('false')
49
52
  });
@@ -388,7 +391,7 @@ export async function runAlertCheck(config, alerts, logger) {
388
391
  }
389
392
  }
390
393
  export async function updateSequencerConfig(url, config) {
391
- const node = createAztecNodeClient(url);
394
+ const node = createAztecNodeAdminClient(url);
392
395
  // Retry incase the port forward is not ready yet
393
396
  await retry(()=>node.setConfig(config), 'Update sequencer config', makeBackoff([
394
397
  1,
@@ -401,7 +404,7 @@ export async function getSequencers(namespace) {
401
404
  const { stdout } = await execAsync(command);
402
405
  return stdout.split(' ');
403
406
  }
404
- export async function updateK8sSequencersConfig(args) {
407
+ async function updateK8sSequencersConfig(args) {
405
408
  const { containerPort, namespace, config } = args;
406
409
  const sequencers = await getSequencers(namespace);
407
410
  for (const sequencer of sequencers){
@@ -418,12 +421,12 @@ export async function updateK8sSequencersConfig(args) {
418
421
  export async function updateSequencersConfig(env, config) {
419
422
  if (isK8sConfig(env)) {
420
423
  await updateK8sSequencersConfig({
421
- containerPort: env.CONTAINER_NODE_PORT,
424
+ containerPort: env.CONTAINER_NODE_ADMIN_PORT,
422
425
  namespace: env.NAMESPACE,
423
426
  config
424
427
  });
425
428
  } else {
426
- await updateSequencerConfig(env.NODE_URL, config);
429
+ await updateSequencerConfig(env.NODE_ADMIN_URL, config);
427
430
  }
428
431
  }
429
432
  /**