@aztec/end-to-end 0.0.1-commit.b655e406 → 0.0.1-commit.d3ec352c
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.
- package/dest/bench/client_flows/benchmark.d.ts +1 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +8 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +53 -30
- package/dest/bench/client_flows/config.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.js +5 -27
- package/dest/bench/utils.d.ts +2 -2
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +2 -2
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +4 -3
- package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts +9 -8
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +8 -7
- package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
- package/dest/e2e_fees/bridging_race.notest.js +1 -1
- package/dest/e2e_fees/fees_test.d.ts +3 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +12 -9
- package/dest/e2e_l1_publisher/write_json.d.ts +1 -1
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +5 -4
- package/dest/e2e_multi_validator/utils.d.ts +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +4 -3
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +2 -2
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +6 -2
- package/dest/e2e_p2p/p2p_network.d.ts +214 -9
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +5 -3
- package/dest/e2e_p2p/shared.d.ts +5 -5
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +6 -5
- package/dest/e2e_token_contract/token_contract_test.d.ts +1 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +2 -2
- package/dest/fixtures/e2e_prover_test.d.ts +3 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +18 -14
- package/dest/fixtures/fixtures.d.ts +1 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +1 -1
- package/dest/fixtures/get_acvm_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/index.d.ts +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +1 -1
- package/dest/fixtures/logging.d.ts +1 -1
- package/dest/fixtures/setup_l1_contracts.d.ts +475 -4
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts +4 -4
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +15 -7
- package/dest/fixtures/snapshot_manager.d.ts +2 -2
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/token_utils.d.ts +5 -2
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +7 -4
- package/dest/fixtures/utils.d.ts +451 -5
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +11 -12
- package/dest/fixtures/web3signer.d.ts +1 -1
- package/dest/fixtures/with_telemetry_utils.d.ts +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/quality_of_service/alert_checker.d.ts +1 -1
- package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts +3 -13
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.d.ts +1 -11
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +1 -1
- package/dest/shared/index.d.ts +1 -1
- package/dest/shared/jest_setup.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +11 -11
- package/dest/simulators/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +1 -5
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +4 -2
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +5 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +43 -9
- package/dest/spartan/utils.d.ts +22 -19
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +66 -33
- package/package.json +42 -40
- package/src/bench/client_flows/client_flows_benchmark.ts +75 -30
- package/src/bench/client_flows/data_extractor.ts +6 -28
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +2 -2
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +4 -3
- package/src/e2e_deploy_contract/deploy_test.ts +1 -1
- package/src/e2e_epochs/epochs_test.ts +15 -14
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +15 -11
- package/src/e2e_l1_publisher/write_json.ts +5 -4
- package/src/e2e_nested_contract/nested_contract_test.ts +4 -3
- package/src/e2e_p2p/inactivity_slash_test.ts +6 -2
- package/src/e2e_p2p/p2p_network.ts +7 -3
- package/src/e2e_p2p/shared.ts +8 -5
- package/src/e2e_token_contract/token_contract_test.ts +2 -2
- package/src/fixtures/e2e_prover_test.ts +15 -16
- package/src/fixtures/fixtures.ts +1 -2
- package/src/fixtures/setup_p2p_test.ts +20 -6
- package/src/fixtures/token_utils.ts +4 -4
- package/src/fixtures/utils.ts +36 -17
- package/src/guides/up_quick_start.sh +1 -1
- package/src/shared/cross_chain_test_harness.ts +2 -1
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/uniswap_l1_l2.ts +11 -11
- package/src/simulators/lending_simulator.ts +4 -2
- package/src/spartan/DEVELOP.md +7 -0
- package/src/spartan/setup_test_wallets.ts +47 -11
- package/src/spartan/utils.ts +73 -32
|
@@ -20,6 +20,7 @@ import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contract
|
|
|
20
20
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
21
21
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
22
22
|
import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
23
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
23
24
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
24
25
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
25
26
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
@@ -69,15 +70,21 @@ export class ClientFlowsBenchmark {
|
|
|
69
70
|
public feeJuiceContract!: FeeJuiceContract;
|
|
70
71
|
// Asset in which fees are paid via FPC
|
|
71
72
|
public bananaCoin!: BananaCoin;
|
|
73
|
+
public bananaCoinInstance!: ContractInstanceWithAddress;
|
|
72
74
|
public bananaFPC!: FPCContract;
|
|
75
|
+
public bananaFPCInstance!: ContractInstanceWithAddress;
|
|
73
76
|
// Random asset we want to trade
|
|
74
77
|
public candyBarCoin!: TokenContract;
|
|
78
|
+
public candyBarCoinInstance!: ContractInstanceWithAddress;
|
|
75
79
|
// AMM contract
|
|
76
80
|
public amm!: AMMContract;
|
|
81
|
+
public ammInstance!: ContractInstanceWithAddress;
|
|
77
82
|
// Liquidity token for AMM
|
|
78
83
|
public liquidityToken!: TokenContract;
|
|
84
|
+
public liquidityTokenInstance!: ContractInstanceWithAddress;
|
|
79
85
|
// Sponsored FPC contract
|
|
80
86
|
public sponsoredFPC!: SponsoredFPCContract;
|
|
87
|
+
public sponsoredFPCInstance!: ContractInstanceWithAddress;
|
|
81
88
|
|
|
82
89
|
// PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
|
|
83
90
|
public userWallet!: TestWallet;
|
|
@@ -204,7 +211,7 @@ export class ClientFlowsBenchmark {
|
|
|
204
211
|
this.sequencerAddress = sequencerAddress;
|
|
205
212
|
|
|
206
213
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
207
|
-
this.feeJuiceContract =
|
|
214
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
208
215
|
this.coinbase = EthAddress.random();
|
|
209
216
|
|
|
210
217
|
const userPXEConfig = getPXEConfig();
|
|
@@ -229,7 +236,7 @@ export class ClientFlowsBenchmark {
|
|
|
229
236
|
async (_data, context) => {
|
|
230
237
|
this.context = context;
|
|
231
238
|
|
|
232
|
-
this.feeJuiceContract =
|
|
239
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
|
|
233
240
|
|
|
234
241
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
235
242
|
aztecNode: context.aztecNode,
|
|
@@ -246,14 +253,22 @@ export class ClientFlowsBenchmark {
|
|
|
246
253
|
await this.snapshotManager.snapshot(
|
|
247
254
|
'deploy_banana_token',
|
|
248
255
|
async () => {
|
|
249
|
-
const bananaCoin = await BananaCoin.deploy(
|
|
256
|
+
const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
|
|
257
|
+
this.adminWallet,
|
|
258
|
+
this.adminAddress,
|
|
259
|
+
'BC',
|
|
260
|
+
'BC',
|
|
261
|
+
18n,
|
|
262
|
+
)
|
|
250
263
|
.send({ from: this.adminAddress })
|
|
251
|
-
.
|
|
264
|
+
.wait();
|
|
252
265
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
253
|
-
return { bananaCoinAddress: bananaCoin.address };
|
|
266
|
+
return { bananaCoinAddress: bananaCoin.address, bananaCoinInstance };
|
|
254
267
|
},
|
|
255
|
-
|
|
256
|
-
this.bananaCoin =
|
|
268
|
+
({ bananaCoinAddress, bananaCoinInstance }) => {
|
|
269
|
+
this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.adminWallet);
|
|
270
|
+
this.bananaCoinInstance = bananaCoinInstance;
|
|
271
|
+
return Promise.resolve();
|
|
257
272
|
},
|
|
258
273
|
);
|
|
259
274
|
}
|
|
@@ -262,14 +277,22 @@ export class ClientFlowsBenchmark {
|
|
|
262
277
|
await this.snapshotManager.snapshot(
|
|
263
278
|
'deploy_candy_bar_token',
|
|
264
279
|
async () => {
|
|
265
|
-
const candyBarCoin = await TokenContract.deploy(
|
|
280
|
+
const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
|
|
281
|
+
this.adminWallet,
|
|
282
|
+
this.adminAddress,
|
|
283
|
+
'CBC',
|
|
284
|
+
'CBC',
|
|
285
|
+
18n,
|
|
286
|
+
)
|
|
266
287
|
.send({ from: this.adminAddress })
|
|
267
|
-
.
|
|
288
|
+
.wait();
|
|
268
289
|
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
269
|
-
return { candyBarCoinAddress: candyBarCoin.address };
|
|
290
|
+
return { candyBarCoinAddress: candyBarCoin.address, candyBarCoinInstance };
|
|
270
291
|
},
|
|
271
|
-
|
|
272
|
-
this.candyBarCoin =
|
|
292
|
+
({ candyBarCoinAddress, candyBarCoinInstance }) => {
|
|
293
|
+
this.candyBarCoin = TokenContract.at(candyBarCoinAddress, this.adminWallet);
|
|
294
|
+
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
295
|
+
return Promise.resolve();
|
|
273
296
|
},
|
|
274
297
|
);
|
|
275
298
|
}
|
|
@@ -282,18 +305,24 @@ export class ClientFlowsBenchmark {
|
|
|
282
305
|
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
283
306
|
|
|
284
307
|
const bananaCoin = this.bananaCoin;
|
|
285
|
-
const bananaFPC = await FPCContract.deploy(
|
|
308
|
+
const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
|
|
309
|
+
this.adminWallet,
|
|
310
|
+
bananaCoin.address,
|
|
311
|
+
this.adminAddress,
|
|
312
|
+
)
|
|
286
313
|
.send({ from: this.adminAddress })
|
|
287
|
-
.
|
|
314
|
+
.wait();
|
|
288
315
|
|
|
289
316
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
290
317
|
|
|
291
318
|
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
|
|
292
319
|
|
|
293
|
-
return { bananaFPCAddress: bananaFPC.address };
|
|
320
|
+
return { bananaFPCAddress: bananaFPC.address, bananaFPCInstance };
|
|
294
321
|
},
|
|
295
|
-
|
|
296
|
-
this.bananaFPC =
|
|
322
|
+
data => {
|
|
323
|
+
this.bananaFPC = FPCContract.at(data.bananaFPCAddress, this.adminWallet);
|
|
324
|
+
this.bananaFPCInstance = data.bananaFPCInstance;
|
|
325
|
+
return Promise.resolve();
|
|
297
326
|
},
|
|
298
327
|
);
|
|
299
328
|
}
|
|
@@ -302,12 +331,14 @@ export class ClientFlowsBenchmark {
|
|
|
302
331
|
await this.snapshotManager.snapshot(
|
|
303
332
|
'deploy_sponsored_fpc',
|
|
304
333
|
async () => {
|
|
305
|
-
const
|
|
306
|
-
this.logger.info(`SponsoredFPC at ${
|
|
307
|
-
return { sponsoredFPCAddress:
|
|
334
|
+
const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
|
|
335
|
+
this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
|
|
336
|
+
return { sponsoredFPCAddress: sponsoredFPCInstance.address, sponsoredFPCInstance };
|
|
308
337
|
},
|
|
309
|
-
|
|
310
|
-
this.sponsoredFPC =
|
|
338
|
+
({ sponsoredFPCAddress, sponsoredFPCInstance }) => {
|
|
339
|
+
this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
|
|
340
|
+
this.sponsoredFPCInstance = sponsoredFPCInstance;
|
|
341
|
+
return Promise.resolve();
|
|
311
342
|
},
|
|
312
343
|
);
|
|
313
344
|
}
|
|
@@ -361,24 +392,38 @@ export class ClientFlowsBenchmark {
|
|
|
361
392
|
await this.snapshotManager.snapshot(
|
|
362
393
|
'deploy_amm',
|
|
363
394
|
async () => {
|
|
364
|
-
const liquidityToken = await TokenContract.deploy(
|
|
395
|
+
const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
|
|
396
|
+
this.adminWallet,
|
|
397
|
+
this.adminAddress,
|
|
398
|
+
'LPT',
|
|
399
|
+
'LPT',
|
|
400
|
+
18n,
|
|
401
|
+
)
|
|
365
402
|
.send({ from: this.adminAddress })
|
|
366
|
-
.
|
|
367
|
-
const amm = await AMMContract.deploy(
|
|
403
|
+
.wait();
|
|
404
|
+
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
|
|
368
405
|
this.adminWallet,
|
|
369
406
|
this.bananaCoin.address,
|
|
370
407
|
this.candyBarCoin.address,
|
|
371
408
|
liquidityToken.address,
|
|
372
409
|
)
|
|
373
410
|
.send({ from: this.adminAddress })
|
|
374
|
-
.
|
|
411
|
+
.wait();
|
|
375
412
|
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
376
413
|
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
|
|
377
|
-
return {
|
|
414
|
+
return {
|
|
415
|
+
ammAddress: amm.address,
|
|
416
|
+
ammInstance,
|
|
417
|
+
liquidityTokenAddress: liquidityToken.address,
|
|
418
|
+
liquidityTokenInstance,
|
|
419
|
+
};
|
|
378
420
|
},
|
|
379
|
-
|
|
380
|
-
this.liquidityToken =
|
|
381
|
-
this.
|
|
421
|
+
({ ammAddress, ammInstance, liquidityTokenAddress, liquidityTokenInstance }) => {
|
|
422
|
+
this.liquidityToken = TokenContract.at(liquidityTokenAddress, this.adminWallet);
|
|
423
|
+
this.liquidityTokenInstance = liquidityTokenInstance;
|
|
424
|
+
this.amm = AMMContract.at(ammAddress, this.adminWallet);
|
|
425
|
+
this.ammInstance = ammInstance;
|
|
426
|
+
return Promise.resolve();
|
|
382
427
|
},
|
|
383
428
|
);
|
|
384
429
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BBNativePrivateKernelProver } from '@aztec/bb-prover/client/native';
|
|
3
|
-
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/client/wasm/bundle';
|
|
1
|
+
import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
|
|
4
2
|
import { createLogger, logger } from '@aztec/foundation/log';
|
|
5
3
|
import { Timer } from '@aztec/foundation/timer';
|
|
6
4
|
import { WASMSimulator } from '@aztec/simulator/client';
|
|
@@ -11,26 +9,7 @@ import { Decoder } from 'msgpackr';
|
|
|
11
9
|
import { readFile, readdir, writeFile } from 'node:fs/promises';
|
|
12
10
|
import { join } from 'node:path';
|
|
13
11
|
|
|
14
|
-
import { type Log,
|
|
15
|
-
|
|
16
|
-
type NativeProverConfig = { bbBinaryPath?: string; bbWorkingDirectory?: string };
|
|
17
|
-
|
|
18
|
-
async function createProver(config: NativeProverConfig = {}, log: Logger) {
|
|
19
|
-
const simulator = new WASMSimulator();
|
|
20
|
-
if (!config.bbBinaryPath || !config.bbWorkingDirectory) {
|
|
21
|
-
return { prover: new BBWASMBundlePrivateKernelProver(simulator, 16, log), type: 'wasm' as ProverType };
|
|
22
|
-
} else {
|
|
23
|
-
const bbConfig = config as Required<NativeProverConfig>;
|
|
24
|
-
return {
|
|
25
|
-
prover: await BBNativePrivateKernelProver.new(
|
|
26
|
-
{ bbSkipCleanup: false, numConcurrentIVCVerifiers: 1, bbIVCConcurrency: 1, ...bbConfig },
|
|
27
|
-
simulator,
|
|
28
|
-
log,
|
|
29
|
-
),
|
|
30
|
-
type: 'native' as ProverType,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
12
|
+
import { type Log, ProxyLogger, generateBenchmark } from './benchmark.js';
|
|
34
13
|
|
|
35
14
|
async function main() {
|
|
36
15
|
ProxyLogger.create();
|
|
@@ -41,10 +20,9 @@ async function main() {
|
|
|
41
20
|
}
|
|
42
21
|
const flows = await readdir(ivcFolder);
|
|
43
22
|
logger.info(`Flows in ${ivcFolder}: \n${flows.map(flowName => `\t- ${flowName}`).join('\n')}`);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
);
|
|
23
|
+
const simulator = new WASMSimulator();
|
|
24
|
+
const log = proxyLogger.createLogger('bb:prover');
|
|
25
|
+
const prover = new BBBundlePrivateKernelProver(simulator, log);
|
|
48
26
|
|
|
49
27
|
const userLog = createLogger('chonk_flows:data_processor');
|
|
50
28
|
|
|
@@ -96,7 +74,7 @@ async function main() {
|
|
|
96
74
|
if (!(profile.stats.timings as ProvingTimings).proving) {
|
|
97
75
|
(profile.stats.timings as ProvingTimings).proving = provingTime;
|
|
98
76
|
}
|
|
99
|
-
const benchmark = generateBenchmark(flow, currentLogs, profile.stats, privateExecutionSteps,
|
|
77
|
+
const benchmark = generateBenchmark(flow, currentLogs, profile.stats, privateExecutionSteps, 'native', error);
|
|
100
78
|
await writeFile(join(ivcFolder, flow, 'benchmark.json'), JSON.stringify(benchmark, null, 2));
|
|
101
79
|
proxyLogger.flushLogs();
|
|
102
80
|
}
|
|
@@ -130,7 +130,7 @@ export class BlacklistTokenContractTest {
|
|
|
130
130
|
},
|
|
131
131
|
async ({ tokenContractAddress, badAccountAddress }) => {
|
|
132
132
|
// Restore the token contract state.
|
|
133
|
-
this.asset =
|
|
133
|
+
this.asset = TokenBlacklistContract.at(tokenContractAddress, this.wallet);
|
|
134
134
|
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
135
135
|
|
|
136
136
|
this.tokenSim = new TokenSimulator(
|
|
@@ -141,7 +141,7 @@ export class BlacklistTokenContractTest {
|
|
|
141
141
|
[this.adminAddress, this.otherAddress, this.blacklistedAddress],
|
|
142
142
|
);
|
|
143
143
|
|
|
144
|
-
this.badAccount =
|
|
144
|
+
this.badAccount = InvalidAccountContract.at(badAccountAddress, this.wallet);
|
|
145
145
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
146
146
|
|
|
147
147
|
expect(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).toEqual(
|
|
@@ -134,9 +134,9 @@ export class CrossChainMessagingTest {
|
|
|
134
134
|
|
|
135
135
|
return this.crossChainTestHarness.toCrossChainContext();
|
|
136
136
|
},
|
|
137
|
-
|
|
138
|
-
this.l2Token =
|
|
139
|
-
this.l2Bridge =
|
|
137
|
+
crossChainContext => {
|
|
138
|
+
this.l2Token = TokenContract.at(crossChainContext.l2Token, this.wallet);
|
|
139
|
+
this.l2Bridge = TokenBridgeContract.at(crossChainContext.l2Bridge, this.wallet);
|
|
140
140
|
|
|
141
141
|
// There is an issue with the reviver so we are getting strings sometimes. Working around it here.
|
|
142
142
|
this.ethAccount = EthAddress.fromString(crossChainContext.ethAccount.toString());
|
|
@@ -172,6 +172,7 @@ export class CrossChainMessagingTest {
|
|
|
172
172
|
this.l1Client = l1Client;
|
|
173
173
|
this.inbox = inbox;
|
|
174
174
|
this.outbox = outbox;
|
|
175
|
+
return Promise.resolve();
|
|
175
176
|
},
|
|
176
177
|
);
|
|
177
178
|
}
|
|
@@ -73,6 +73,6 @@ export class DeployTest {
|
|
|
73
73
|
export type StatefulContractCtorArgs = Parameters<StatefulTestContract['methods']['constructor']>;
|
|
74
74
|
|
|
75
75
|
export type ContractArtifactClass<T extends ContractBase> = {
|
|
76
|
-
at(address: AztecAddress, wallet: Wallet):
|
|
76
|
+
at(address: AztecAddress, wallet: Wallet): T;
|
|
77
77
|
artifact: ContractArtifact;
|
|
78
78
|
};
|
|
@@ -9,6 +9,7 @@ import { EpochCache } from '@aztec/epoch-cache';
|
|
|
9
9
|
import { DefaultL1ContractsConfig, type ExtendedViemWalletClient, createExtendedL1Client } from '@aztec/ethereum';
|
|
10
10
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
11
11
|
import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
12
|
+
import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
12
13
|
import { SecretValue } from '@aztec/foundation/config';
|
|
13
14
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
14
15
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
@@ -25,7 +26,7 @@ import {
|
|
|
25
26
|
SequencerState,
|
|
26
27
|
} from '@aztec/sequencer-client';
|
|
27
28
|
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
28
|
-
import {
|
|
29
|
+
import { type BlockParameter, EthAddress } from '@aztec/stdlib/block';
|
|
29
30
|
import { type L1RollupConstants, getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
30
31
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
31
32
|
|
|
@@ -279,7 +280,7 @@ export class EpochsTestContext {
|
|
|
279
280
|
|
|
280
281
|
/** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */
|
|
281
282
|
public async waitUntilEpochStarts(epoch: number) {
|
|
282
|
-
const [start] = getTimestampRangeForEpoch(
|
|
283
|
+
const [start] = getTimestampRangeForEpoch(EpochNumber(epoch), this.constants);
|
|
283
284
|
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
284
285
|
await waitUntilL1Timestamp(
|
|
285
286
|
this.l1Client,
|
|
@@ -290,30 +291,30 @@ export class EpochsTestContext {
|
|
|
290
291
|
return start;
|
|
291
292
|
}
|
|
292
293
|
|
|
293
|
-
/** Waits until the given
|
|
294
|
-
public async
|
|
294
|
+
/** Waits until the given checkpoint number is mined. */
|
|
295
|
+
public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout = 60) {
|
|
295
296
|
await retryUntil(
|
|
296
|
-
() => Promise.resolve(target <= this.monitor.
|
|
297
|
-
`Wait until
|
|
297
|
+
() => Promise.resolve(target <= this.monitor.checkpointNumber),
|
|
298
|
+
`Wait until checkpoint ${target}`,
|
|
298
299
|
timeout,
|
|
299
300
|
0.1,
|
|
300
301
|
);
|
|
301
302
|
}
|
|
302
303
|
|
|
303
|
-
/** Waits until the given
|
|
304
|
-
public async
|
|
304
|
+
/** Waits until the given checkpoint number is marked as proven. */
|
|
305
|
+
public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout = 60) {
|
|
305
306
|
await retryUntil(
|
|
306
|
-
() => Promise.resolve(
|
|
307
|
-
`Wait proven
|
|
307
|
+
() => Promise.resolve(target <= this.monitor.provenCheckpointNumber),
|
|
308
|
+
`Wait proven checkpoint ${target}`,
|
|
308
309
|
timeout,
|
|
309
310
|
0.1,
|
|
310
311
|
);
|
|
311
|
-
return this.monitor.
|
|
312
|
+
return this.monitor.provenCheckpointNumber;
|
|
312
313
|
}
|
|
313
314
|
|
|
314
315
|
/** Waits until the last slot of the proof submission window for a given epoch. */
|
|
315
316
|
public async waitUntilLastSlotOfProofSubmissionWindow(epochNumber: number | bigint) {
|
|
316
|
-
const deadline = getProofSubmissionDeadlineTimestamp(BigInt(epochNumber), this.constants);
|
|
317
|
+
const deadline = getProofSubmissionDeadlineTimestamp(EpochNumber.fromBigInt(BigInt(epochNumber)), this.constants);
|
|
317
318
|
const oneSlotBefore = deadline - BigInt(this.constants.slotDuration);
|
|
318
319
|
const date = new Date(Number(oneSlotBefore) * 1000);
|
|
319
320
|
this.logger.info(`Waiting until last slot of submission window for epoch ${epochNumber} at ${date}`, {
|
|
@@ -323,7 +324,7 @@ export class EpochsTestContext {
|
|
|
323
324
|
}
|
|
324
325
|
|
|
325
326
|
/** Waits for the aztec node to sync to the target block number. */
|
|
326
|
-
public async waitForNodeToSync(blockNumber:
|
|
327
|
+
public async waitForNodeToSync(blockNumber: BlockNumber, type: 'proven' | 'finalized' | 'historic') {
|
|
327
328
|
const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
|
|
328
329
|
let synched = false;
|
|
329
330
|
while (!synched) {
|
|
@@ -372,7 +373,7 @@ export class EpochsTestContext {
|
|
|
372
373
|
}
|
|
373
374
|
|
|
374
375
|
/** Verifies whether the given block number is found on the aztec node. */
|
|
375
|
-
public async verifyHistoricBlock(blockNumber:
|
|
376
|
+
public async verifyHistoricBlock(blockNumber: BlockParameter, expectedSuccess: boolean) {
|
|
376
377
|
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
377
378
|
// at a particular block, so we know whether that historic block is available or has been
|
|
378
379
|
// pruned. Note that `getBlock` would not work here, since it only hits the archiver.
|
|
@@ -60,7 +60,7 @@ describe('e2e_fees bridging_race', () => {
|
|
|
60
60
|
const origApprove = l1TokenManager.approve.bind(l1TokenManager);
|
|
61
61
|
l1TokenManager.approve = async (amount: bigint, address: Hex, addressName = '') => {
|
|
62
62
|
await origApprove(amount, address, addressName);
|
|
63
|
-
const sleepTime = (Number(t.chainMonitor.
|
|
63
|
+
const sleepTime = (Number(t.chainMonitor.checkpointTimestamp) + AZTEC_SLOT_DURATION) * 1000 - Date.now() - 500;
|
|
64
64
|
logger.info(`Sleeping for ${sleepTime}ms until near end of L2 slot before sending L1 fee juice to L2 inbox`);
|
|
65
65
|
await sleep(sleepTime);
|
|
66
66
|
};
|
|
@@ -4,6 +4,7 @@ import type { AztecNode } from '@aztec/aztec.js/node';
|
|
|
4
4
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
5
5
|
import { type DeployL1ContractsArgs, RollupContract, createExtendedL1Client } from '@aztec/ethereum';
|
|
6
6
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
7
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
7
8
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
9
|
import { sleep } from '@aztec/foundation/sleep';
|
|
9
10
|
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
@@ -85,7 +86,7 @@ export class FeesTest {
|
|
|
85
86
|
public getGasBalanceFn!: BalancesFn;
|
|
86
87
|
public getBananaPublicBalanceFn!: BalancesFn;
|
|
87
88
|
public getBananaPrivateBalanceFn!: BalancesFn;
|
|
88
|
-
public getProverFee!: (blockNumber:
|
|
89
|
+
public getProverFee!: (blockNumber: BlockNumber) => Promise<bigint>;
|
|
89
90
|
|
|
90
91
|
public readonly ALICE_INITIAL_BANANAS = BigInt(1e22);
|
|
91
92
|
public readonly SUBSCRIPTION_AMOUNT = BigInt(1e19);
|
|
@@ -136,7 +137,7 @@ export class FeesTest {
|
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
async getBlockRewards() {
|
|
139
|
-
const blockReward = await this.rollupContract.
|
|
140
|
+
const blockReward = await this.rollupContract.getCheckpointReward();
|
|
140
141
|
const rewardConfig = await this.rollupContract.getRewardConfig();
|
|
141
142
|
|
|
142
143
|
const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(
|
|
@@ -197,7 +198,7 @@ export class FeesTest {
|
|
|
197
198
|
this.fpcAdmin = this.aliceAddress;
|
|
198
199
|
|
|
199
200
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
200
|
-
this.feeJuiceContract =
|
|
201
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
|
|
201
202
|
},
|
|
202
203
|
);
|
|
203
204
|
}
|
|
@@ -215,7 +216,7 @@ export class FeesTest {
|
|
|
215
216
|
async (_data, context) => {
|
|
216
217
|
this.context = context;
|
|
217
218
|
|
|
218
|
-
this.feeJuiceContract =
|
|
219
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
|
|
219
220
|
|
|
220
221
|
this.getGasBalanceFn = getBalancesFn(
|
|
221
222
|
'⛽',
|
|
@@ -245,8 +246,8 @@ export class FeesTest {
|
|
|
245
246
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
246
247
|
return { bananaCoinAddress: bananaCoin.address };
|
|
247
248
|
},
|
|
248
|
-
|
|
249
|
-
this.bananaCoin =
|
|
249
|
+
({ bananaCoinAddress }) => {
|
|
250
|
+
this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.wallet);
|
|
250
251
|
const logger = this.logger;
|
|
251
252
|
this.getBananaPublicBalanceFn = getBalancesFn(
|
|
252
253
|
'🍌.public',
|
|
@@ -260,6 +261,7 @@ export class FeesTest {
|
|
|
260
261
|
this.aliceAddress,
|
|
261
262
|
logger,
|
|
262
263
|
);
|
|
264
|
+
return Promise.resolve();
|
|
263
265
|
},
|
|
264
266
|
);
|
|
265
267
|
}
|
|
@@ -287,8 +289,8 @@ export class FeesTest {
|
|
|
287
289
|
rollupAddress: context.deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
288
290
|
};
|
|
289
291
|
},
|
|
290
|
-
|
|
291
|
-
const bananaFPC =
|
|
292
|
+
(data, context) => {
|
|
293
|
+
const bananaFPC = FPCContract.at(data.bananaFPCAddress, this.wallet);
|
|
292
294
|
this.bananaFPC = bananaFPC;
|
|
293
295
|
|
|
294
296
|
this.getCoinbaseBalance = async () => {
|
|
@@ -305,7 +307,7 @@ export class FeesTest {
|
|
|
305
307
|
return await this.rollupContract.getSequencerRewards(this.coinbase);
|
|
306
308
|
};
|
|
307
309
|
|
|
308
|
-
this.getProverFee = async (blockNumber:
|
|
310
|
+
this.getProverFee = async (blockNumber: BlockNumber) => {
|
|
309
311
|
const block = await this.aztecNode.getBlock(blockNumber);
|
|
310
312
|
|
|
311
313
|
// @todo @lherskind As we deal with #13601
|
|
@@ -328,6 +330,7 @@ export class FeesTest {
|
|
|
328
330
|
const mana = block!.header.totalManaUsed.toBigInt();
|
|
329
331
|
return mulDiv(mana * proverCost, price, 10n ** 9n);
|
|
330
332
|
};
|
|
333
|
+
return Promise.resolve();
|
|
331
334
|
},
|
|
332
335
|
);
|
|
333
336
|
}
|
|
@@ -346,8 +349,9 @@ export class FeesTest {
|
|
|
346
349
|
sponsoredFPCAddress: sponsoredFPC.address,
|
|
347
350
|
};
|
|
348
351
|
},
|
|
349
|
-
|
|
350
|
-
this.sponsoredFPC =
|
|
352
|
+
data => {
|
|
353
|
+
this.sponsoredFPC = SponsoredFPCContract.at(data.sponsoredFPCAddress, this.wallet);
|
|
354
|
+
return Promise.resolve();
|
|
351
355
|
},
|
|
352
356
|
);
|
|
353
357
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
2
|
import type { L2Block } from '@aztec/aztec.js/block';
|
|
3
3
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
-
import { BatchedBlob, Blob, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
|
|
4
|
+
import { BatchedBlob, Blob, getEthBlobEvaluationInputs, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
|
|
5
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
6
|
|
|
7
7
|
import { writeFile } from 'fs/promises';
|
|
@@ -41,16 +41,17 @@ export async function writeJson(
|
|
|
41
41
|
messages: {
|
|
42
42
|
l2ToL1Messages: block.body.txEffects.flatMap(txEffect => txEffect.l2ToL1Msgs).map(value => asHex(value)),
|
|
43
43
|
},
|
|
44
|
-
|
|
44
|
+
checkpoint: {
|
|
45
45
|
// The json formatting in forge is a bit brittle, so we convert Fr to a number in the few values below.
|
|
46
46
|
// This should not be a problem for testing as long as the values are not larger than u32.
|
|
47
47
|
archive: asHex(block.archive.root),
|
|
48
48
|
blobCommitments: getPrefixedEthBlobCommitments(blobs),
|
|
49
|
-
batchedBlobInputs:
|
|
50
|
-
|
|
49
|
+
batchedBlobInputs: getEthBlobEvaluationInputs(batchedBlob),
|
|
50
|
+
checkpointNumber: block.number,
|
|
51
51
|
body: `0x${block.body.toBuffer().toString('hex')}`,
|
|
52
52
|
header: {
|
|
53
53
|
lastArchiveRoot: asHex(block.header.lastArchive.root),
|
|
54
|
+
blockHeadersHash: asHex(block.header.blockHeadersHash),
|
|
54
55
|
contentCommitment: {
|
|
55
56
|
blobsHash: asHex(block.header.contentCommitment.blobsHash),
|
|
56
57
|
inHash: asHex(block.header.contentCommitment.inHash),
|
|
@@ -86,9 +86,10 @@ export class NestedContractTest {
|
|
|
86
86
|
.deployed();
|
|
87
87
|
return { parentContractAddress: parentContract.address, childContractAddress: childContract.address };
|
|
88
88
|
},
|
|
89
|
-
|
|
90
|
-
this.parentContract =
|
|
91
|
-
this.childContract =
|
|
89
|
+
({ parentContractAddress, childContractAddress }) => {
|
|
90
|
+
this.parentContract = ParentContract.at(parentContractAddress, this.wallet);
|
|
91
|
+
this.childContract = ChildContract.at(childContractAddress, this.wallet);
|
|
92
|
+
return Promise.resolve();
|
|
92
93
|
},
|
|
93
94
|
);
|
|
94
95
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
3
|
import { RollupContract } from '@aztec/ethereum';
|
|
4
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
4
5
|
|
|
5
6
|
import fs from 'fs';
|
|
6
7
|
import 'jest-extended';
|
|
@@ -150,8 +151,11 @@ export class P2PInactivityTest {
|
|
|
150
151
|
// This prevents race conditions where validators propose blocks before the network is ready
|
|
151
152
|
await this.test.waitForP2PMeshConnectivity(this.nodes, NUM_NODES);
|
|
152
153
|
|
|
153
|
-
this.test.
|
|
154
|
-
|
|
154
|
+
const ethereumSlotDuration = this.test.ctx.aztecNodeConfig.ethereumSlotDuration!;
|
|
155
|
+
this.test.logger.warn(`Advancing to the L1 slot before epoch ${SETUP_EPOCH_DURATION + 1} to start slashing`);
|
|
156
|
+
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(EpochNumber(SETUP_EPOCH_DURATION + 1), {
|
|
157
|
+
offset: -ethereumSlotDuration,
|
|
158
|
+
});
|
|
155
159
|
|
|
156
160
|
return this;
|
|
157
161
|
}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
getL1ContractsConfigEnvVars,
|
|
17
17
|
} from '@aztec/ethereum';
|
|
18
18
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
19
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
19
20
|
import { SecretValue } from '@aztec/foundation/config';
|
|
20
21
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
21
22
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
@@ -292,7 +293,9 @@ export class P2PNetworkTest {
|
|
|
292
293
|
});
|
|
293
294
|
|
|
294
295
|
await cheatCodes.rollup.advanceToEpoch(
|
|
295
|
-
|
|
296
|
+
EpochNumber.fromBigInt(
|
|
297
|
+
BigInt(await cheatCodes.rollup.getEpoch()) + (await rollup.read.getLagInEpochsForValidatorSet()) + 1n,
|
|
298
|
+
),
|
|
296
299
|
);
|
|
297
300
|
|
|
298
301
|
// Send and await a tx to make sure we mine a block for the warp to correctly progress.
|
|
@@ -326,11 +329,12 @@ export class P2PNetworkTest {
|
|
|
326
329
|
.deployed();
|
|
327
330
|
return { contractAddress: spamContract.address };
|
|
328
331
|
},
|
|
329
|
-
|
|
332
|
+
({ contractAddress }) => {
|
|
330
333
|
if (!this.wallet) {
|
|
331
334
|
throw new Error('Call snapshot t.setupAccount before deploying account contract');
|
|
332
335
|
}
|
|
333
|
-
this.spamContract =
|
|
336
|
+
this.spamContract = SpamContract.at(contractAddress, this.wallet);
|
|
337
|
+
return Promise.resolve();
|
|
334
338
|
},
|
|
335
339
|
);
|
|
336
340
|
}
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { Logger } from '@aztec/aztec.js/log';
|
|
|
7
7
|
import { Tx, TxStatus } from '@aztec/aztec.js/tx';
|
|
8
8
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
9
9
|
import type { EmpireSlashingProposerContract, RollupContract, TallySlashingProposerContract } from '@aztec/ethereum';
|
|
10
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
10
11
|
import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
11
12
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
12
13
|
import { pluralize } from '@aztec/foundation/string';
|
|
@@ -80,7 +81,7 @@ export async function prepareTransactions(
|
|
|
80
81
|
salt: Fr.random(),
|
|
81
82
|
});
|
|
82
83
|
await wallet.registerContract(testContractInstance, TestContractArtifact);
|
|
83
|
-
const contract =
|
|
84
|
+
const contract = TestContract.at(testContractInstance.address, wallet);
|
|
84
85
|
|
|
85
86
|
return timesAsync(numTxs, async () => {
|
|
86
87
|
const tx = await proveInteraction(wallet, contract.methods.emit_nullifier(Fr.random()), {
|
|
@@ -213,9 +214,9 @@ export async function awaitCommitteeKicked({
|
|
|
213
214
|
|
|
214
215
|
if (slashingProposer.type === 'empire') {
|
|
215
216
|
// Await for the slash payload to be created if empire (no payload is created on tally until execution time)
|
|
216
|
-
const targetEpoch = (await cheatCodes.getEpoch()) + (await rollup.
|
|
217
|
+
const targetEpoch = BigInt(await cheatCodes.getEpoch()) + (await rollup.getLagInEpochsForValidatorSet()) + 1n;
|
|
217
218
|
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
218
|
-
await cheatCodes.advanceToEpoch(targetEpoch);
|
|
219
|
+
await cheatCodes.advanceToEpoch(EpochNumber.fromBigInt(targetEpoch));
|
|
219
220
|
|
|
220
221
|
const slashPayloadEvents = await retryUntil(
|
|
221
222
|
async () => {
|
|
@@ -239,7 +240,7 @@ export async function awaitCommitteeKicked({
|
|
|
239
240
|
const firstEpochInOffenseRound = offenseEpoch - (offenseEpoch % slashingRoundSizeInEpochs);
|
|
240
241
|
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
|
|
241
242
|
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
242
|
-
await cheatCodes.advanceToEpoch(targetEpoch, { offset: -aztecSlotDuration / 2 });
|
|
243
|
+
await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), { offset: -aztecSlotDuration / 2 });
|
|
243
244
|
}
|
|
244
245
|
|
|
245
246
|
const attestersPre = await rollup.getAttesters();
|
|
@@ -269,7 +270,9 @@ export async function awaitCommitteeKicked({
|
|
|
269
270
|
|
|
270
271
|
logger.info(`Advancing to check current committee`);
|
|
271
272
|
await cheatCodes.debugRollup();
|
|
272
|
-
await cheatCodes.advanceToEpoch(
|
|
273
|
+
await cheatCodes.advanceToEpoch(
|
|
274
|
+
EpochNumber.fromBigInt(BigInt(await cheatCodes.getEpoch()) + (await rollup.getLagInEpochsForValidatorSet()) + 1n),
|
|
275
|
+
);
|
|
273
276
|
await cheatCodes.debugRollup();
|
|
274
277
|
|
|
275
278
|
const committeeNextEpoch = await rollup.getCurrentEpochCommittee();
|