@aztec/end-to-end 3.0.0-canary.a9708bd → 3.0.0-manual.20251030

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 (139) hide show
  1. package/dest/bench/client_flows/benchmark.d.ts +3 -2
  2. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/benchmark.js +2 -2
  4. package/dest/bench/client_flows/client_flows_benchmark.d.ts +16 -12
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  6. package/dest/bench/client_flows/client_flows_benchmark.js +54 -58
  7. package/dest/bench/client_flows/data_extractor.js +3 -3
  8. package/dest/bench/utils.d.ts +2 -11
  9. package/dest/bench/utils.d.ts.map +1 -1
  10. package/dest/bench/utils.js +10 -34
  11. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +7 -7
  12. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  13. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +42 -42
  14. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +10 -8
  15. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  16. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +31 -33
  17. package/dest/e2e_deploy_contract/deploy_test.d.ts +10 -4
  18. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  19. package/dest/e2e_deploy_contract/deploy_test.js +9 -18
  20. package/dest/e2e_epochs/epochs_test.d.ts +9 -3
  21. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  22. package/dest/e2e_epochs/epochs_test.js +19 -13
  23. package/dest/e2e_fees/bridging_race.notest.js +12 -9
  24. package/dest/e2e_fees/fees_test.d.ts +5 -5
  25. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  26. package/dest/e2e_fees/fees_test.js +26 -33
  27. package/dest/e2e_l1_publisher/write_json.d.ts +3 -1
  28. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  29. package/dest/e2e_l1_publisher/write_json.js +5 -5
  30. package/dest/e2e_multi_validator/utils.d.ts +1 -1
  31. package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
  32. package/dest/e2e_multi_validator/utils.js +3 -9
  33. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -3
  34. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  35. package/dest/e2e_nested_contract/nested_contract_test.js +7 -9
  36. package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
  37. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
  38. package/dest/e2e_p2p/inactivity_slash_test.js +135 -0
  39. package/dest/e2e_p2p/p2p_network.d.ts +22 -8
  40. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  41. package/dest/e2e_p2p/p2p_network.js +36 -15
  42. package/dest/e2e_p2p/shared.d.ts +12 -13
  43. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  44. package/dest/e2e_p2p/shared.js +54 -54
  45. package/dest/e2e_token_contract/token_contract_test.d.ts +5 -4
  46. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  47. package/dest/e2e_token_contract/token_contract_test.js +14 -17
  48. package/dest/fixtures/e2e_prover_test.d.ts +8 -6
  49. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  50. package/dest/fixtures/e2e_prover_test.js +42 -51
  51. package/dest/fixtures/get_acvm_config.d.ts +1 -1
  52. package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
  53. package/dest/fixtures/get_bb_config.d.ts +1 -1
  54. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  55. package/dest/fixtures/get_bb_config.js +2 -2
  56. package/dest/fixtures/setup_l1_contracts.d.ts +1 -1
  57. package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
  58. package/dest/fixtures/setup_l1_contracts.js +2 -2
  59. package/dest/fixtures/setup_p2p_test.d.ts +10 -9
  60. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  61. package/dest/fixtures/setup_p2p_test.js +38 -20
  62. package/dest/fixtures/snapshot_manager.d.ts +10 -7
  63. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  64. package/dest/fixtures/snapshot_manager.js +60 -47
  65. package/dest/fixtures/token_utils.d.ts +6 -4
  66. package/dest/fixtures/token_utils.d.ts.map +1 -1
  67. package/dest/fixtures/token_utils.js +11 -15
  68. package/dest/fixtures/utils.d.ts +26 -28
  69. package/dest/fixtures/utils.d.ts.map +1 -1
  70. package/dest/fixtures/utils.js +83 -109
  71. package/dest/fixtures/web3signer.d.ts +5 -0
  72. package/dest/fixtures/web3signer.d.ts.map +1 -0
  73. package/dest/fixtures/web3signer.js +53 -0
  74. package/dest/quality_of_service/alert_checker.d.ts +1 -1
  75. package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
  76. package/dest/shared/cross_chain_test_harness.d.ts +16 -10
  77. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  78. package/dest/shared/cross_chain_test_harness.js +13 -15
  79. package/dest/shared/gas_portal_test_harness.d.ts +9 -6
  80. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  81. package/dest/shared/gas_portal_test_harness.js +10 -7
  82. package/dest/shared/jest_setup.js +1 -1
  83. package/dest/shared/submit-transactions.d.ts +5 -3
  84. package/dest/shared/submit-transactions.d.ts.map +1 -1
  85. package/dest/shared/submit-transactions.js +8 -7
  86. package/dest/shared/uniswap_l1_l2.d.ts +9 -6
  87. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  88. package/dest/shared/uniswap_l1_l2.js +29 -45
  89. package/dest/simulators/lending_simulator.d.ts +2 -1
  90. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  91. package/dest/simulators/lending_simulator.js +3 -2
  92. package/dest/simulators/token_simulator.d.ts +3 -1
  93. package/dest/simulators/token_simulator.d.ts.map +1 -1
  94. package/dest/simulators/token_simulator.js +2 -2
  95. package/dest/spartan/setup_test_wallets.d.ts +19 -13
  96. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  97. package/dest/spartan/setup_test_wallets.js +108 -85
  98. package/dest/spartan/utils.d.ts +68 -3
  99. package/dest/spartan/utils.d.ts.map +1 -1
  100. package/dest/spartan/utils.js +312 -49
  101. package/package.json +39 -38
  102. package/src/bench/client_flows/benchmark.ts +8 -8
  103. package/src/bench/client_flows/client_flows_benchmark.ts +62 -82
  104. package/src/bench/client_flows/data_extractor.ts +4 -4
  105. package/src/bench/utils.ts +9 -37
  106. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +46 -63
  107. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +33 -47
  108. package/src/e2e_deploy_contract/deploy_test.ts +17 -35
  109. package/src/e2e_epochs/epochs_test.ts +22 -19
  110. package/src/e2e_fees/bridging_race.notest.ts +14 -9
  111. package/src/e2e_fees/fees_test.ts +29 -40
  112. package/src/e2e_l1_publisher/write_json.ts +8 -6
  113. package/src/e2e_multi_validator/utils.ts +4 -10
  114. package/src/e2e_nested_contract/nested_contract_test.ts +11 -10
  115. package/src/e2e_p2p/inactivity_slash_test.ts +178 -0
  116. package/src/e2e_p2p/p2p_network.ts +110 -71
  117. package/src/e2e_p2p/shared.ts +57 -56
  118. package/src/e2e_token_contract/token_contract_test.ts +17 -17
  119. package/src/fixtures/e2e_prover_test.ts +52 -88
  120. package/src/fixtures/get_acvm_config.ts +1 -1
  121. package/src/fixtures/get_bb_config.ts +3 -2
  122. package/src/fixtures/setup_l1_contracts.ts +3 -3
  123. package/src/fixtures/setup_p2p_test.ts +60 -27
  124. package/src/fixtures/snapshot_manager.ts +80 -72
  125. package/src/fixtures/token_utils.ts +13 -21
  126. package/src/fixtures/utils.ts +95 -145
  127. package/src/fixtures/web3signer.ts +63 -0
  128. package/src/guides/up_quick_start.sh +2 -10
  129. package/src/quality_of_service/alert_checker.ts +1 -1
  130. package/src/shared/cross_chain_test_harness.ts +18 -29
  131. package/src/shared/gas_portal_test_harness.ts +12 -19
  132. package/src/shared/jest_setup.ts +1 -1
  133. package/src/shared/submit-transactions.ts +12 -8
  134. package/src/shared/uniswap_l1_l2.ts +61 -67
  135. package/src/simulators/lending_simulator.ts +3 -2
  136. package/src/simulators/token_simulator.ts +5 -2
  137. package/src/spartan/DEVELOP.md +8 -3
  138. package/src/spartan/setup_test_wallets.ts +133 -126
  139. package/src/spartan/utils.ts +373 -48
@@ -1,6 +1,7 @@
1
- import { getSchnorrAccount } from '@aztec/accounts/schnorr';
2
- import { Fr, sleep } from '@aztec/aztec.js';
1
+ import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
2
+ import { Fr } from '@aztec/aztec.js/fields';
3
3
  import { Fq } from '@aztec/foundation/fields';
4
+ import { sleep } from '@aztec/foundation/sleep';
4
5
  import { jest } from '@jest/globals';
5
6
  import { FeesTest } from './fees_test.js';
6
7
  jest.setTimeout(300_000);
@@ -18,22 +19,24 @@ describe('e2e_fees bridging_race', ()=>{
18
19
  await t.applyInitialAccountsSnapshot();
19
20
  await t.applyPublicDeployAccountsSnapshot();
20
21
  await t.applySetupFeeJuiceSnapshot();
21
- ({ pxe, logger } = await t.setup());
22
+ ({ wallet, logger } = await t.setup());
22
23
  });
23
24
  afterAll(async ()=>{
24
25
  await t.teardown();
25
26
  });
26
27
  let logger;
27
- let pxe;
28
28
  let bobsAddress;
29
+ let wallet;
29
30
  beforeEach(async ()=>{
30
31
  const bobsSecretKey = Fr.random();
31
32
  const bobsPrivateSigningKey = Fq.random();
32
- const bobsAccountManager = await getSchnorrAccount(pxe, bobsSecretKey, bobsPrivateSigningKey, Fr.random());
33
- const bobsCompleteAddress = await bobsAccountManager.getCompleteAddress();
34
- bobsAddress = bobsCompleteAddress.address;
35
- await bobsAccountManager.getWallet();
36
- await bobsAccountManager.register();
33
+ const bobsSalt = Fr.random();
34
+ const bobsAccountManager = await wallet.createAccount({
35
+ secret: bobsSecretKey,
36
+ salt: bobsSalt,
37
+ contract: new SchnorrAccountContract(bobsPrivateSigningKey)
38
+ });
39
+ bobsAddress = bobsAccountManager.address;
37
40
  });
38
41
  it('Alice bridges funds to Bob', async ()=>{
39
42
  // Tweak the token manager so the bridging happens immediately before the end of the current L2 slot
@@ -1,4 +1,6 @@
1
- import { type AccountWallet, type AztecAddress, type AztecNode, type Logger, type PXE } from '@aztec/aztec.js';
1
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import { type Logger } from '@aztec/aztec.js/log';
3
+ import type { AztecNode } from '@aztec/aztec.js/node';
2
4
  import { CheatCodes } from '@aztec/aztec/testing';
3
5
  import { type DeployL1ContractsArgs, RollupContract } from '@aztec/ethereum';
4
6
  import { ChainMonitor } from '@aztec/ethereum/test';
@@ -10,6 +12,7 @@ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
10
12
  import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
11
13
  import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
12
14
  import { GasSettings } from '@aztec/stdlib/gas';
15
+ import { TestWallet } from '@aztec/test-wallet/server';
13
16
  import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
14
17
  import { type BalancesFn, type SetupOptions } from '../fixtures/utils.js';
15
18
  import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
@@ -26,15 +29,12 @@ import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.j
26
29
  export declare class FeesTest {
27
30
  private numberOfAccounts;
28
31
  private snapshotManager;
29
- private wallets;
30
32
  private accounts;
31
33
  logger: Logger;
32
- pxe: PXE;
33
34
  aztecNode: AztecNode;
34
35
  cheatCodes: CheatCodes;
35
- aliceWallet: AccountWallet;
36
+ wallet: TestWallet;
36
37
  aliceAddress: AztecAddress;
37
- bobWallet: AccountWallet;
38
38
  bobAddress: AztecAddress;
39
39
  sequencerAddress: AztecAddress;
40
40
  coinbase: EthAddress;
@@ -1 +1 @@
1
-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SAAgB;IACrD,SAAgB,mBAAmB,SAAgB;IACnD,SAAgB,0BAA0B,SAAgB;gBAGxD,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI,EAC5B,YAAY,GAAE,OAAO,CAAC,YAAY,GAAG,qBAAqB,CAAM;IAgB5D,KAAK;IASL,QAAQ;IAKd,oBAAoB,CAAC,CAAC,EAAE,OAAO;IAIzB,kBAAkB;IAOlB,eAAe;;;;IAef,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY;IASzE,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAajD,kBAAkB;IAOzB,4BAA4B;IAsB5B,iCAAiC;IAMjC,0BAA0B;IA2B1B,8BAA8B;IA6BvB,qBAAqB;IAoErB,8BAA8B;IAoB9B,yBAAyB;IAczB,gCAAgC;CAS9C"}
@@ -1,9 +1,8 @@
1
- import { getSchnorrWallet } from '@aztec/accounts/schnorr';
2
- import { createLogger, sleep } from '@aztec/aztec.js';
3
- import { CheatCodes } from '@aztec/aztec/testing';
1
+ import { createLogger } from '@aztec/aztec.js/log';
4
2
  import { RollupContract, createExtendedL1Client } from '@aztec/ethereum';
5
3
  import { ChainMonitor } from '@aztec/ethereum/test';
6
4
  import { EthAddress } from '@aztec/foundation/eth-address';
5
+ import { sleep } from '@aztec/foundation/sleep';
7
6
  import { TestERC20Abi } from '@aztec/l1-artifacts';
8
7
  import { FPCContract } from '@aztec/noir-contracts.js/FPC';
9
8
  import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
@@ -31,15 +30,12 @@ const { E2E_DATA_PATH: dataPath } = process.env;
31
30
  */ export class FeesTest {
32
31
  numberOfAccounts;
33
32
  snapshotManager;
34
- wallets;
35
33
  accounts;
36
34
  logger;
37
- pxe;
38
35
  aztecNode;
39
36
  cheatCodes;
40
- aliceWallet;
37
+ wallet;
41
38
  aliceAddress;
42
- bobWallet;
43
39
  bobAddress;
44
40
  sequencerAddress;
45
41
  coinbase;
@@ -66,7 +62,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
66
62
  APP_SPONSORED_TX_GAS_LIMIT;
67
63
  constructor(testName, numberOfAccounts = 3, setupOptions = {}){
68
64
  this.numberOfAccounts = numberOfAccounts;
69
- this.wallets = [];
70
65
  this.accounts = [];
71
66
  this.ALICE_INITIAL_BANANAS = BigInt(1e22);
72
67
  this.SUBSCRIPTION_AMOUNT = BigInt(1e19);
@@ -105,9 +100,10 @@ const { E2E_DATA_PATH: dataPath } = process.env;
105
100
  }
106
101
  async getBlockRewards() {
107
102
  const blockReward = await this.rollupContract.getBlockReward();
108
- const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(this.context.deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress);
103
+ const rewardConfig = await this.rollupContract.getRewardConfig();
104
+ const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(EthAddress.fromString(rewardConfig.rewardDistributor));
109
105
  const toDistribute = balance > blockReward ? blockReward : balance;
110
- const sequencerBlockRewards = toDistribute / 2n;
106
+ const sequencerBlockRewards = toDistribute * BigInt(rewardConfig.sequencerBps) / 10000n;
111
107
  const proverBlockRewards = toDistribute - sequencerBlockRewards;
112
108
  return {
113
109
  sequencerBlockRewards,
@@ -125,7 +121,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
125
121
  const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({
126
122
  from: this.aliceAddress
127
123
  });
128
- await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, this.aliceWallet, address, amount);
124
+ await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount);
129
125
  const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({
130
126
  from: this.aliceAddress
131
127
  });
@@ -138,45 +134,42 @@ const { E2E_DATA_PATH: dataPath } = process.env;
138
134
  await this.applyDeployBananaTokenSnapshot();
139
135
  }
140
136
  async applyInitialAccountsSnapshot() {
141
- await this.snapshotManager.snapshot('initial_accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { pxe, aztecNode, aztecNodeConfig })=>{
142
- this.pxe = pxe;
137
+ await this.snapshotManager.snapshot('initial_accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { wallet, aztecNode, cheatCodes })=>{
138
+ this.wallet = wallet;
143
139
  this.aztecNode = aztecNode;
144
140
  this.gasSettings = GasSettings.default({
145
141
  maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2)
146
142
  });
147
- this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
148
- this.wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
149
- this.wallets.forEach((w, i)=>this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
150
- this.accounts = this.wallets.map((w)=>w.getAddress());
151
- [this.aliceWallet, this.bobWallet] = this.wallets.slice(0, 2);
152
- [this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts;
143
+ this.cheatCodes = cheatCodes;
144
+ this.accounts = deployedAccounts.map((a)=>a.address);
145
+ this.accounts.forEach((a, i)=>this.logger.verbose(`Account ${i} address: ${a}`));
146
+ [this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
153
147
  // We set Alice as the FPC admin to avoid the need for deployment of another account.
154
148
  this.fpcAdmin = this.aliceAddress;
155
149
  const canonicalFeeJuice = await getCanonicalFeeJuice();
156
- this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.aliceWallet);
150
+ this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
157
151
  });
158
152
  }
159
153
  async applyPublicDeployAccountsSnapshot() {
160
- await this.snapshotManager.snapshot('public_deploy_accounts', ()=>ensureAccountContractsPublished(this.aliceWallet, this.wallets));
154
+ await this.snapshotManager.snapshot('public_deploy_accounts', ()=>ensureAccountContractsPublished(this.wallet, this.accounts));
161
155
  }
162
156
  async applySetupFeeJuiceSnapshot() {
163
157
  await this.snapshotManager.snapshot('setup_fee_juice', async ()=>{}, async (_data, context)=>{
164
158
  this.context = context;
165
- this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.aliceWallet);
159
+ this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
166
160
  this.getGasBalanceFn = getBalancesFn('⛽', this.feeJuiceContract.methods.balance_of_public, this.aliceAddress, this.logger);
167
161
  this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
168
162
  aztecNode: context.aztecNode,
169
163
  aztecNodeAdmin: context.aztecNode,
170
- pxeService: context.pxe,
171
164
  l1Client: context.deployL1ContractsValues.l1Client,
172
- wallet: this.aliceWallet,
165
+ wallet: this.wallet,
173
166
  logger: this.logger
174
167
  });
175
168
  });
176
169
  }
177
170
  async applyDeployBananaTokenSnapshot() {
178
171
  await this.snapshotManager.snapshot('deploy_banana_token', async ()=>{
179
- const bananaCoin = await BananaCoin.deploy(this.aliceWallet, this.aliceAddress, 'BC', 'BC', 18n).send({
172
+ const bananaCoin = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n).send({
180
173
  from: this.aliceAddress
181
174
  }).deployed();
182
175
  this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
@@ -184,7 +177,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
184
177
  bananaCoinAddress: bananaCoin.address
185
178
  };
186
179
  }, async ({ bananaCoinAddress })=>{
187
- this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.aliceWallet);
180
+ this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.wallet);
188
181
  const logger = this.logger;
189
182
  this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, this.aliceAddress, logger);
190
183
  this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, this.aliceAddress, logger);
@@ -193,9 +186,9 @@ const { E2E_DATA_PATH: dataPath } = process.env;
193
186
  async applyFPCSetupSnapshot() {
194
187
  await this.snapshotManager.snapshot('fpc_setup', async (context)=>{
195
188
  const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
196
- expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
189
+ expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
197
190
  const bananaCoin = this.bananaCoin;
198
- const bananaFPC = await FPCContract.deploy(this.aliceWallet, bananaCoin.address, this.fpcAdmin).send({
191
+ const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin).send({
199
192
  from: this.aliceAddress
200
193
  }).deployed();
201
194
  this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
@@ -207,7 +200,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
207
200
  rollupAddress: context.deployL1ContractsValues.l1ContractAddresses.rollupAddress
208
201
  };
209
202
  }, async (data, context)=>{
210
- const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.aliceWallet);
203
+ const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.wallet);
211
204
  this.bananaFPC = bananaFPC;
212
205
  this.getCoinbaseBalance = async ()=>{
213
206
  const l1Client = createExtendedL1Client(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
@@ -224,7 +217,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
224
217
  return await this.rollupContract.getSequencerRewards(this.coinbase);
225
218
  };
226
219
  this.getProverFee = async (blockNumber)=>{
227
- const block = await this.pxe.getBlock(blockNumber);
220
+ const block = await this.aztecNode.getBlock(blockNumber);
228
221
  // @todo @lherskind As we deal with #13601
229
222
  // Right now the value is from `FeeLib.sol`
230
223
  const L1_GAS_PER_EPOCH_VERIFIED = 1000000n;
@@ -241,14 +234,14 @@ const { E2E_DATA_PATH: dataPath } = process.env;
241
234
  async applySponsoredFPCSetupSnapshot() {
242
235
  await this.snapshotManager.snapshot('sponsored_fpc_setup', async (context)=>{
243
236
  const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
244
- expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
245
- const sponsoredFPC = await setupSponsoredFPC(context.pxe);
237
+ expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
238
+ const sponsoredFPC = await setupSponsoredFPC(this.wallet);
246
239
  this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
247
240
  return {
248
241
  sponsoredFPCAddress: sponsoredFPC.address
249
242
  };
250
243
  }, async (data)=>{
251
- this.sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.aliceWallet);
244
+ this.sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.wallet);
252
245
  });
253
246
  }
254
247
  async applyFundAliceWithBananas() {
@@ -1,4 +1,6 @@
1
- import { AztecAddress, Fr, type L2Block } from '@aztec/aztec.js';
1
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import type { L2Block } from '@aztec/aztec.js/block';
3
+ import { Fr } from '@aztec/aztec.js/fields';
2
4
  import { BatchedBlob, Blob } from '@aztec/blob-lib';
3
5
  /**
4
6
  * Creates a json object that can be used to test the solidity contract.
@@ -1 +1 @@
1
- {"version":3,"file":"write_json.d.ts","sourceRoot":"","sources":["../../src/e2e_l1_publisher/write_json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAOpD;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,EAAE,EAAE,EACnB,KAAK,EAAE,IAAI,EAAE,EACb,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,YAAY,EAC9B,eAAe,EAAE,KAAK,MAAM,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CAqDf"}
1
+ {"version":3,"file":"write_json.d.ts","sourceRoot":"","sources":["../../src/e2e_l1_publisher/write_json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,IAAI,EAAiC,MAAM,iBAAiB,CAAC;AAOnF;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,EAAE,EAAE,EACnB,KAAK,EAAE,IAAI,EAAE,EACb,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,YAAY,EAC9B,eAAe,EAAE,KAAK,MAAM,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CAqDf"}
@@ -1,4 +1,4 @@
1
- import { Blob } from '@aztec/blob-lib';
1
+ import { getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
2
2
  import { writeFile } from 'fs/promises';
3
3
  const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
4
4
  /**
@@ -16,18 +16,18 @@ const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
16
16
  };
17
17
  const jsonObject = {
18
18
  populate: {
19
- l1ToL2Content: l1ToL2Content.map(asHex),
19
+ l1ToL2Content: l1ToL2Content.map((value)=>asHex(value)),
20
20
  recipient: asHex(recipientAddress.toField()),
21
21
  sender: deployerAddress
22
22
  },
23
23
  messages: {
24
- l2ToL1Messages: block.body.txEffects.flatMap((txEffect)=>txEffect.l2ToL1Msgs).map(asHex)
24
+ l2ToL1Messages: block.body.txEffects.flatMap((txEffect)=>txEffect.l2ToL1Msgs).map((value)=>asHex(value))
25
25
  },
26
26
  block: {
27
27
  // The json formatting in forge is a bit brittle, so we convert Fr to a number in the few values below.
28
28
  // This should not be a problem for testing as long as the values are not larger than u32.
29
29
  archive: asHex(block.archive.root),
30
- blobCommitments: Blob.getPrefixedEthBlobCommitments(blobs),
30
+ blobCommitments: getPrefixedEthBlobCommitments(blobs),
31
31
  batchedBlobInputs: batchedBlob.getEthBlobEvaluationInputs(),
32
32
  blockNumber: block.number,
33
33
  body: `0x${block.body.toBuffer().toString('hex')}`,
@@ -48,7 +48,7 @@ const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
48
48
  },
49
49
  totalManaUsed: block.header.totalManaUsed.toNumber()
50
50
  },
51
- headerHash: asHex(block.header.toPropose().hash()),
51
+ headerHash: asHex(block.getCheckpointHeader().hash()),
52
52
  numTxs: block.body.txEffects.length
53
53
  }
54
54
  };
@@ -1,4 +1,4 @@
1
- import type { AztecAddress } from '@aztec/aztec.js';
1
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
2
2
  import { EthAddress } from '@aztec/foundation/eth-address';
3
3
  import type { EthPrivateKey } from '@aztec/node-keystore';
4
4
  export declare function createJSONRPCSigner(keyLookup: Map<string, EthPrivateKey>, stats: Map<string, number>): import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/e2e_multi_validator/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAW1D,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAA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a,EAAE,aAAa,EAC5B,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,UAAU,EACrB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,YAAY,EAC3B,aAAa,EAAE,YAAY,iBA4B5B;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAcxG;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,iBAkB3B;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,aAAa,GAAG,UAAU,CAE1E"}
@@ -130,9 +130,7 @@ export async function createKeyFile3(fileName, validatorAddress, publisher1Key,
130
130
  schemaVersion: 1,
131
131
  validators: [
132
132
  {
133
- attester: {
134
- address: validatorAddress.toChecksumString()
135
- },
133
+ attester: validatorAddress.toChecksumString(),
136
134
  coinbase: coinbase.toChecksumString(),
137
135
  publisher: [
138
136
  publisher1Key,
@@ -155,9 +153,7 @@ export async function createKeyFile4(fileName, validator1Address, validator2Addr
155
153
  },
156
154
  validators: [
157
155
  {
158
- attester: {
159
- address: validator1Address.toChecksumString()
160
- },
156
+ attester: validator1Address.toChecksumString(),
161
157
  coinbase: coinbase1.toChecksumString(),
162
158
  publisher: {
163
159
  mnemonic: mnemonic,
@@ -168,9 +164,7 @@ export async function createKeyFile4(fileName, validator1Address, validator2Addr
168
164
  feeRecipient: feeRecipient1.toString()
169
165
  },
170
166
  {
171
- attester: {
172
- address: validator2Address.toChecksumString()
173
- },
167
+ attester: validator2Address.toChecksumString(),
174
168
  coinbase: coinbase2.toChecksumString(),
175
169
  publisher: [
176
170
  publisher2Key,
@@ -1,4 +1,7 @@
1
- import { type AccountWallet, AztecAddress, type Logger, type PXE } from '@aztec/aztec.js';
1
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import { type Logger } from '@aztec/aztec.js/log';
3
+ import type { AztecNode } from '@aztec/aztec.js/node';
4
+ import type { Wallet } from '@aztec/aztec.js/wallet';
2
5
  import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
3
6
  import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
4
7
  import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
@@ -6,9 +9,9 @@ export declare class NestedContractTest {
6
9
  private numberOfAccounts;
7
10
  private snapshotManager;
8
11
  logger: Logger;
9
- wallet: AccountWallet;
12
+ wallet: Wallet;
10
13
  defaultAccountAddress: AztecAddress;
11
- pxe: PXE;
14
+ aztecNode: AztecNode;
12
15
  parentContract: ParentContract;
13
16
  childContract: ChildContract;
14
17
  constructor(testName: string, numberOfAccounts?: number);
@@ -1 +1 @@
1
- {"version":3,"file":"nested_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_nested_contract/nested_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAgB,MAAM,iBAAiB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AAIzC,qBAAa,kBAAkB;IAY3B,OAAO,CAAC,gBAAgB;IAX1B,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAG,aAAa,CAAC;IACvB,qBAAqB,EAAG,YAAY,CAAC;IACrC,GAAG,EAAG,GAAG,CAAC;IAEV,cAAc,EAAG,cAAc,CAAC;IAChC,aAAa,EAAG,aAAa,CAAC;gBAG5B,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI;IAM9B;;;;OAIG;IACG,kBAAkB;IAuBlB,KAAK;IAIL,QAAQ;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AS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,oBAAoB;CAkB3B"}
@@ -1,5 +1,4 @@
1
- import { getSchnorrWallet } from '@aztec/accounts/schnorr';
2
- import { createLogger } from '@aztec/aztec.js';
1
+ import { createLogger } from '@aztec/aztec.js/log';
3
2
  import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
4
3
  import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
5
4
  import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
@@ -10,7 +9,7 @@ export class NestedContractTest {
10
9
  logger;
11
10
  wallet;
12
11
  defaultAccountAddress;
13
- pxe;
12
+ aztecNode;
14
13
  parentContract;
15
14
  childContract;
16
15
  constructor(testName, numberOfAccounts = 1){
@@ -24,12 +23,11 @@ export class NestedContractTest {
24
23
  * 1. Add 3 accounts.
25
24
  * 2. Publicly deploy accounts
26
25
  */ async applyBaseSnapshots() {
27
- await this.snapshotManager.snapshot('accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { pxe })=>{
28
- const wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
29
- wallets.forEach((w, i)=>this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
30
- [this.wallet] = wallets;
31
- this.defaultAccountAddress = this.wallet.getAddress();
32
- this.pxe = pxe;
26
+ await this.snapshotManager.snapshot('accounts', deployAccounts(this.numberOfAccounts, this.logger), ({ deployedAccounts }, { wallet, aztecNode })=>{
27
+ this.wallet = wallet;
28
+ [{ address: this.defaultAccountAddress }] = deployedAccounts;
29
+ this.aztecNode = aztecNode;
30
+ return Promise.resolve();
33
31
  });
34
32
  await this.snapshotManager.snapshot('public_deploy', async ()=>{}, async ()=>{
35
33
  this.logger.verbose(`Public deploy accounts...`);
@@ -0,0 +1,31 @@
1
+ import type { AztecNodeService } from '@aztec/aztec-node';
2
+ import { EthAddress } from '@aztec/aztec.js/addresses';
3
+ import { RollupContract } from '@aztec/ethereum';
4
+ import 'jest-extended';
5
+ import { P2PNetworkTest } from './p2p_network.js';
6
+ export declare class P2PInactivityTest {
7
+ readonly test: P2PNetworkTest;
8
+ nodes: AztecNodeService[];
9
+ activeNodes: AztecNodeService[];
10
+ inactiveNodes: AztecNodeService[];
11
+ rollup: RollupContract;
12
+ offlineValidators: EthAddress[];
13
+ private dataDir;
14
+ private inactiveNodeCount;
15
+ private keepInitialNode;
16
+ constructor(test: P2PNetworkTest, opts: {
17
+ inactiveNodeCount: number;
18
+ keepInitialNode?: boolean;
19
+ });
20
+ static create(testName: string, opts: {
21
+ slashInactivityConsecutiveEpochThreshold: number;
22
+ inactiveNodeCount: number;
23
+ keepInitialNode?: boolean;
24
+ }): Promise<P2PInactivityTest>;
25
+ setup(): Promise<this>;
26
+ teardown(): Promise<void>;
27
+ get ctx(): import("../fixtures/snapshot_manager.js").SubsystemsContext;
28
+ get logger(): import("@aztec/foundation/log").Logger;
29
+ get slashingAmount(): bigint;
30
+ }
31
+ //# sourceMappingURL=inactivity_slash_test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inactivity_slash_test.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/inactivity_slash_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,eAAe,CAAC;AAKvB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBlD,qBAAa,iBAAiB;aAaV,IAAI,EAAE,cAAc;IAZ/B,KAAK,EAAG,gBAAgB,EAAE,CAAC;IAC3B,WAAW,EAAG,gBAAgB,EAAE,CAAC;IACjC,aAAa,EAAG,gBAAgB,EAAE,CAAC;IAEnC,MAAM,EAAG,cAAc,CAAC;IACxB,iBAAiB,EAAG,UAAU,EAAE,CAAC;IAExC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,eAAe,CAAU;gBAGf,IAAI,EAAE,cAAc,EACpC,IAAI,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE;WAOnD,MAAM,CACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;QAAE,wCAAwC,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE;IAgCrG,KAAK;IA4EL,QAAQ;IAQrB,IAAW,GAAG,gEAEb;IAED,IAAW,MAAM,2CAEhB;IAED,IAAW,cAAc,WAExB;CACF"}
@@ -0,0 +1,135 @@
1
+ import fs from 'fs';
2
+ import 'jest-extended';
3
+ import os from 'os';
4
+ import path from 'path';
5
+ import { createNodes } from '../fixtures/setup_p2p_test.js';
6
+ import { P2PNetworkTest } from './p2p_network.js';
7
+ const NUM_NODES = 6;
8
+ const NUM_VALIDATORS = NUM_NODES;
9
+ const COMMITTEE_SIZE = NUM_VALIDATORS;
10
+ const SLASHING_QUORUM = 3;
11
+ const EPOCH_DURATION = 2;
12
+ const SLASHING_ROUND_SIZE_IN_EPOCHS = 2;
13
+ const BOOT_NODE_UDP_PORT = 4500;
14
+ const ETHEREUM_SLOT_DURATION = process.env.CI ? 8 : 4;
15
+ const AZTEC_SLOT_DURATION = ETHEREUM_SLOT_DURATION * 2;
16
+ const SLASHING_UNIT = BigInt(1e18);
17
+ const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
18
+ // How many epochs it may take to set everything up, so we dont slash during this period
19
+ const SETUP_EPOCH_DURATION = 5;
20
+ export class P2PInactivityTest {
21
+ test;
22
+ nodes;
23
+ activeNodes;
24
+ inactiveNodes;
25
+ rollup;
26
+ offlineValidators;
27
+ dataDir;
28
+ inactiveNodeCount;
29
+ keepInitialNode;
30
+ constructor(test, opts){
31
+ this.test = test;
32
+ this.dataDir = fs.mkdtempSync(path.join(os.tmpdir(), test.testName));
33
+ this.inactiveNodeCount = opts.inactiveNodeCount;
34
+ this.keepInitialNode = opts.keepInitialNode ?? false;
35
+ }
36
+ static async create(testName, opts) {
37
+ const test = await P2PNetworkTest.create({
38
+ testName,
39
+ numberOfNodes: 0,
40
+ numberOfValidators: NUM_VALIDATORS,
41
+ basePort: BOOT_NODE_UDP_PORT,
42
+ startProverNode: true,
43
+ initialConfig: {
44
+ proverNodeConfig: {
45
+ proverNodeEpochProvingDelayMs: AZTEC_SLOT_DURATION * 1000
46
+ },
47
+ aztecTargetCommitteeSize: COMMITTEE_SIZE,
48
+ aztecSlotDuration: AZTEC_SLOT_DURATION,
49
+ ethereumSlotDuration: ETHEREUM_SLOT_DURATION,
50
+ aztecProofSubmissionEpochs: 1024,
51
+ listenAddress: '127.0.0.1',
52
+ minTxsPerBlock: 0,
53
+ aztecEpochDuration: EPOCH_DURATION,
54
+ validatorReexecute: false,
55
+ sentinelEnabled: true,
56
+ slashingQuorum: SLASHING_QUORUM,
57
+ slashingRoundSizeInEpochs: SLASHING_ROUND_SIZE_IN_EPOCHS,
58
+ slashInactivityTargetPercentage: 0.8,
59
+ slashGracePeriodL2Slots: SETUP_EPOCH_DURATION * EPOCH_DURATION,
60
+ slashAmountSmall: SLASHING_UNIT,
61
+ slashAmountMedium: SLASHING_UNIT * 2n,
62
+ slashAmountLarge: SLASHING_UNIT * 3n,
63
+ ...opts
64
+ }
65
+ });
66
+ return new P2PInactivityTest(test, opts);
67
+ }
68
+ async setup() {
69
+ await this.test.applyBaseSnapshots();
70
+ await this.test.setup();
71
+ // Set slashing penalties for inactivity
72
+ const { rollup } = await this.test.getContracts();
73
+ const [activationThreshold, ejectionThreshold, localEjectionThreshold] = await Promise.all([
74
+ rollup.getActivationThreshold(),
75
+ rollup.getEjectionThreshold(),
76
+ rollup.getLocalEjectionThreshold()
77
+ ]);
78
+ const biggestEjection = ejectionThreshold > localEjectionThreshold ? ejectionThreshold : localEjectionThreshold;
79
+ expect(activationThreshold - SLASHING_AMOUNT).toBeLessThan(biggestEjection);
80
+ this.test.ctx.aztecNodeConfig.slashInactivityPenalty = SLASHING_AMOUNT;
81
+ this.rollup = rollup;
82
+ if (!this.keepInitialNode) {
83
+ await this.test.ctx.aztecNode.stop();
84
+ }
85
+ // Create all active nodes
86
+ this.activeNodes = await createNodes(this.test.ctx.aztecNodeConfig, this.test.ctx.dateProvider, this.test.bootstrapNodeEnr, NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode), BOOT_NODE_UDP_PORT, this.test.prefilledPublicData, this.dataDir, undefined, Number(this.keepInitialNode));
87
+ // And the ones with an initially disabled sequencer
88
+ const inactiveConfig = {
89
+ ...this.test.ctx.aztecNodeConfig,
90
+ dontStartSequencer: true
91
+ };
92
+ this.inactiveNodes = await createNodes(inactiveConfig, this.test.ctx.dateProvider, this.test.bootstrapNodeEnr, this.inactiveNodeCount, BOOT_NODE_UDP_PORT, this.test.prefilledPublicData, this.dataDir, undefined, NUM_NODES - this.inactiveNodeCount);
93
+ this.nodes = [
94
+ ...this.keepInitialNode ? [
95
+ this.test.ctx.aztecNode
96
+ ] : [],
97
+ ...this.activeNodes,
98
+ ...this.inactiveNodes
99
+ ];
100
+ if (this.nodes.length !== NUM_NODES) {
101
+ throw new Error(`Expected ${NUM_NODES} nodes but got ${this.nodes.length}`);
102
+ }
103
+ this.offlineValidators = this.test.validators.slice(this.test.validators.length - this.inactiveNodeCount).map((a)=>a.attester);
104
+ this.test.logger.warn(`Setup complete. Offline validators are ${this.offlineValidators.join(', ')}.`, {
105
+ validators: this.test.validators,
106
+ offlineValidators: this.offlineValidators
107
+ });
108
+ // Wait for P2P mesh to be fully formed before starting slashing period
109
+ // This prevents race conditions where validators propose blocks before the network is ready
110
+ await this.test.waitForP2PMeshConnectivity(this.nodes, NUM_NODES);
111
+ this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION + 1} to start slashing`);
112
+ await this.test.ctx.cheatCodes.rollup.advanceToEpoch(SETUP_EPOCH_DURATION + 1);
113
+ return this;
114
+ }
115
+ async teardown() {
116
+ await this.test.stopNodes(this.nodes);
117
+ await this.test.teardown();
118
+ for(let i = 0; i < NUM_NODES; i++){
119
+ fs.rmSync(`${this.dataDir}-${i}`, {
120
+ recursive: true,
121
+ force: true,
122
+ maxRetries: 3
123
+ });
124
+ }
125
+ }
126
+ get ctx() {
127
+ return this.test.ctx;
128
+ }
129
+ get logger() {
130
+ return this.test.logger;
131
+ }
132
+ get slashingAmount() {
133
+ return SLASHING_AMOUNT;
134
+ }
135
+ }