@aztec/end-to-end 0.0.1-commit.d3ec352c → 0.0.1-commit.d431d1c
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 +3 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +21 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +14 -15
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +110 -138
- package/dest/bench/client_flows/data_extractor.js +3 -1
- package/dest/bench/utils.d.ts +6 -6
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +18 -11
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +6 -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 +98 -113
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +19 -13
- 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 +91 -71
- package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -3
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +18 -13
- package/dest/e2e_epochs/epochs_test.d.ts +3 -2
- 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 +3 -5
- package/dest/e2e_fees/fees_test.d.ts +18 -15
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +126 -141
- package/dest/e2e_l1_publisher/write_json.d.ts +3 -3
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +19 -15
- package/dest/e2e_multi_validator/utils.js +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +32 -40
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +4 -4
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +6 -9
- package/dest/e2e_p2p/p2p_network.d.ts +13 -11
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +116 -111
- package/dest/e2e_p2p/shared.d.ts +2 -2
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +4 -4
- package/dest/e2e_token_contract/token_contract_test.d.ts +16 -9
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +90 -92
- package/dest/fixtures/e2e_prover_test.d.ts +10 -18
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +88 -103
- package/dest/fixtures/fixtures.d.ts +2 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +1 -2
- 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.d.ts +216 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +684 -0
- package/dest/fixtures/setup_p2p_test.js +3 -3
- package/dest/fixtures/utils.d.ts +5 -638
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -647
- 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/quality_of_service/grafana_client.d.ts +41 -0
- package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
- package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
- package/dest/quality_of_service/prometheus_client.d.ts +38 -0
- package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
- package/dest/quality_of_service/prometheus_client.js +67 -0
- package/dest/shared/cross_chain_test_harness.d.ts +16 -4
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +3 -3
- package/dest/shared/gas_portal_test_harness.d.ts +12 -2
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/index.d.ts +2 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +3 -27
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +43 -23
- package/dest/simulators/lending_simulator.d.ts +6 -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 +4 -3
- 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 +52 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +248 -0
- package/dest/spartan/utils.d.ts +51 -12
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +262 -102
- package/package.json +40 -39
- package/src/bench/client_flows/benchmark.ts +24 -2
- package/src/bench/client_flows/client_flows_benchmark.ts +150 -200
- package/src/bench/client_flows/data_extractor.ts +1 -1
- package/src/bench/utils.ts +22 -14
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +107 -142
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -125
- package/src/e2e_deploy_contract/deploy_test.ts +21 -14
- package/src/e2e_epochs/epochs_test.ts +26 -13
- package/src/e2e_fees/bridging_race.notest.ts +3 -6
- package/src/e2e_fees/fees_test.ts +177 -216
- package/src/e2e_l1_publisher/write_json.ts +22 -17
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_nested_contract/nested_contract_test.ts +35 -56
- package/src/e2e_p2p/inactivity_slash_test.ts +9 -12
- package/src/e2e_p2p/p2p_network.ts +174 -183
- package/src/e2e_p2p/shared.ts +11 -6
- package/src/e2e_token_contract/token_contract_test.ts +105 -118
- package/src/fixtures/e2e_prover_test.ts +112 -144
- package/src/fixtures/fixtures.ts +1 -3
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/setup.ts +1010 -0
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/fixtures/utils.ts +27 -966
- package/src/fixtures/web3signer.ts +1 -1
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
- package/src/quality_of_service/prometheus_client.ts +113 -0
- package/src/shared/cross_chain_test_harness.ts +6 -10
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/index.ts +1 -1
- package/src/shared/uniswap_l1_l2.ts +53 -67
- package/src/simulators/lending_simulator.ts +2 -2
- package/src/spartan/setup_test_wallets.ts +9 -2
- package/src/spartan/tx_metrics.ts +231 -0
- package/src/spartan/utils.ts +308 -45
- 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/dest/fixtures/snapshot_manager.d.ts +0 -95
- package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
- package/dest/fixtures/snapshot_manager.js +0 -505
- package/dest/quality_of_service/alert_checker.d.ts +0 -41
- package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
- package/src/fixtures/setup_l1_contracts.ts +0 -26
- package/src/fixtures/snapshot_manager.ts +0 -665
|
@@ -10,12 +10,10 @@ import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/Statefu
|
|
|
10
10
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
11
11
|
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
12
12
|
|
|
13
|
-
import { type
|
|
14
|
-
|
|
15
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
13
|
+
import { type EndToEndContext, deployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
16
14
|
|
|
17
15
|
export class DeployTest {
|
|
18
|
-
|
|
16
|
+
public context!: EndToEndContext;
|
|
19
17
|
public logger: Logger;
|
|
20
18
|
public wallet!: TestWallet;
|
|
21
19
|
public defaultAccountAddress!: AztecAddress;
|
|
@@ -24,26 +22,35 @@ export class DeployTest {
|
|
|
24
22
|
|
|
25
23
|
constructor(testName: string) {
|
|
26
24
|
this.logger = createLogger(`e2e:e2e_deploy_contract:${testName}`);
|
|
27
|
-
this.snapshotManager = createSnapshotManager(`e2e_deploy_contract/${testName}`, dataPath);
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
async setup() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
this.logger.info('Setting up test environment');
|
|
29
|
+
this.context = await setup(0, {
|
|
30
|
+
fundSponsoredFPC: true,
|
|
31
|
+
skipAccountDeployment: true,
|
|
32
|
+
});
|
|
33
|
+
this.aztecNode = this.context.aztecNodeService!;
|
|
34
|
+
this.wallet = this.context.wallet;
|
|
35
|
+
this.aztecNodeAdmin = this.context.aztecNodeService!;
|
|
36
|
+
await this.applyInitialAccount();
|
|
35
37
|
return this;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
async teardown() {
|
|
39
|
-
await this.
|
|
41
|
+
await teardown(this.context);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
private async
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
private async applyInitialAccount() {
|
|
45
|
+
this.logger.info('Applying initial account setup');
|
|
46
|
+
const { deployedAccounts } = await deployAccounts(
|
|
47
|
+
1,
|
|
48
|
+
this.logger,
|
|
49
|
+
)({
|
|
50
|
+
wallet: this.context.wallet,
|
|
51
|
+
initialFundedAccounts: this.context.initialFundedAccounts,
|
|
46
52
|
});
|
|
53
|
+
this.defaultAccountAddress = deployedAccounts[0].address;
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
async registerContract<T extends ContractBase>(
|
|
@@ -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';
|
|
13
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
12
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';
|
|
@@ -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
|
|
|
@@ -198,7 +211,7 @@ export class EpochsTestContext {
|
|
|
198
211
|
...opts,
|
|
199
212
|
},
|
|
200
213
|
this.context.aztecNode,
|
|
201
|
-
|
|
214
|
+
this.context.prefilledPublicData ?? [],
|
|
202
215
|
{ dateProvider: this.context.dateProvider },
|
|
203
216
|
),
|
|
204
217
|
);
|
|
@@ -292,7 +305,7 @@ export class EpochsTestContext {
|
|
|
292
305
|
}
|
|
293
306
|
|
|
294
307
|
/** Waits until the given checkpoint number is mined. */
|
|
295
|
-
public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout =
|
|
308
|
+
public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout = 120) {
|
|
296
309
|
await retryUntil(
|
|
297
310
|
() => Promise.resolve(target <= this.monitor.checkpointNumber),
|
|
298
311
|
`Wait until checkpoint ${target}`,
|
|
@@ -302,7 +315,7 @@ export class EpochsTestContext {
|
|
|
302
315
|
}
|
|
303
316
|
|
|
304
317
|
/** Waits until the given checkpoint number is marked as proven. */
|
|
305
|
-
public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout =
|
|
318
|
+
public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout = 120) {
|
|
306
319
|
await retryUntil(
|
|
307
320
|
() => Promise.resolve(target <= this.monitor.provenCheckpointNumber),
|
|
308
321
|
`Wait proven checkpoint ${target}`,
|
|
@@ -335,7 +348,7 @@ export class EpochsTestContext {
|
|
|
335
348
|
]);
|
|
336
349
|
this.logger.info(`Wait for node synch ${blockNumber} ${type}`, { blockNumber, type, syncState, tips });
|
|
337
350
|
if (type === 'proven') {
|
|
338
|
-
synched = tips.proven.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
|
|
351
|
+
synched = tips.proven.block.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
|
|
339
352
|
} else if (type === 'finalized') {
|
|
340
353
|
synched = syncState.finalizedBlockNumber >= blockNumber;
|
|
341
354
|
} else {
|
|
@@ -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';
|
|
@@ -26,11 +26,8 @@ describe('e2e_fees bridging_race', () => {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
beforeAll(async () => {
|
|
29
|
-
await t.
|
|
30
|
-
|
|
31
|
-
await t.applySetupFeeJuiceSnapshot();
|
|
32
|
-
|
|
33
|
-
({ wallet, logger } = await t.setup());
|
|
29
|
+
await t.setup();
|
|
30
|
+
({ wallet, logger } = t);
|
|
34
31
|
});
|
|
35
32
|
|
|
36
33
|
afterAll(async () => {
|