@aztec/end-to-end 0.0.1-fake-c83136db25 → 0.0.1-fake-ceab37513c
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 +2 -3
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +12 -16
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +58 -54
- package/dest/bench/client_flows/data_extractor.js +3 -3
- package/dest/bench/utils.d.ts +11 -2
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +34 -10
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +7 -7
- 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 +42 -42
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +8 -10
- 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 +33 -31
- package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -10
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +18 -9
- package/dest/e2e_epochs/epochs_test.d.ts +1 -3
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +9 -10
- package/dest/e2e_fees/bridging_race.notest.js +9 -12
- package/dest/e2e_fees/fees_test.d.ts +5 -5
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +31 -23
- package/dest/e2e_l1_publisher/write_json.d.ts +1 -3
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +5 -5
- package/dest/e2e_multi_validator/utils.d.ts +1 -1
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -6
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +9 -7
- 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 +2 -5
- package/dest/e2e_p2p/p2p_network.d.ts +2 -14
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +10 -32
- package/dest/e2e_p2p/shared.d.ts +13 -11
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +45 -49
- package/dest/e2e_token_contract/token_contract_test.d.ts +4 -5
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +17 -14
- package/dest/fixtures/e2e_prover_test.d.ts +6 -8
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +50 -40
- package/dest/fixtures/get_acvm_config.d.ts +1 -1
- package/dest/fixtures/get_acvm_config.d.ts.map +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/get_bb_config.js +2 -2
- package/dest/fixtures/setup_l1_contracts.d.ts +1 -1
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_l1_contracts.js +2 -2
- package/dest/fixtures/setup_p2p_test.d.ts +7 -0
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.d.ts +7 -10
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +32 -42
- package/dest/fixtures/token_utils.d.ts +4 -6
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +15 -11
- package/dest/fixtures/utils.d.ts +27 -23
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +100 -75
- package/dest/fixtures/web3signer.d.ts +1 -1
- package/dest/fixtures/web3signer.d.ts.map +1 -1
- package/dest/fixtures/web3signer.js +5 -16
- 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 +10 -16
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +15 -13
- package/dest/shared/gas_portal_test_harness.d.ts +6 -9
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +7 -10
- package/dest/shared/jest_setup.js +1 -1
- package/dest/shared/submit-transactions.d.ts +3 -5
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +7 -8
- package/dest/shared/uniswap_l1_l2.d.ts +6 -9
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +45 -29
- package/dest/simulators/lending_simulator.d.ts +1 -2
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +2 -3
- package/dest/simulators/token_simulator.d.ts +1 -3
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +13 -19
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +84 -107
- package/dest/spartan/utils.d.ts +0 -44
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +20 -212
- package/package.json +36 -37
- package/src/bench/client_flows/benchmark.ts +8 -8
- package/src/bench/client_flows/client_flows_benchmark.ts +82 -62
- package/src/bench/client_flows/data_extractor.ts +4 -4
- package/src/bench/utils.ts +37 -9
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +63 -46
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +47 -33
- package/src/e2e_deploy_contract/deploy_test.ts +35 -17
- package/src/e2e_epochs/epochs_test.ts +14 -12
- package/src/e2e_fees/bridging_race.notest.ts +9 -14
- package/src/e2e_fees/fees_test.ts +38 -26
- package/src/e2e_l1_publisher/write_json.ts +6 -8
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_nested_contract/nested_contract_test.ts +10 -11
- package/src/e2e_p2p/inactivity_slash_test.ts +3 -7
- package/src/e2e_p2p/p2p_network.ts +67 -105
- package/src/e2e_p2p/shared.ts +55 -50
- package/src/e2e_token_contract/token_contract_test.ts +17 -17
- package/src/fixtures/e2e_prover_test.ts +88 -51
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/get_bb_config.ts +2 -3
- package/src/fixtures/setup_l1_contracts.ts +3 -3
- package/src/fixtures/setup_p2p_test.ts +8 -0
- package/src/fixtures/snapshot_manager.ts +59 -59
- package/src/fixtures/token_utils.ts +21 -13
- package/src/fixtures/utils.ts +137 -86
- package/src/fixtures/web3signer.ts +5 -22
- package/src/guides/up_quick_start.sh +10 -2
- package/src/quality_of_service/alert_checker.ts +1 -1
- package/src/shared/cross_chain_test_harness.ts +29 -18
- package/src/shared/gas_portal_test_harness.ts +19 -12
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +8 -12
- package/src/shared/uniswap_l1_l2.ts +67 -61
- package/src/simulators/lending_simulator.ts +2 -3
- package/src/simulators/token_simulator.ts +2 -5
- package/src/spartan/DEVELOP.md +3 -8
- package/src/spartan/setup_test_wallets.ts +125 -132
- package/src/spartan/utils.ts +18 -268
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
|
+
import { createLogger, sleep } from '@aztec/aztec.js';
|
|
3
|
+
import { CheatCodes } from '@aztec/aztec/testing';
|
|
2
4
|
import { RollupContract, createExtendedL1Client } from '@aztec/ethereum';
|
|
3
5
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
4
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
-
import { sleep } from '@aztec/foundation/sleep';
|
|
6
7
|
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
7
8
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
8
9
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
@@ -30,12 +31,15 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
30
31
|
*/ export class FeesTest {
|
|
31
32
|
numberOfAccounts;
|
|
32
33
|
snapshotManager;
|
|
34
|
+
wallets;
|
|
33
35
|
accounts;
|
|
34
36
|
logger;
|
|
37
|
+
pxe;
|
|
35
38
|
aztecNode;
|
|
36
39
|
cheatCodes;
|
|
37
|
-
|
|
40
|
+
aliceWallet;
|
|
38
41
|
aliceAddress;
|
|
42
|
+
bobWallet;
|
|
39
43
|
bobAddress;
|
|
40
44
|
sequencerAddress;
|
|
41
45
|
coinbase;
|
|
@@ -62,6 +66,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
62
66
|
APP_SPONSORED_TX_GAS_LIMIT;
|
|
63
67
|
constructor(testName, numberOfAccounts = 3, setupOptions = {}){
|
|
64
68
|
this.numberOfAccounts = numberOfAccounts;
|
|
69
|
+
this.wallets = [];
|
|
65
70
|
this.accounts = [];
|
|
66
71
|
this.ALICE_INITIAL_BANANAS = BigInt(1e22);
|
|
67
72
|
this.SUBSCRIPTION_AMOUNT = BigInt(1e19);
|
|
@@ -121,7 +126,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
121
126
|
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
122
127
|
from: this.aliceAddress
|
|
123
128
|
});
|
|
124
|
-
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount);
|
|
129
|
+
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, this.aliceWallet, address, amount);
|
|
125
130
|
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
126
131
|
from: this.aliceAddress
|
|
127
132
|
});
|
|
@@ -134,42 +139,45 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
134
139
|
await this.applyDeployBananaTokenSnapshot();
|
|
135
140
|
}
|
|
136
141
|
async applyInitialAccountsSnapshot() {
|
|
137
|
-
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, {
|
|
138
|
-
this.
|
|
142
|
+
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { pxe, aztecNode, aztecNodeConfig })=>{
|
|
143
|
+
this.pxe = pxe;
|
|
139
144
|
this.aztecNode = aztecNode;
|
|
140
145
|
this.gasSettings = GasSettings.default({
|
|
141
146
|
maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2)
|
|
142
147
|
});
|
|
143
|
-
this.cheatCodes =
|
|
144
|
-
this.
|
|
145
|
-
this.
|
|
146
|
-
|
|
148
|
+
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
149
|
+
this.wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
|
|
150
|
+
this.wallets.forEach((w, i)=>this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
|
|
151
|
+
this.accounts = this.wallets.map((w)=>w.getAddress());
|
|
152
|
+
[this.aliceWallet, this.bobWallet] = this.wallets.slice(0, 2);
|
|
153
|
+
[this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts;
|
|
147
154
|
// We set Alice as the FPC admin to avoid the need for deployment of another account.
|
|
148
155
|
this.fpcAdmin = this.aliceAddress;
|
|
149
156
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
150
|
-
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.
|
|
157
|
+
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.aliceWallet);
|
|
151
158
|
});
|
|
152
159
|
}
|
|
153
160
|
async applyPublicDeployAccountsSnapshot() {
|
|
154
|
-
await this.snapshotManager.snapshot('public_deploy_accounts', ()=>ensureAccountContractsPublished(this.
|
|
161
|
+
await this.snapshotManager.snapshot('public_deploy_accounts', ()=>ensureAccountContractsPublished(this.aliceWallet, this.wallets));
|
|
155
162
|
}
|
|
156
163
|
async applySetupFeeJuiceSnapshot() {
|
|
157
164
|
await this.snapshotManager.snapshot('setup_fee_juice', async ()=>{}, async (_data, context)=>{
|
|
158
165
|
this.context = context;
|
|
159
|
-
this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.
|
|
166
|
+
this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.aliceWallet);
|
|
160
167
|
this.getGasBalanceFn = getBalancesFn('⛽', this.feeJuiceContract.methods.balance_of_public, this.aliceAddress, this.logger);
|
|
161
168
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
162
169
|
aztecNode: context.aztecNode,
|
|
163
170
|
aztecNodeAdmin: context.aztecNode,
|
|
171
|
+
pxeService: context.pxe,
|
|
164
172
|
l1Client: context.deployL1ContractsValues.l1Client,
|
|
165
|
-
wallet: this.
|
|
173
|
+
wallet: this.aliceWallet,
|
|
166
174
|
logger: this.logger
|
|
167
175
|
});
|
|
168
176
|
});
|
|
169
177
|
}
|
|
170
178
|
async applyDeployBananaTokenSnapshot() {
|
|
171
179
|
await this.snapshotManager.snapshot('deploy_banana_token', async ()=>{
|
|
172
|
-
const bananaCoin = await BananaCoin.deploy(this.
|
|
180
|
+
const bananaCoin = await BananaCoin.deploy(this.aliceWallet, this.aliceAddress, 'BC', 'BC', 18n).send({
|
|
173
181
|
from: this.aliceAddress
|
|
174
182
|
}).deployed();
|
|
175
183
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
@@ -177,7 +185,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
177
185
|
bananaCoinAddress: bananaCoin.address
|
|
178
186
|
};
|
|
179
187
|
}, async ({ bananaCoinAddress })=>{
|
|
180
|
-
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.
|
|
188
|
+
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.aliceWallet);
|
|
181
189
|
const logger = this.logger;
|
|
182
190
|
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, this.aliceAddress, logger);
|
|
183
191
|
this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, this.aliceAddress, logger);
|
|
@@ -186,9 +194,9 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
186
194
|
async applyFPCSetupSnapshot() {
|
|
187
195
|
await this.snapshotManager.snapshot('fpc_setup', async (context)=>{
|
|
188
196
|
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
189
|
-
expect((await context.
|
|
197
|
+
expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
190
198
|
const bananaCoin = this.bananaCoin;
|
|
191
|
-
const bananaFPC = await FPCContract.deploy(this.
|
|
199
|
+
const bananaFPC = await FPCContract.deploy(this.aliceWallet, bananaCoin.address, this.fpcAdmin).send({
|
|
192
200
|
from: this.aliceAddress
|
|
193
201
|
}).deployed();
|
|
194
202
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
@@ -200,7 +208,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
200
208
|
rollupAddress: context.deployL1ContractsValues.l1ContractAddresses.rollupAddress
|
|
201
209
|
};
|
|
202
210
|
}, async (data, context)=>{
|
|
203
|
-
const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.
|
|
211
|
+
const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.aliceWallet);
|
|
204
212
|
this.bananaFPC = bananaFPC;
|
|
205
213
|
this.getCoinbaseBalance = async ()=>{
|
|
206
214
|
const l1Client = createExtendedL1Client(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
@@ -217,7 +225,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
217
225
|
return await this.rollupContract.getSequencerRewards(this.coinbase);
|
|
218
226
|
};
|
|
219
227
|
this.getProverFee = async (blockNumber)=>{
|
|
220
|
-
const block = await this.
|
|
228
|
+
const block = await this.pxe.getBlock(blockNumber);
|
|
221
229
|
// @todo @lherskind As we deal with #13601
|
|
222
230
|
// Right now the value is from `FeeLib.sol`
|
|
223
231
|
const L1_GAS_PER_EPOCH_VERIFIED = 1000000n;
|
|
@@ -234,14 +242,14 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
234
242
|
async applySponsoredFPCSetupSnapshot() {
|
|
235
243
|
await this.snapshotManager.snapshot('sponsored_fpc_setup', async (context)=>{
|
|
236
244
|
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
237
|
-
expect((await context.
|
|
238
|
-
const sponsoredFPC = await setupSponsoredFPC(
|
|
245
|
+
expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
246
|
+
const sponsoredFPC = await setupSponsoredFPC(context.pxe);
|
|
239
247
|
this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
|
|
240
248
|
return {
|
|
241
249
|
sponsoredFPCAddress: sponsoredFPC.address
|
|
242
250
|
};
|
|
243
251
|
}, async (data)=>{
|
|
244
|
-
this.sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.
|
|
252
|
+
this.sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.aliceWallet);
|
|
245
253
|
});
|
|
246
254
|
}
|
|
247
255
|
async applyFundAliceWithBananas() {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js
|
|
2
|
-
import type { L2Block } from '@aztec/aztec.js/block';
|
|
3
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
1
|
+
import { AztecAddress, Fr, type L2Block } from '@aztec/aztec.js';
|
|
4
2
|
import { BatchedBlob, Blob } from '@aztec/blob-lib';
|
|
5
3
|
/**
|
|
6
4
|
* 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,
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Blob } 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(
|
|
19
|
+
l1ToL2Content: l1ToL2Content.map(asHex),
|
|
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(
|
|
24
|
+
l2ToL1Messages: block.body.txEffects.flatMap((txEffect)=>txEffect.l2ToL1Msgs).map(asHex)
|
|
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: getPrefixedEthBlobCommitments(blobs),
|
|
30
|
+
blobCommitments: Blob.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.
|
|
51
|
+
headerHash: asHex(block.header.toPropose().hash()),
|
|
52
52
|
numTxs: block.body.txEffects.length
|
|
53
53
|
}
|
|
54
54
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js';
|
|
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,EAAE,YAAY,EAAE,MAAM,
|
|
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,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,sGA0EpG;AAGD,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,iBAmB3B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,aAAa,EAC3B,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,iBAmB3B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,UAAU,EAC5B,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,UAAU,EACpB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,YAAY,iBAiB3B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,UAAU,EAC7B,iBAAiB,EAAE,UAAU,EAC7B,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,MAAM,EAChB,aAAa,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"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js
|
|
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';
|
|
1
|
+
import { type AccountWallet, AztecAddress, type Logger, type PXE } from '@aztec/aztec.js';
|
|
5
2
|
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
6
3
|
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
7
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
@@ -9,9 +6,9 @@ export declare class NestedContractTest {
|
|
|
9
6
|
private numberOfAccounts;
|
|
10
7
|
private snapshotManager;
|
|
11
8
|
logger: Logger;
|
|
12
|
-
wallet:
|
|
9
|
+
wallet: AccountWallet;
|
|
13
10
|
defaultAccountAddress: AztecAddress;
|
|
14
|
-
|
|
11
|
+
pxe: PXE;
|
|
15
12
|
parentContract: ParentContract;
|
|
16
13
|
childContract: ChildContract;
|
|
17
14
|
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":"
|
|
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;IAId,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,oBAAoB;CAkB3B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
|
+
import { createLogger } from '@aztec/aztec.js';
|
|
2
3
|
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
3
4
|
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
4
5
|
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
@@ -9,7 +10,7 @@ export class NestedContractTest {
|
|
|
9
10
|
logger;
|
|
10
11
|
wallet;
|
|
11
12
|
defaultAccountAddress;
|
|
12
|
-
|
|
13
|
+
pxe;
|
|
13
14
|
parentContract;
|
|
14
15
|
childContract;
|
|
15
16
|
constructor(testName, numberOfAccounts = 1){
|
|
@@ -23,11 +24,12 @@ export class NestedContractTest {
|
|
|
23
24
|
* 1. Add 3 accounts.
|
|
24
25
|
* 2. Publicly deploy accounts
|
|
25
26
|
*/ async applyBaseSnapshots() {
|
|
26
|
-
await this.snapshotManager.snapshot('accounts', deployAccounts(this.numberOfAccounts, this.logger), ({ deployedAccounts }, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
|
|
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;
|
|
31
33
|
});
|
|
32
34
|
await this.snapshotManager.snapshot('public_deploy', async ()=>{}, async ()=>{
|
|
33
35
|
this.logger.verbose(`Public deploy accounts...`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
-
import { EthAddress } from '@aztec/aztec.js
|
|
2
|
+
import { EthAddress } from '@aztec/aztec.js';
|
|
3
3
|
import { RollupContract } from '@aztec/ethereum';
|
|
4
4
|
import 'jest-extended';
|
|
5
5
|
import { P2PNetworkTest } from './p2p_network.js';
|
|
@@ -25,7 +25,7 @@ export declare class P2PInactivityTest {
|
|
|
25
25
|
setup(): Promise<this>;
|
|
26
26
|
teardown(): Promise<void>;
|
|
27
27
|
get ctx(): import("../fixtures/snapshot_manager.js").SubsystemsContext;
|
|
28
|
-
get logger(): import("@aztec/
|
|
28
|
+
get logger(): import("@aztec/aztec.js").Logger;
|
|
29
29
|
get slashingAmount(): bigint;
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=inactivity_slash_test.d.ts.map
|
|
@@ -1 +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,
|
|
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,iBAAiB,CAAC;AAC7C,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;IAwEL,QAAQ;IAQrB,IAAW,GAAG,gEAEb;IAED,IAAW,MAAM,qCAEhB;IAED,IAAW,cAAc,WAExB;CACF"}
|
|
@@ -11,8 +11,8 @@ const SLASHING_QUORUM = 3;
|
|
|
11
11
|
const EPOCH_DURATION = 2;
|
|
12
12
|
const SLASHING_ROUND_SIZE_IN_EPOCHS = 2;
|
|
13
13
|
const BOOT_NODE_UDP_PORT = 4500;
|
|
14
|
-
const ETHEREUM_SLOT_DURATION =
|
|
15
|
-
const AZTEC_SLOT_DURATION =
|
|
14
|
+
const ETHEREUM_SLOT_DURATION = 4;
|
|
15
|
+
const AZTEC_SLOT_DURATION = 8;
|
|
16
16
|
const SLASHING_UNIT = BigInt(1e18);
|
|
17
17
|
const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
|
|
18
18
|
// How many epochs it may take to set everything up, so we dont slash during this period
|
|
@@ -105,9 +105,6 @@ export class P2PInactivityTest {
|
|
|
105
105
|
validators: this.test.validators,
|
|
106
106
|
offlineValidators: this.offlineValidators
|
|
107
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
108
|
this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION + 1} to start slashing`);
|
|
112
109
|
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(SETUP_EPOCH_DURATION + 1);
|
|
113
110
|
return this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { AztecAddress } from '@aztec/aztec.js
|
|
3
|
+
import { type AccountWalletWithSecretKey, AztecAddress } from '@aztec/aztec.js';
|
|
4
4
|
import { type EmpireSlashingProposerContract, type Operator, RollupContract, type TallySlashingProposerContract, type ViemClient } from '@aztec/ethereum';
|
|
5
5
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
6
6
|
import { type Logger } from '@aztec/foundation/log';
|
|
@@ -9,7 +9,6 @@ import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
|
9
9
|
import type { BootstrapNode } from '@aztec/p2p/bootstrap';
|
|
10
10
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
11
11
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
12
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
13
12
|
import { type GetContractReturnType } from 'viem';
|
|
14
13
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
15
14
|
import { type SetupOptions } from '../fixtures/utils.js';
|
|
@@ -55,7 +54,7 @@ export declare class P2PNetworkTest {
|
|
|
55
54
|
validators: Operator[];
|
|
56
55
|
deployedAccounts: InitialAccountData[];
|
|
57
56
|
prefilledPublicData: PublicDataTreeLeaf[];
|
|
58
|
-
wallet?:
|
|
57
|
+
wallet?: AccountWalletWithSecretKey;
|
|
59
58
|
defaultAccountAddress?: AztecAddress;
|
|
60
59
|
spamContract?: SpamContract;
|
|
61
60
|
bootstrapNode?: BootstrapNode;
|
|
@@ -86,17 +85,6 @@ export declare class P2PNetworkTest {
|
|
|
86
85
|
private _sendDummyTx;
|
|
87
86
|
setup(): Promise<void>;
|
|
88
87
|
stopNodes(nodes: AztecNodeService[]): Promise<void>;
|
|
89
|
-
/**
|
|
90
|
-
* Wait for P2P mesh to be fully formed across all nodes.
|
|
91
|
-
* This ensures that all nodes are connected to each other before proceeding,
|
|
92
|
-
* preventing race conditions where validators propose blocks before the network is ready.
|
|
93
|
-
*
|
|
94
|
-
* @param nodes - Array of nodes to check for P2P connectivity
|
|
95
|
-
* @param expectedNodeCount - Expected number of nodes in the network (defaults to nodes.length)
|
|
96
|
-
* @param timeoutSeconds - Maximum time to wait for connections (default: 30 seconds)
|
|
97
|
-
* @param checkIntervalSeconds - How often to check connectivity (default: 0.1 seconds)
|
|
98
|
-
*/
|
|
99
|
-
waitForP2PMeshConnectivity(nodes: AztecNodeService[], expectedNodeCount?: number, timeoutSeconds?: number, checkIntervalSeconds?: number): Promise<void>;
|
|
100
88
|
teardown(): Promise<void>;
|
|
101
89
|
getContracts(): Promise<{
|
|
102
90
|
rollup: RollupContract;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAmB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,KAAK,0BAA0B,EAAE,YAAY,EAAkB,MAAM,iBAAiB,CAAC;AAChG,OAAO,EACL,KAAK,8BA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,CAAC;QAC5B,MAAM,EAAE,cAAc,CAAC;QACvB,eAAe,EAAE,qBAAqB,CAAC,OAAO,UAAU,EAAE,UAAU,CAAC,CAAC;QACtE,gBAAgB,EAAE,8BAA8B,GAAG,6BAA6B,GAAG,SAAS,CAAC;QAC7F,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC;CA0BH"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Fr } from '@aztec/aztec.js
|
|
1
|
+
import { getSchnorrWalletWithSecretKey } from '@aztec/accounts/schnorr';
|
|
2
|
+
import { EthAddress, Fr } from '@aztec/aztec.js';
|
|
3
3
|
import { GSEContract, MultiAdderArtifact, RollupContract, createL1TxUtilsFromViemWallet, deployL1Contract, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
4
4
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
5
5
|
import { SecretValue } from '@aztec/foundation/config';
|
|
6
6
|
import { createLogger } from '@aztec/foundation/log';
|
|
7
|
-
import { retryUntil } from '@aztec/foundation/retry';
|
|
8
7
|
import { RollupAbi, SlasherAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
9
8
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
10
9
|
import { createBootstrapNodeFromPrivateKey, getBootstrapNodeEnr } from '@aztec/p2p/test-helpers';
|
|
@@ -142,7 +141,7 @@ export class P2PNetworkTest {
|
|
|
142
141
|
}
|
|
143
142
|
async applyBaseSnapshots() {
|
|
144
143
|
await this.addBootstrapNode();
|
|
145
|
-
await this.snapshotManager.snapshot('add-validators', async ({ deployL1ContractsValues, cheatCodes })=>{
|
|
144
|
+
await this.snapshotManager.snapshot('add-validators', async ({ deployL1ContractsValues, dateProvider, cheatCodes })=>{
|
|
146
145
|
const rollup = getContract({
|
|
147
146
|
address: deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(),
|
|
148
147
|
abi: RollupAbi,
|
|
@@ -193,17 +192,19 @@ export class P2PNetworkTest {
|
|
|
193
192
|
validatorTuples
|
|
194
193
|
])
|
|
195
194
|
});
|
|
196
|
-
await cheatCodes.rollup.advanceToEpoch(await cheatCodes.rollup.getEpoch() + await rollup.read.getLagInEpochs() + 1n
|
|
195
|
+
await cheatCodes.rollup.advanceToEpoch(await cheatCodes.rollup.getEpoch() + await rollup.read.getLagInEpochs() + 1n, {
|
|
196
|
+
updateDateProvider: dateProvider
|
|
197
|
+
});
|
|
197
198
|
// Send and await a tx to make sure we mine a block for the warp to correctly progress.
|
|
198
199
|
await this._sendDummyTx(deployL1ContractsValues.l1Client);
|
|
199
200
|
});
|
|
200
201
|
}
|
|
201
202
|
async setupAccount() {
|
|
202
|
-
await this.snapshotManager.snapshot('setup-account', deployAccounts(1, this.logger), ({ deployedAccounts }, {
|
|
203
|
+
await this.snapshotManager.snapshot('setup-account', deployAccounts(1, this.logger, false), async ({ deployedAccounts }, { pxe })=>{
|
|
203
204
|
this.deployedAccounts = deployedAccounts;
|
|
204
|
-
[
|
|
205
|
-
this.wallet =
|
|
206
|
-
|
|
205
|
+
const [account] = deployedAccounts;
|
|
206
|
+
this.wallet = await getSchnorrWalletWithSecretKey(pxe, account.secret, account.signingKey, account.salt);
|
|
207
|
+
this.defaultAccountAddress = this.wallet.getAddress();
|
|
207
208
|
});
|
|
208
209
|
}
|
|
209
210
|
async deploySpamContract() {
|
|
@@ -267,29 +268,6 @@ export class P2PNetworkTest {
|
|
|
267
268
|
await Promise.all(nodes.map((node)=>node.stop()));
|
|
268
269
|
this.logger.info('Nodes stopped');
|
|
269
270
|
}
|
|
270
|
-
/**
|
|
271
|
-
* Wait for P2P mesh to be fully formed across all nodes.
|
|
272
|
-
* This ensures that all nodes are connected to each other before proceeding,
|
|
273
|
-
* preventing race conditions where validators propose blocks before the network is ready.
|
|
274
|
-
*
|
|
275
|
-
* @param nodes - Array of nodes to check for P2P connectivity
|
|
276
|
-
* @param expectedNodeCount - Expected number of nodes in the network (defaults to nodes.length)
|
|
277
|
-
* @param timeoutSeconds - Maximum time to wait for connections (default: 30 seconds)
|
|
278
|
-
* @param checkIntervalSeconds - How often to check connectivity (default: 0.1 seconds)
|
|
279
|
-
*/ async waitForP2PMeshConnectivity(nodes, expectedNodeCount, timeoutSeconds = 30, checkIntervalSeconds = 0.1) {
|
|
280
|
-
const nodeCount = expectedNodeCount ?? nodes.length;
|
|
281
|
-
const minPeerCount = nodeCount - 1;
|
|
282
|
-
this.logger.warn(`Waiting for all ${nodeCount} nodes to connect to P2P mesh (at least ${minPeerCount} peers each)...`);
|
|
283
|
-
await Promise.all(nodes.map(async (node, index)=>{
|
|
284
|
-
const p2p = node.getP2P();
|
|
285
|
-
await retryUntil(async ()=>{
|
|
286
|
-
const peers = await p2p.getPeers();
|
|
287
|
-
// Each node should be connected to at least N-1 other nodes
|
|
288
|
-
return peers.length >= minPeerCount ? true : undefined;
|
|
289
|
-
}, `Node ${index} to connect to at least ${minPeerCount} peers`, timeoutSeconds, checkIntervalSeconds);
|
|
290
|
-
}));
|
|
291
|
-
this.logger.warn('All nodes connected to P2P mesh');
|
|
292
|
-
}
|
|
293
271
|
async teardown() {
|
|
294
272
|
await this.monitor.stop();
|
|
295
273
|
await tryStop(this.bootstrapNode, this.logger);
|
package/dest/e2e_p2p/shared.d.ts
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { AztecAddress } from '@aztec/aztec.js
|
|
4
|
-
import { type SentTx } from '@aztec/aztec.js/contracts';
|
|
5
|
-
import type { Logger } from '@aztec/aztec.js/log';
|
|
6
|
-
import { Tx } from '@aztec/aztec.js/tx';
|
|
3
|
+
import { AztecAddress, type Logger, ProvenTx, type SentTx } from '@aztec/aztec.js';
|
|
7
4
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
8
5
|
import type { EmpireSlashingProposerContract, RollupContract, TallySlashingProposerContract } from '@aztec/ethereum';
|
|
6
|
+
import type { TestDateProvider } from '@aztec/foundation/timer';
|
|
9
7
|
import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
8
|
+
import { PXEService } from '@aztec/pxe/server';
|
|
10
9
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
11
10
|
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
11
|
+
import type { NodeContext } from '../fixtures/setup_p2p_test.js';
|
|
12
12
|
export declare const submitComplexTxsTo: (logger: Logger, from: AztecAddress, spamContract: SpamContract, numTxs: number, opts?: {
|
|
13
13
|
callPublic?: boolean;
|
|
14
14
|
}) => Promise<SentTx[]>;
|
|
15
|
-
export declare const
|
|
16
|
-
export declare function
|
|
15
|
+
export declare const createPXEServiceAndSubmitTransactions: (logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData) => Promise<NodeContext>;
|
|
16
|
+
export declare function createPXEServiceAndPrepareTransactions(logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData): Promise<{
|
|
17
|
+
pxeService: PXEService;
|
|
18
|
+
txs: ProvenTx[];
|
|
19
|
+
node: AztecNodeService;
|
|
20
|
+
}>;
|
|
17
21
|
export declare function awaitProposalExecution(slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract, timeoutSeconds: number, logger: Logger): Promise<bigint>;
|
|
18
22
|
export declare function awaitCommitteeExists({ rollup, logger, }: {
|
|
19
23
|
rollup: RollupContract;
|
|
20
24
|
logger: Logger;
|
|
21
25
|
}): Promise<readonly `0x${string}`[]>;
|
|
22
|
-
export declare function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSize, epochDuration, waitUntilOffenseCount,
|
|
26
|
+
export declare function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSize, epochDuration, waitUntilOffenseCount, }: {
|
|
23
27
|
nodeAdmin: AztecNodeAdmin;
|
|
24
28
|
logger: Logger;
|
|
25
29
|
slashingRoundSize: number;
|
|
26
30
|
epochDuration: number;
|
|
27
31
|
waitUntilOffenseCount?: number;
|
|
28
|
-
timeoutSeconds?: number;
|
|
29
32
|
}): Promise<import("@aztec/slasher").Offense[]>;
|
|
30
33
|
/**
|
|
31
34
|
* Await the committee to be slashed out of the validator set.
|
|
32
35
|
* Currently assumes that the committee is the same size as the validator set.
|
|
33
36
|
*/
|
|
34
|
-
export declare function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration,
|
|
37
|
+
export declare function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger, dateProvider, }: {
|
|
35
38
|
rollup: RollupContract;
|
|
36
39
|
cheatCodes: RollupCheatCodes;
|
|
37
40
|
committee: readonly `0x${string}`[];
|
|
@@ -39,8 +42,7 @@ export declare function awaitCommitteeKicked({ rollup, cheatCodes, committee, sl
|
|
|
39
42
|
slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
|
|
40
43
|
slashingRoundSize: number;
|
|
41
44
|
aztecSlotDuration: number;
|
|
42
|
-
|
|
45
|
+
dateProvider: TestDateProvider;
|
|
43
46
|
logger: Logger;
|
|
44
|
-
offenseEpoch: number;
|
|
45
47
|
}): Promise<void>;
|
|
46
48
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,YAAY,EAEZ,KAAK,MAAM,EACX,QAAQ,EACR,KAAK,MAAM,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