@aztec/end-to-end 0.0.1-commit.9b94fc1 → 0.0.1-commit.c7c42ec
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/client_flows_benchmark.d.ts +3 -3
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +5 -3
- package/dest/bench/utils.d.ts +2 -2
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +10 -6
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +5 -4
- 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 +2 -1
- package/dest/e2e_epochs/epochs_test.d.ts +11 -9
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +13 -11
- package/dest/e2e_fees/bridging_race.notest.js +1 -1
- package/dest/e2e_fees/fees_test.d.ts +8 -4
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +4 -1
- package/dest/e2e_multi_validator/utils.js +1 -1
- 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 +3 -6
- package/dest/e2e_p2p/p2p_network.d.ts +7 -6
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +10 -8
- package/dest/e2e_p2p/shared.d.ts +2 -2
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts +3 -5
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +6 -9
- package/dest/fixtures/fixtures.d.ts +2 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +2 -3
- package/dest/fixtures/get_acvm_config.js +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +2 -2
- package/dest/fixtures/setup_p2p_test.js +3 -3
- package/dest/fixtures/snapshot_manager.d.ts +6 -8
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +34 -46
- package/dest/fixtures/utils.d.ts +20 -463
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +50 -78
- package/dest/fixtures/web3signer.js +1 -1
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/shared/cross_chain_test_harness.d.ts +5 -3
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +1 -1
- package/dest/shared/gas_portal_test_harness.d.ts +2 -2
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +4 -3
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +4 -2
- package/dest/simulators/lending_simulator.d.ts +2 -2
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +2 -1
- package/dest/spartan/tx_metrics.d.ts +39 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +95 -0
- package/dest/spartan/utils.d.ts +45 -10
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +203 -60
- package/package.json +40 -40
- package/src/bench/client_flows/client_flows_benchmark.ts +7 -4
- package/src/bench/utils.ts +11 -7
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +13 -9
- package/src/e2e_epochs/epochs_test.ts +33 -20
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +10 -4
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_p2p/inactivity_slash_test.ts +4 -7
- package/src/e2e_p2p/p2p_network.ts +9 -16
- package/src/e2e_p2p/shared.ts +5 -1
- package/src/fixtures/e2e_prover_test.ts +8 -10
- package/src/fixtures/fixtures.ts +2 -5
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/fixtures/snapshot_manager.ts +51 -65
- package/src/fixtures/utils.ts +79 -138
- package/src/fixtures/web3signer.ts +1 -1
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/shared/cross_chain_test_harness.ts +5 -2
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/uniswap_l1_l2.ts +8 -10
- package/src/simulators/lending_simulator.ts +2 -2
- package/src/spartan/DEVELOP.md +7 -0
- package/src/spartan/setup_test_wallets.ts +2 -1
- package/src/spartan/tx_metrics.ts +130 -0
- package/src/spartan/utils.ts +267 -51
- package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
- package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
- package/dest/fixtures/setup_l1_contracts.js +0 -17
- package/src/fixtures/setup_l1_contracts.ts +0 -26
|
@@ -6,12 +6,14 @@ import type { Logger } from '@aztec/aztec.js/log';
|
|
|
6
6
|
import { MerkleTreeId } from '@aztec/aztec.js/trees';
|
|
7
7
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
8
8
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
9
|
-
import {
|
|
9
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
10
|
+
import { DefaultL1ContractsConfig } from '@aztec/ethereum/config';
|
|
10
11
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
11
12
|
import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
12
|
-
import {
|
|
13
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
14
|
+
import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
13
15
|
import { SecretValue } from '@aztec/foundation/config';
|
|
14
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
16
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
15
17
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
16
18
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
17
19
|
import { sleep } from '@aztec/foundation/sleep';
|
|
@@ -26,7 +28,7 @@ import {
|
|
|
26
28
|
SequencerState,
|
|
27
29
|
} from '@aztec/sequencer-client';
|
|
28
30
|
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
29
|
-
import {
|
|
31
|
+
import { type BlockParameter, EthAddress } from '@aztec/stdlib/block';
|
|
30
32
|
import { type L1RollupConstants, getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
31
33
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
32
34
|
|
|
@@ -95,12 +97,24 @@ export class EpochsTestContext {
|
|
|
95
97
|
const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
|
|
96
98
|
const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
|
|
97
99
|
const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
|
|
98
|
-
|
|
100
|
+
const l1PublishingTime = opts.l1PublishingTime ?? 1;
|
|
101
|
+
return {
|
|
102
|
+
l1PublishingTime,
|
|
103
|
+
ethereumSlotDuration,
|
|
104
|
+
aztecSlotDuration,
|
|
105
|
+
aztecEpochDuration,
|
|
106
|
+
aztecProofSubmissionEpochs,
|
|
107
|
+
};
|
|
99
108
|
}
|
|
100
109
|
|
|
101
110
|
public async setup(opts: EpochsTestOpts = {}) {
|
|
102
|
-
const {
|
|
103
|
-
|
|
111
|
+
const {
|
|
112
|
+
ethereumSlotDuration,
|
|
113
|
+
aztecSlotDuration,
|
|
114
|
+
aztecEpochDuration,
|
|
115
|
+
aztecProofSubmissionEpochs,
|
|
116
|
+
l1PublishingTime,
|
|
117
|
+
} = EpochsTestContext.getSlotDurations(opts);
|
|
104
118
|
|
|
105
119
|
this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
|
|
106
120
|
this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
|
|
@@ -112,8 +126,6 @@ export class EpochsTestContext {
|
|
|
112
126
|
checkIntervalMs: 50,
|
|
113
127
|
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
114
128
|
worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
|
|
115
|
-
skipProtocolContracts: true,
|
|
116
|
-
salt: 1,
|
|
117
129
|
aztecEpochDuration,
|
|
118
130
|
aztecSlotDuration,
|
|
119
131
|
ethereumSlotDuration,
|
|
@@ -130,6 +142,7 @@ export class EpochsTestContext {
|
|
|
130
142
|
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
131
143
|
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
132
144
|
slasherFlavor: 'none',
|
|
145
|
+
l1PublishingTime,
|
|
133
146
|
...opts,
|
|
134
147
|
});
|
|
135
148
|
|
|
@@ -291,21 +304,21 @@ export class EpochsTestContext {
|
|
|
291
304
|
return start;
|
|
292
305
|
}
|
|
293
306
|
|
|
294
|
-
/** Waits until the given
|
|
295
|
-
public async
|
|
307
|
+
/** Waits until the given checkpoint number is mined. */
|
|
308
|
+
public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout = 120) {
|
|
296
309
|
await retryUntil(
|
|
297
310
|
() => Promise.resolve(target <= this.monitor.checkpointNumber),
|
|
298
|
-
`Wait until
|
|
311
|
+
`Wait until checkpoint ${target}`,
|
|
299
312
|
timeout,
|
|
300
313
|
0.1,
|
|
301
314
|
);
|
|
302
315
|
}
|
|
303
316
|
|
|
304
|
-
/** Waits until the given
|
|
305
|
-
public async
|
|
317
|
+
/** Waits until the given checkpoint number is marked as proven. */
|
|
318
|
+
public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout = 120) {
|
|
306
319
|
await retryUntil(
|
|
307
|
-
() => Promise.resolve(
|
|
308
|
-
`Wait proven
|
|
320
|
+
() => Promise.resolve(target <= this.monitor.provenCheckpointNumber),
|
|
321
|
+
`Wait proven checkpoint ${target}`,
|
|
309
322
|
timeout,
|
|
310
323
|
0.1,
|
|
311
324
|
);
|
|
@@ -324,7 +337,7 @@ export class EpochsTestContext {
|
|
|
324
337
|
}
|
|
325
338
|
|
|
326
339
|
/** Waits for the aztec node to sync to the target block number. */
|
|
327
|
-
public async waitForNodeToSync(blockNumber:
|
|
340
|
+
public async waitForNodeToSync(blockNumber: BlockNumber, type: 'proven' | 'finalized' | 'historic') {
|
|
328
341
|
const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
|
|
329
342
|
let synched = false;
|
|
330
343
|
while (!synched) {
|
|
@@ -373,7 +386,7 @@ export class EpochsTestContext {
|
|
|
373
386
|
}
|
|
374
387
|
|
|
375
388
|
/** Verifies whether the given block number is found on the aztec node. */
|
|
376
|
-
public async verifyHistoricBlock(blockNumber:
|
|
389
|
+
public async verifyHistoricBlock(blockNumber: BlockParameter, expectedSuccess: boolean) {
|
|
377
390
|
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
378
391
|
// at a particular block, so we know whether that historic block is available or has been
|
|
379
392
|
// pruned. Note that `getBlock` would not work here, since it only hits the archiver.
|
|
@@ -391,11 +404,11 @@ export class EpochsTestContext {
|
|
|
391
404
|
const stateChanges: TrackedSequencerEvent[] = [];
|
|
392
405
|
const failEvents: TrackedSequencerEvent[] = [];
|
|
393
406
|
|
|
394
|
-
// Note we do not include the 'tx-count-check-failed' event here, since it is fine if we dont build
|
|
407
|
+
// Note we do not include the 'block-tx-count-check-failed' event here, since it is fine if we dont build
|
|
395
408
|
// due to lack of txs available.
|
|
396
409
|
const failEventsKeys: (keyof SequencerEvents)[] = [
|
|
397
410
|
'block-build-failed',
|
|
398
|
-
'
|
|
411
|
+
'checkpoint-publish-failed',
|
|
399
412
|
'proposer-rollup-check-failed',
|
|
400
413
|
];
|
|
401
414
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
3
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
4
|
-
import { Fq } from '@aztec/foundation/
|
|
4
|
+
import { Fq } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { sleep } from '@aztec/foundation/sleep';
|
|
6
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
7
|
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
@@ -2,8 +2,11 @@ import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
|
2
2
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
3
3
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
4
4
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
5
|
-
import {
|
|
5
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
6
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
7
|
+
import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
6
8
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
9
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
7
10
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
11
|
import { sleep } from '@aztec/foundation/sleep';
|
|
9
12
|
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
@@ -16,6 +19,7 @@ import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
|
|
|
16
19
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
17
20
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
18
21
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
22
|
+
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
19
23
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
20
24
|
|
|
21
25
|
import { getContract } from 'viem';
|
|
@@ -55,6 +59,7 @@ export class FeesTest {
|
|
|
55
59
|
|
|
56
60
|
public logger: Logger;
|
|
57
61
|
public aztecNode!: AztecNode;
|
|
62
|
+
public aztecNodeAdmin!: AztecNodeAdmin;
|
|
58
63
|
public cheatCodes!: CheatCodes;
|
|
59
64
|
|
|
60
65
|
public wallet!: TestWallet;
|
|
@@ -85,7 +90,7 @@ export class FeesTest {
|
|
|
85
90
|
public getGasBalanceFn!: BalancesFn;
|
|
86
91
|
public getBananaPublicBalanceFn!: BalancesFn;
|
|
87
92
|
public getBananaPrivateBalanceFn!: BalancesFn;
|
|
88
|
-
public getProverFee!: (blockNumber:
|
|
93
|
+
public getProverFee!: (blockNumber: BlockNumber) => Promise<bigint>;
|
|
89
94
|
|
|
90
95
|
public readonly ALICE_INITIAL_BANANAS = BigInt(1e22);
|
|
91
96
|
public readonly SUBSCRIPTION_AMOUNT = BigInt(1e19);
|
|
@@ -94,7 +99,7 @@ export class FeesTest {
|
|
|
94
99
|
constructor(
|
|
95
100
|
testName: string,
|
|
96
101
|
private numberOfAccounts = 3,
|
|
97
|
-
setupOptions: Partial<SetupOptions &
|
|
102
|
+
setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {},
|
|
98
103
|
) {
|
|
99
104
|
if (!numberOfAccounts) {
|
|
100
105
|
throw new Error('There must be at least 1 initial account.');
|
|
@@ -187,6 +192,7 @@ export class FeesTest {
|
|
|
187
192
|
async ({ deployedAccounts }, { wallet, aztecNode, cheatCodes }) => {
|
|
188
193
|
this.wallet = wallet;
|
|
189
194
|
this.aztecNode = aztecNode;
|
|
195
|
+
this.aztecNodeAdmin = aztecNode;
|
|
190
196
|
this.gasSettings = GasSettings.default({ maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2) });
|
|
191
197
|
this.cheatCodes = cheatCodes;
|
|
192
198
|
this.accounts = deployedAccounts.map(a => a.address);
|
|
@@ -306,7 +312,7 @@ export class FeesTest {
|
|
|
306
312
|
return await this.rollupContract.getSequencerRewards(this.coinbase);
|
|
307
313
|
};
|
|
308
314
|
|
|
309
|
-
this.getProverFee = async (blockNumber:
|
|
315
|
+
this.getProverFee = async (blockNumber: BlockNumber) => {
|
|
310
316
|
const block = await this.aztecNode.getBlock(blockNumber);
|
|
311
317
|
|
|
312
318
|
// @todo @lherskind As we deal with #13601
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { getAddressFromPrivateKey } from '@aztec/ethereum';
|
|
2
|
+
import { getAddressFromPrivateKey } from '@aztec/ethereum/account';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import type { EthPrivateKey } from '@aztec/node-keystore';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { RollupContract } from '@aztec/ethereum';
|
|
3
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
4
4
|
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
5
5
|
|
|
6
6
|
import fs from 'fs';
|
|
@@ -24,7 +24,7 @@ const SLASHING_UNIT = BigInt(1e18);
|
|
|
24
24
|
const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
|
|
25
25
|
|
|
26
26
|
// How many epochs it may take to set everything up, so we dont slash during this period
|
|
27
|
-
const SETUP_EPOCH_DURATION =
|
|
27
|
+
const SETUP_EPOCH_DURATION = 8;
|
|
28
28
|
|
|
29
29
|
export class P2PInactivityTest {
|
|
30
30
|
public nodes!: AztecNodeService[];
|
|
@@ -151,11 +151,8 @@ export class P2PInactivityTest {
|
|
|
151
151
|
// This prevents race conditions where validators propose blocks before the network is ready
|
|
152
152
|
await this.test.waitForP2PMeshConnectivity(this.nodes, NUM_NODES);
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
this.test.
|
|
156
|
-
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(EpochNumber(SETUP_EPOCH_DURATION + 1), {
|
|
157
|
-
offset: -ethereumSlotDuration,
|
|
158
|
-
});
|
|
154
|
+
this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION - 1} (slashing will start after it is completed)`);
|
|
155
|
+
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(EpochNumber(SETUP_EPOCH_DURATION - 1));
|
|
159
156
|
|
|
160
157
|
return this;
|
|
161
158
|
}
|
|
@@ -2,20 +2,19 @@ import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
|
2
2
|
import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
3
3
|
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
4
4
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
|
+
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
|
|
5
6
|
import {
|
|
6
7
|
type EmpireSlashingProposerContract,
|
|
7
|
-
type ExtendedViemWalletClient,
|
|
8
8
|
GSEContract,
|
|
9
|
-
MultiAdderArtifact,
|
|
10
|
-
type Operator,
|
|
11
9
|
RollupContract,
|
|
12
10
|
type TallySlashingProposerContract,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from '@aztec/ethereum';
|
|
11
|
+
} from '@aztec/ethereum/contracts';
|
|
12
|
+
import type { Operator } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
13
|
+
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
14
|
+
import { MultiAdderArtifact } from '@aztec/ethereum/l1-artifacts';
|
|
15
|
+
import { createL1TxUtilsFromViemWallet } from '@aztec/ethereum/l1-tx-utils';
|
|
18
16
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
17
|
+
import type { ExtendedViemWalletClient, ViemClient } from '@aztec/ethereum/types';
|
|
19
18
|
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
20
19
|
import { SecretValue } from '@aztec/foundation/config';
|
|
21
20
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
@@ -94,7 +93,6 @@ export class P2PNetworkTest {
|
|
|
94
93
|
// If set enable metrics collection
|
|
95
94
|
private metricsPort?: number,
|
|
96
95
|
startProverNode?: boolean,
|
|
97
|
-
mockZkPassportVerifier?: boolean,
|
|
98
96
|
) {
|
|
99
97
|
this.logger = createLogger(`e2e:e2e_p2p:${testName}`);
|
|
100
98
|
|
|
@@ -123,7 +121,6 @@ export class P2PNetworkTest {
|
|
|
123
121
|
initialValidatorConfig.slashingRoundSizeInEpochs ?? l1ContractsConfig.slashingRoundSizeInEpochs,
|
|
124
122
|
slasherFlavor: initialValidatorConfig.slasherFlavor ?? 'tally',
|
|
125
123
|
aztecTargetCommitteeSize: numberOfValidators,
|
|
126
|
-
salt: 420,
|
|
127
124
|
metricsPort: metricsPort,
|
|
128
125
|
numberOfInitialFundedAccounts: 2,
|
|
129
126
|
startProverNode,
|
|
@@ -142,7 +139,6 @@ export class P2PNetworkTest {
|
|
|
142
139
|
aztecTargetCommitteeSize: numberOfValidators,
|
|
143
140
|
initialValidators: [],
|
|
144
141
|
zkPassportArgs: {
|
|
145
|
-
mockZkPassportVerifier,
|
|
146
142
|
zkPassportDomain: zkPassportParams.domain,
|
|
147
143
|
zkPassportScope: zkPassportParams.scope,
|
|
148
144
|
},
|
|
@@ -158,7 +154,6 @@ export class P2PNetworkTest {
|
|
|
158
154
|
metricsPort,
|
|
159
155
|
initialConfig,
|
|
160
156
|
startProverNode,
|
|
161
|
-
mockZkPassportVerifier,
|
|
162
157
|
}: {
|
|
163
158
|
testName: string;
|
|
164
159
|
numberOfNodes: number;
|
|
@@ -167,7 +162,6 @@ export class P2PNetworkTest {
|
|
|
167
162
|
metricsPort?: number;
|
|
168
163
|
initialConfig?: SetupOptions;
|
|
169
164
|
startProverNode?: boolean;
|
|
170
|
-
mockZkPassportVerifier?: boolean;
|
|
171
165
|
}) {
|
|
172
166
|
const port = basePort || (await getPort());
|
|
173
167
|
|
|
@@ -188,7 +182,6 @@ export class P2PNetworkTest {
|
|
|
188
182
|
numberOfNodes,
|
|
189
183
|
metricsPort,
|
|
190
184
|
startProverNode,
|
|
191
|
-
mockZkPassportVerifier,
|
|
192
185
|
);
|
|
193
186
|
}
|
|
194
187
|
|
|
@@ -201,7 +194,7 @@ export class P2PNetworkTest {
|
|
|
201
194
|
|
|
202
195
|
async addBootstrapNode() {
|
|
203
196
|
await this.snapshotManager.snapshot('add-bootstrap-node', async ({ aztecNodeConfig }) => {
|
|
204
|
-
const telemetry = getEndToEndTestTelemetryClient(this.metricsPort);
|
|
197
|
+
const telemetry = await getEndToEndTestTelemetryClient(this.metricsPort);
|
|
205
198
|
this.bootstrapNode = await createBootstrapNodeFromPrivateKey(
|
|
206
199
|
BOOTSTRAP_NODE_PRIVATE_KEY,
|
|
207
200
|
this.bootNodePort,
|
|
@@ -449,7 +442,7 @@ export class P2PNetworkTest {
|
|
|
449
442
|
slashFactory: SlashFactoryContract;
|
|
450
443
|
}> {
|
|
451
444
|
if (!this.ctx.deployL1ContractsValues) {
|
|
452
|
-
throw new Error('
|
|
445
|
+
throw new Error('DeployAztecL1ContractsValues not set');
|
|
453
446
|
}
|
|
454
447
|
|
|
455
448
|
const rollup = new RollupContract(
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -6,7 +6,11 @@ import { Fr } from '@aztec/aztec.js/fields';
|
|
|
6
6
|
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
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
EmpireSlashingProposerContract,
|
|
11
|
+
RollupContract,
|
|
12
|
+
TallySlashingProposerContract,
|
|
13
|
+
} from '@aztec/ethereum/contracts';
|
|
10
14
|
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
11
15
|
import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
12
16
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
@@ -11,9 +11,8 @@ import {
|
|
|
11
11
|
TestCircuitVerifier,
|
|
12
12
|
} from '@aztec/bb-prover';
|
|
13
13
|
import { BackendType, Barretenberg } from '@aztec/bb.js';
|
|
14
|
-
import {
|
|
15
|
-
import type {
|
|
16
|
-
import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
14
|
+
import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
15
|
+
import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
17
16
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
18
17
|
import { SecretValue } from '@aztec/foundation/config';
|
|
19
18
|
import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
@@ -69,7 +68,6 @@ export class FullProverTest {
|
|
|
69
68
|
aztecNode!: AztecNode;
|
|
70
69
|
aztecNodeAdmin!: AztecNodeAdmin;
|
|
71
70
|
cheatCodes!: CheatCodes;
|
|
72
|
-
blobSink!: BlobSinkServer;
|
|
73
71
|
private provenComponents: ProvenSetup[] = [];
|
|
74
72
|
private bbConfigCleanup?: () => Promise<void>;
|
|
75
73
|
private acvmConfigCleanup?: () => Promise<void>;
|
|
@@ -78,7 +76,7 @@ export class FullProverTest {
|
|
|
78
76
|
private context!: SubsystemsContext;
|
|
79
77
|
private proverNode!: ProverNode;
|
|
80
78
|
private simulatedProverNode!: ProverNode;
|
|
81
|
-
public l1Contracts!:
|
|
79
|
+
public l1Contracts!: DeployAztecL1ContractsReturnType;
|
|
82
80
|
public proverAddress!: EthAddress;
|
|
83
81
|
|
|
84
82
|
constructor(
|
|
@@ -91,7 +89,7 @@ export class FullProverTest {
|
|
|
91
89
|
this.snapshotManager = createSnapshotManager(
|
|
92
90
|
`full_prover_integration/${testName}`,
|
|
93
91
|
dataPath,
|
|
94
|
-
{ startProverNode: true,
|
|
92
|
+
{ startProverNode: true, coinbase },
|
|
95
93
|
{
|
|
96
94
|
realVerifier: realProofs,
|
|
97
95
|
},
|
|
@@ -169,11 +167,11 @@ export class FullProverTest {
|
|
|
169
167
|
aztecNode: this.aztecNode,
|
|
170
168
|
deployL1ContractsValues: this.l1Contracts,
|
|
171
169
|
cheatCodes: this.cheatCodes,
|
|
172
|
-
blobSink: this.blobSink,
|
|
173
170
|
} = this.context);
|
|
174
171
|
this.aztecNodeAdmin = this.context.aztecNode;
|
|
175
172
|
|
|
176
|
-
const
|
|
173
|
+
const config = this.context.aztecNodeConfig;
|
|
174
|
+
const blobClient = await createBlobClientWithFileStores(config, this.logger);
|
|
177
175
|
|
|
178
176
|
// Configure a full prover PXE
|
|
179
177
|
let acvmConfig: Awaited<ReturnType<typeof getACVMConfig>> | undefined;
|
|
@@ -243,7 +241,7 @@ export class FullProverTest {
|
|
|
243
241
|
this.logger.verbose('Starting archiver for new prover node');
|
|
244
242
|
const archiver = await createArchiver(
|
|
245
243
|
{ ...this.context.aztecNodeConfig, dataDirectory: undefined },
|
|
246
|
-
{
|
|
244
|
+
{ blobClient, dateProvider: this.context.dateProvider },
|
|
247
245
|
{ blockUntilSync: true },
|
|
248
246
|
);
|
|
249
247
|
|
|
@@ -283,7 +281,7 @@ export class FullProverTest {
|
|
|
283
281
|
{
|
|
284
282
|
aztecNodeTxProvider: this.aztecNode,
|
|
285
283
|
archiver: archiver as Archiver,
|
|
286
|
-
|
|
284
|
+
blobClient,
|
|
287
285
|
},
|
|
288
286
|
{ prefilledPublicData },
|
|
289
287
|
);
|
package/src/fixtures/fixtures.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const shouldCollectMetrics = () => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
|
|
11
|
-
export const
|
|
11
|
+
export const TEST_MAX_PENDING_TX_POOL_COUNT = 10_000; // Number of max pending TXs ~ 1.56GB
|
|
12
12
|
|
|
13
13
|
export const MNEMONIC = 'test test test test test test test test test test test junk';
|
|
14
14
|
export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
|
|
@@ -22,8 +22,5 @@ export const BITSIZE_TOO_BIG_ERROR = "Assertion failed: call to assert_max_bit_s
|
|
|
22
22
|
export const DUPLICATE_NULLIFIER_ERROR = /dropped|nullifier|reverted/i;
|
|
23
23
|
export const NO_L1_TO_L2_MSG_ERROR =
|
|
24
24
|
/No non-nullified L1 to L2 message found for message hash|Tried to consume nonexistent L1-to-L2 message/;
|
|
25
|
-
export const STATIC_CALL_STATE_MODIFICATION_ERROR =
|
|
26
|
-
/Static call cannot update the state, emit L2->L1 messages or generate logs.*/;
|
|
25
|
+
export const STATIC_CALL_STATE_MODIFICATION_ERROR = /Static call cannot update the state.*/;
|
|
27
26
|
export const STATIC_CONTEXT_ASSERTION_ERROR = /Assertion failed: Function .* can only be called statically.*/;
|
|
28
|
-
|
|
29
|
-
export const DEFAULT_BLOB_SINK_PORT = '5052';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
2
2
|
import { parseBooleanEnv } from '@aztec/foundation/config';
|
|
3
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
4
4
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
5
5
|
|
|
6
6
|
import { promises as fs } from 'fs';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
2
|
+
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
3
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
4
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
5
|
import { tryJsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
6
|
import { InboxAbi } from '@aztec/l1-artifacts';
|
|
5
7
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
@@ -99,7 +99,7 @@ export async function createNode(
|
|
|
99
99
|
) {
|
|
100
100
|
const createNode = async () => {
|
|
101
101
|
const validatorConfig = await createValidatorConfig(config, bootstrapNode, tcpPort, addressIndex, dataDirectory);
|
|
102
|
-
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
102
|
+
const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
|
|
103
103
|
return await AztecNodeService.createAndSync(
|
|
104
104
|
validatorConfig,
|
|
105
105
|
{ telemetry, dateProvider },
|
|
@@ -128,7 +128,7 @@ export async function createNonValidatorNode(
|
|
|
128
128
|
validatorPrivateKeys: undefined,
|
|
129
129
|
publisherPrivateKeys: [],
|
|
130
130
|
};
|
|
131
|
-
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
131
|
+
const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
|
|
132
132
|
return await AztecNodeService.createAndSync(config, { telemetry, dateProvider }, { prefilledPublicData });
|
|
133
133
|
};
|
|
134
134
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
@@ -147,7 +147,7 @@ export async function createProverNode(
|
|
|
147
147
|
) {
|
|
148
148
|
const createProverNode = async () => {
|
|
149
149
|
const proverNodePrivateKey = getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!;
|
|
150
|
-
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
150
|
+
const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
|
|
151
151
|
|
|
152
152
|
const proverConfig: Partial<ProverNodeConfig> = await createP2PConfig(
|
|
153
153
|
config,
|