@aztec/end-to-end 0.0.1-commit.b655e406 → 0.0.1-commit.b6e433891
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 +22 -16
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +142 -124
- package/dest/bench/client_flows/config.d.ts +2 -2
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +18 -0
- package/dest/bench/client_flows/data_extractor.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.js +7 -27
- package/dest/bench/utils.d.ts +8 -7
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +31 -19
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +9 -8
- 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 +107 -113
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +20 -14
- 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 +92 -70
- package/dest/e2e_deploy_contract/deploy_test.d.ts +6 -5
- 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 +27 -15
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +107 -54
- package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
- package/dest/e2e_fees/bridging_race.notest.js +5 -7
- package/dest/e2e_fees/fees_test.d.ts +21 -17
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +138 -143
- package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +18 -19
- package/dest/e2e_multi_validator/utils.d.ts +1 -1
- 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 +30 -39
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -3
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +7 -6
- package/dest/e2e_p2p/p2p_network.d.ts +229 -21
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +142 -114
- package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/e2e_p2p/reqresp/utils.js +190 -0
- package/dest/e2e_p2p/shared.d.ts +31 -11
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +51 -22
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
- package/dest/e2e_token_contract/token_contract_test.d.ts +19 -10
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +100 -92
- package/dest/fixtures/authwit_proxy.d.ts +15 -0
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.js +30 -0
- package/dest/fixtures/e2e_prover_test.d.ts +15 -21
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +123 -138
- package/dest/fixtures/elu_monitor.d.ts +21 -0
- package/dest/fixtures/elu_monitor.d.ts.map +1 -0
- package/dest/fixtures/elu_monitor.js +102 -0
- package/dest/fixtures/fixtures.d.ts +6 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +8 -3
- package/dest/fixtures/get_acvm_config.d.ts +1 -1
- package/dest/fixtures/get_acvm_config.js +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/ha_setup.d.ts +71 -0
- package/dest/fixtures/ha_setup.d.ts.map +1 -0
- package/dest/fixtures/ha_setup.js +116 -0
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -0
- 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/logging.d.ts +1 -1
- package/dest/fixtures/setup.d.ts +239 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +606 -0
- package/dest/fixtures/setup_p2p_test.d.ts +17 -10
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +55 -36
- package/dest/fixtures/token_utils.d.ts +6 -3
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +17 -10
- package/dest/fixtures/utils.d.ts +5 -192
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -648
- package/dest/fixtures/web3signer.d.ts +1 -1
- 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/index.d.ts +1 -1
- 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 +7 -6
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +27 -27
- 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/gas_portal_test_harness.js +4 -4
- package/dest/shared/index.d.ts +3 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/index.js +1 -0
- package/dest/shared/jest_setup.d.ts +1 -1
- package/dest/shared/jest_setup.js +41 -1
- package/dest/shared/mock_state_view.d.ts +86 -0
- package/dest/shared/mock_state_view.d.ts.map +1 -0
- package/dest/shared/mock_state_view.js +186 -0
- package/dest/shared/submit-transactions.d.ts +4 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +9 -11
- 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 +58 -39
- package/dest/simulators/index.d.ts +1 -1
- 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 +8 -6
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +3 -24
- package/dest/spartan/setup_test_wallets.d.ts +18 -6
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +129 -24
- package/dest/spartan/tx_metrics.d.ts +88 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +422 -0
- package/dest/spartan/utils/bot.d.ts +28 -0
- package/dest/spartan/utils/bot.d.ts.map +1 -0
- package/dest/spartan/utils/bot.js +142 -0
- package/dest/spartan/utils/chaos.d.ts +79 -0
- package/dest/spartan/utils/chaos.d.ts.map +1 -0
- package/dest/spartan/utils/chaos.js +142 -0
- package/dest/spartan/utils/clients.d.ts +39 -0
- package/dest/spartan/utils/clients.d.ts.map +1 -0
- package/dest/spartan/utils/clients.js +90 -0
- package/dest/spartan/utils/config.d.ts +45 -0
- package/dest/spartan/utils/config.d.ts.map +1 -0
- package/dest/spartan/utils/config.js +23 -0
- package/dest/spartan/utils/health.d.ts +63 -0
- package/dest/spartan/utils/health.d.ts.map +1 -0
- package/dest/spartan/utils/health.js +202 -0
- package/dest/spartan/utils/helm.d.ts +15 -0
- package/dest/spartan/utils/helm.d.ts.map +1 -0
- package/dest/spartan/utils/helm.js +47 -0
- package/dest/spartan/utils/index.d.ts +11 -0
- package/dest/spartan/utils/index.d.ts.map +1 -0
- package/dest/spartan/utils/index.js +22 -0
- package/dest/spartan/utils/k8s.d.ts +128 -0
- package/dest/spartan/utils/k8s.d.ts.map +1 -0
- package/dest/spartan/utils/k8s.js +381 -0
- package/dest/spartan/utils/nodes.d.ts +40 -0
- package/dest/spartan/utils/nodes.d.ts.map +1 -0
- package/dest/spartan/utils/nodes.js +461 -0
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -0
- package/dest/spartan/utils/scripts.d.ts +30 -0
- package/dest/spartan/utils/scripts.d.ts.map +1 -0
- package/dest/spartan/utils/scripts.js +81 -0
- package/dest/spartan/utils.d.ts +2 -218
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -749
- package/dest/test-wallet/test_wallet.d.ts +76 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +214 -0
- package/dest/test-wallet/utils.d.ts +41 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +71 -0
- package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
- package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
- package/dest/test-wallet/wallet_worker_script.js +48 -0
- package/dest/test-wallet/worker_wallet.d.ts +52 -0
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet.js +151 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts +274 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet_schema.js +10 -0
- package/package.json +49 -44
- package/src/bench/client_flows/benchmark.ts +24 -2
- package/src/bench/client_flows/client_flows_benchmark.ts +163 -177
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +6 -28
- package/src/bench/utils.ts +36 -21
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +120 -145
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -125
- package/src/e2e_deploy_contract/deploy_test.ts +23 -16
- package/src/e2e_epochs/epochs_test.ts +176 -114
- package/src/e2e_fees/bridging_race.notest.ts +6 -12
- package/src/e2e_fees/fees_test.ts +179 -226
- package/src/e2e_l1_publisher/write_json.ts +20 -19
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_nested_contract/nested_contract_test.ts +35 -55
- package/src/e2e_p2p/inactivity_slash_test.ts +8 -7
- package/src/e2e_p2p/p2p_network.ts +205 -178
- package/src/e2e_p2p/reqresp/utils.ts +256 -0
- package/src/e2e_p2p/shared.ts +90 -29
- package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
- package/src/e2e_token_contract/token_contract_test.ts +121 -119
- package/src/fixtures/authwit_proxy.ts +50 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +144 -186
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +12 -5
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/ha_setup.ts +186 -0
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/setup.ts +903 -0
- package/src/fixtures/setup_p2p_test.ts +58 -48
- package/src/fixtures/token_utils.ts +12 -8
- package/src/fixtures/utils.ts +27 -947
- package/src/fixtures/web3signer.ts +1 -1
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/guides/up_quick_start.sh +4 -4
- 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 +30 -43
- package/src/shared/gas_portal_test_harness.ts +4 -4
- package/src/shared/index.ts +2 -1
- package/src/shared/jest_setup.ts +51 -1
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +11 -16
- package/src/shared/uniswap_l1_l2.ts +86 -102
- package/src/simulators/lending_simulator.ts +11 -7
- package/src/simulators/token_simulator.ts +6 -30
- package/src/spartan/DEVELOP.md +7 -0
- package/src/spartan/setup_test_wallets.ts +205 -29
- package/src/spartan/tx_metrics.ts +376 -0
- package/src/spartan/utils/bot.ts +188 -0
- package/src/spartan/utils/chaos.ts +253 -0
- package/src/spartan/utils/clients.ts +100 -0
- package/src/spartan/utils/config.ts +29 -0
- package/src/spartan/utils/health.ts +255 -0
- package/src/spartan/utils/helm.ts +84 -0
- package/src/spartan/utils/index.ts +71 -0
- package/src/spartan/utils/k8s.ts +535 -0
- package/src/spartan/utils/nodes.ts +543 -0
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/spartan/utils/scripts.ts +99 -0
- package/src/spartan/utils.ts +1 -942
- package/src/test-wallet/test_wallet.ts +294 -0
- package/src/test-wallet/utils.ts +112 -0
- package/src/test-wallet/wallet_worker_script.ts +60 -0
- package/src/test-wallet/worker_wallet.ts +213 -0
- package/src/test-wallet/worker_wallet_schema.ts +13 -0
- package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
- 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Archiver } from '@aztec/archiver';
|
|
1
2
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
2
3
|
import { getTimestampRangeForEpoch } from '@aztec/aztec.js/block';
|
|
3
4
|
import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
@@ -6,28 +7,28 @@ import type { Logger } from '@aztec/aztec.js/log';
|
|
|
6
7
|
import { MerkleTreeId } from '@aztec/aztec.js/trees';
|
|
7
8
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
8
9
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
9
|
-
import {
|
|
10
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
11
|
+
import { DefaultL1ContractsConfig } from '@aztec/ethereum/config';
|
|
10
12
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
11
|
-
import {
|
|
13
|
+
import { Delayer, createDelayer, waitUntilL1Timestamp, wrapClientWithDelayer } from '@aztec/ethereum/l1-tx-utils';
|
|
14
|
+
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
15
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
16
|
+
import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
12
17
|
import { SecretValue } from '@aztec/foundation/config';
|
|
13
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
14
|
-
import {
|
|
18
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
19
|
+
import { withLoggerBindings } from '@aztec/foundation/log/server';
|
|
15
20
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
16
21
|
import { sleep } from '@aztec/foundation/sleep';
|
|
17
22
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
23
|
+
import { TestContract } from '@aztec/noir-test-contracts.js/Test';
|
|
18
24
|
import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
19
|
-
import {
|
|
20
|
-
import type {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
type SequencerEvents,
|
|
24
|
-
type SequencerPublisher,
|
|
25
|
-
SequencerState,
|
|
26
|
-
} from '@aztec/sequencer-client';
|
|
27
|
-
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
28
|
-
import { EthAddress, type L2BlockNumber } from '@aztec/stdlib/block';
|
|
25
|
+
import type { ProverNodeConfig } from '@aztec/prover-node';
|
|
26
|
+
import type { PXEConfig } from '@aztec/pxe/config';
|
|
27
|
+
import { type SequencerClient, type SequencerEvents, SequencerState } from '@aztec/sequencer-client';
|
|
28
|
+
import { type BlockParameter, EthAddress } from '@aztec/stdlib/block';
|
|
29
29
|
import { type L1RollupConstants, getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
30
30
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
31
|
+
import type { SlashingProtectionDatabase } from '@aztec/validator-ha-signer/types';
|
|
31
32
|
|
|
32
33
|
import { join } from 'path';
|
|
33
34
|
import type { Hex } from 'viem';
|
|
@@ -41,12 +42,16 @@ import {
|
|
|
41
42
|
setup,
|
|
42
43
|
} from '../fixtures/utils.js';
|
|
43
44
|
|
|
44
|
-
export const
|
|
45
|
+
export const WORLD_STATE_CHECKPOINT_HISTORY = 2;
|
|
45
46
|
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
46
47
|
export const ARCHIVER_POLL_INTERVAL = 50;
|
|
47
48
|
export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
48
49
|
|
|
49
|
-
export type EpochsTestOpts = Partial<SetupOptions> & {
|
|
50
|
+
export type EpochsTestOpts = Partial<SetupOptions> & {
|
|
51
|
+
numberOfAccounts?: number;
|
|
52
|
+
pxeOpts?: Partial<PXEConfig>;
|
|
53
|
+
aztecSlotDurationInL1Slots?: number;
|
|
54
|
+
};
|
|
50
55
|
|
|
51
56
|
export type TrackedSequencerEvent = {
|
|
52
57
|
[K in keyof SequencerEvents]: Parameters<SequencerEvents[K]>[0] & {
|
|
@@ -72,7 +77,7 @@ export class EpochsTestContext {
|
|
|
72
77
|
public proverDelayer!: Delayer;
|
|
73
78
|
public sequencerDelayer!: Delayer;
|
|
74
79
|
|
|
75
|
-
public proverNodes:
|
|
80
|
+
public proverNodes: AztecNodeService[] = [];
|
|
76
81
|
public nodes: AztecNodeService[] = [];
|
|
77
82
|
|
|
78
83
|
public epochDuration!: number;
|
|
@@ -91,46 +96,63 @@ export class EpochsTestContext {
|
|
|
91
96
|
? parseInt(process.env.L1_BLOCK_TIME)
|
|
92
97
|
: DEFAULT_L1_BLOCK_TIME;
|
|
93
98
|
const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
|
|
94
|
-
const aztecSlotDuration = opts.aztecSlotDuration ??
|
|
99
|
+
const aztecSlotDuration = opts.aztecSlotDuration ?? (opts.aztecSlotDurationInL1Slots ?? 2) * ethereumSlotDuration;
|
|
95
100
|
const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
|
|
96
101
|
const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
|
|
97
|
-
|
|
102
|
+
const l1PublishingTime = opts.l1PublishingTime ?? 1;
|
|
103
|
+
return {
|
|
104
|
+
l1PublishingTime,
|
|
105
|
+
ethereumSlotDuration,
|
|
106
|
+
aztecSlotDuration,
|
|
107
|
+
aztecEpochDuration,
|
|
108
|
+
aztecProofSubmissionEpochs,
|
|
109
|
+
};
|
|
98
110
|
}
|
|
99
111
|
|
|
100
112
|
public async setup(opts: EpochsTestOpts = {}) {
|
|
101
|
-
const {
|
|
102
|
-
|
|
113
|
+
const {
|
|
114
|
+
ethereumSlotDuration,
|
|
115
|
+
aztecSlotDuration,
|
|
116
|
+
aztecEpochDuration,
|
|
117
|
+
aztecProofSubmissionEpochs,
|
|
118
|
+
l1PublishingTime,
|
|
119
|
+
} = EpochsTestContext.getSlotDurations(opts);
|
|
103
120
|
|
|
104
121
|
this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
|
|
105
122
|
this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
|
|
106
123
|
|
|
107
124
|
// Set up system without any account nor protocol contracts
|
|
108
125
|
// and with faster block times and shorter epochs.
|
|
109
|
-
const context = await setup(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
const context = await setup(
|
|
127
|
+
opts.numberOfAccounts ?? 0,
|
|
128
|
+
{
|
|
129
|
+
automineL1Setup: true,
|
|
130
|
+
checkIntervalMs: 50,
|
|
131
|
+
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
132
|
+
worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
|
|
133
|
+
aztecEpochDuration,
|
|
134
|
+
aztecSlotDuration,
|
|
135
|
+
ethereumSlotDuration,
|
|
136
|
+
aztecProofSubmissionEpochs,
|
|
137
|
+
aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
|
|
138
|
+
minTxsPerBlock: 0,
|
|
139
|
+
realProofs: false,
|
|
140
|
+
startProverNode: true,
|
|
141
|
+
proverTestDelayMs: opts.proverTestDelayMs ?? 0,
|
|
142
|
+
// We use numeric incremental prover ids for simplicity, but we can switch to
|
|
143
|
+
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
144
|
+
// Use numeric EthAddress for deterministic prover id
|
|
145
|
+
proverId: EthAddress.fromNumber(1),
|
|
146
|
+
worldStateCheckpointHistory: WORLD_STATE_CHECKPOINT_HISTORY,
|
|
147
|
+
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
148
|
+
slasherFlavor: 'none',
|
|
149
|
+
l1PublishingTime,
|
|
150
|
+
...opts,
|
|
151
|
+
},
|
|
152
|
+
// Use checkpointed chain tip for PXE by default to avoid issues with blocks being dropped due to pruned anchor blocks.
|
|
153
|
+
// Can be overridden via opts.pxeOpts.
|
|
154
|
+
{ syncChainTip: 'checkpointed', ...opts.pxeOpts },
|
|
155
|
+
);
|
|
134
156
|
|
|
135
157
|
this.context = context;
|
|
136
158
|
this.proverNodes = context.proverNode ? [context.proverNode] : [];
|
|
@@ -143,17 +165,8 @@ export class EpochsTestContext {
|
|
|
143
165
|
// Loop that tracks L1 and L2 block numbers and logs whenever there's a new one.
|
|
144
166
|
this.monitor = new ChainMonitor(this.rollup, context.dateProvider, this.logger).start();
|
|
145
167
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
this.proverDelayer = context.proverNode
|
|
149
|
-
? (((context.proverNode as TestProverNode).publisher as ProverNodePublisher).l1TxUtils as DelayedTxUtils).delayer!
|
|
150
|
-
: undefined!;
|
|
151
|
-
this.sequencerDelayer = context.sequencer
|
|
152
|
-
? (
|
|
153
|
-
((context.sequencer as TestSequencerClient).sequencer.publisher as SequencerPublisher)
|
|
154
|
-
.l1TxUtils as DelayedTxUtils
|
|
155
|
-
).delayer!
|
|
156
|
-
: undefined!;
|
|
168
|
+
this.proverDelayer = context.proverDelayer!;
|
|
169
|
+
this.sequencerDelayer = context.sequencerDelayer!;
|
|
157
170
|
|
|
158
171
|
if ((context.proverNode && !this.proverDelayer) || (context.sequencer && !this.sequencerDelayer)) {
|
|
159
172
|
throw new Error(`Could not find prover or sequencer delayer`);
|
|
@@ -168,6 +181,8 @@ export class EpochsTestContext {
|
|
|
168
181
|
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
169
182
|
ethereumSlotDuration,
|
|
170
183
|
proofSubmissionEpochs: Number(await this.rollup.getProofSubmissionEpochs()),
|
|
184
|
+
targetCommitteeSize: await this.rollup.getTargetCommitteeSize(),
|
|
185
|
+
rollupManaLimit: Number(await this.rollup.getManaLimit()),
|
|
171
186
|
};
|
|
172
187
|
|
|
173
188
|
this.logger.info(
|
|
@@ -185,20 +200,32 @@ export class EpochsTestContext {
|
|
|
185
200
|
public async createProverNode(opts: { dontStart?: boolean } & Partial<ProverNodeConfig> = {}) {
|
|
186
201
|
this.logger.warn('Creating and syncing a simulated prover node...');
|
|
187
202
|
const proverNodePrivateKey = this.getNextPrivateKey();
|
|
188
|
-
const
|
|
189
|
-
const
|
|
203
|
+
const proverIndex = this.proverNodes.length + 1;
|
|
204
|
+
const { mockGossipSubNetwork } = this.context;
|
|
205
|
+
const { proverNode } = await withLoggerBindings({ actor: `prover-${proverIndex}` }, () =>
|
|
190
206
|
createAndSyncProverNode(
|
|
191
207
|
proverNodePrivateKey,
|
|
192
|
-
{ ...this.context.config },
|
|
193
208
|
{
|
|
194
|
-
|
|
195
|
-
|
|
209
|
+
...this.context.config,
|
|
210
|
+
p2pEnabled: this.context.config.p2pEnabled || mockGossipSubNetwork !== undefined,
|
|
211
|
+
proverId: EthAddress.fromNumber(proverIndex),
|
|
196
212
|
dontStart: opts.dontStart,
|
|
197
213
|
...opts,
|
|
198
214
|
},
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
215
|
+
{
|
|
216
|
+
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
dateProvider: this.context.dateProvider,
|
|
220
|
+
p2pClientDeps: {
|
|
221
|
+
p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined,
|
|
222
|
+
rpcTxProviders: [this.context.aztecNode],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
prefilledPublicData: this.context.prefilledPublicData ?? [],
|
|
227
|
+
dontStart: opts.dontStart,
|
|
228
|
+
},
|
|
202
229
|
),
|
|
203
230
|
);
|
|
204
231
|
this.proverNodes.push(proverNode);
|
|
@@ -212,26 +239,34 @@ export class EpochsTestContext {
|
|
|
212
239
|
|
|
213
240
|
public createValidatorNode(
|
|
214
241
|
privateKeys: `0x${string}`[],
|
|
215
|
-
opts: Partial<AztecNodeConfig> & {
|
|
242
|
+
opts: Partial<AztecNodeConfig> & {
|
|
243
|
+
dontStartSequencer?: boolean;
|
|
244
|
+
slashingProtectionDb?: SlashingProtectionDatabase;
|
|
245
|
+
} = {},
|
|
216
246
|
) {
|
|
217
247
|
this.logger.warn('Creating and syncing a validator node...');
|
|
218
248
|
return this.createNode({ ...opts, disableValidator: false, validatorPrivateKeys: new SecretValue(privateKeys) });
|
|
219
249
|
}
|
|
220
250
|
|
|
221
251
|
private async createNode(
|
|
222
|
-
opts: Partial<AztecNodeConfig> & {
|
|
252
|
+
opts: Partial<AztecNodeConfig> & {
|
|
253
|
+
dontStartSequencer?: boolean;
|
|
254
|
+
slashingProtectionDb?: SlashingProtectionDatabase;
|
|
255
|
+
} = {},
|
|
223
256
|
) {
|
|
224
|
-
const
|
|
257
|
+
const nodeIndex = this.nodes.length + 1;
|
|
258
|
+
const actorPrefix = opts.disableValidator ? 'node' : 'validator';
|
|
225
259
|
const { mockGossipSubNetwork } = this.context;
|
|
226
260
|
const resolvedConfig = { ...this.context.config, ...opts };
|
|
227
261
|
const p2pEnabled = resolvedConfig.p2pEnabled || mockGossipSubNetwork !== undefined;
|
|
228
262
|
const p2pIp = resolvedConfig.p2pIp ?? (p2pEnabled ? '127.0.0.1' : undefined);
|
|
229
|
-
const node = await
|
|
263
|
+
const node = await withLoggerBindings({ actor: `${actorPrefix}-${nodeIndex}` }, () =>
|
|
230
264
|
AztecNodeService.createAndSync(
|
|
231
265
|
{
|
|
232
266
|
...resolvedConfig,
|
|
233
267
|
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
234
268
|
validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
|
|
269
|
+
nodeId: resolvedConfig.nodeId || `${actorPrefix}-${nodeIndex}`,
|
|
235
270
|
p2pEnabled,
|
|
236
271
|
p2pIp,
|
|
237
272
|
},
|
|
@@ -240,6 +275,7 @@ export class EpochsTestContext {
|
|
|
240
275
|
p2pClientDeps: {
|
|
241
276
|
p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined,
|
|
242
277
|
},
|
|
278
|
+
slashingProtectionDb: opts.slashingProtectionDb,
|
|
243
279
|
},
|
|
244
280
|
{
|
|
245
281
|
prefilledPublicData: this.context.prefilledPublicData,
|
|
@@ -248,26 +284,6 @@ export class EpochsTestContext {
|
|
|
248
284
|
),
|
|
249
285
|
);
|
|
250
286
|
|
|
251
|
-
// REFACTOR: We're getting too much into the internals of the sequencer here.
|
|
252
|
-
// We should have a single method for constructing an aztec node that returns a TestAztecNodeService
|
|
253
|
-
// which directly exposes the delayer and sets any test config.
|
|
254
|
-
if (opts.txDelayerMaxInclusionTimeIntoSlot !== undefined) {
|
|
255
|
-
this.logger.info(
|
|
256
|
-
`Setting tx delayer max inclusion time into slot to ${opts.txDelayerMaxInclusionTimeIntoSlot} seconds`,
|
|
257
|
-
);
|
|
258
|
-
// Here we reach into the sequencer and hook in a tx delayer. The problem is that the sequencer's l1 utils only uses a public client, not a wallet.
|
|
259
|
-
// The delayer needs a wallet (a client that can sign), so we have to create one here.
|
|
260
|
-
const l1Client = createExtendedL1Client(
|
|
261
|
-
resolvedConfig.l1RpcUrls!,
|
|
262
|
-
resolvedConfig.publisherPrivateKeys![0]!.getValue(),
|
|
263
|
-
);
|
|
264
|
-
const sequencer = node.getSequencer() as TestSequencerClient;
|
|
265
|
-
const publisher = sequencer.sequencer.publisher;
|
|
266
|
-
const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, this.L1_BLOCK_TIME_IN_S, l1Client);
|
|
267
|
-
delayed.delayer!.setMaxInclusionTimeIntoSlot(opts.txDelayerMaxInclusionTimeIntoSlot);
|
|
268
|
-
publisher.l1TxUtils = delayed;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
287
|
this.nodes.push(node);
|
|
272
288
|
return node;
|
|
273
289
|
}
|
|
@@ -279,7 +295,7 @@ export class EpochsTestContext {
|
|
|
279
295
|
|
|
280
296
|
/** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */
|
|
281
297
|
public async waitUntilEpochStarts(epoch: number) {
|
|
282
|
-
const [start] = getTimestampRangeForEpoch(
|
|
298
|
+
const [start] = getTimestampRangeForEpoch(EpochNumber(epoch), this.constants);
|
|
283
299
|
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
284
300
|
await waitUntilL1Timestamp(
|
|
285
301
|
this.l1Client,
|
|
@@ -290,40 +306,43 @@ export class EpochsTestContext {
|
|
|
290
306
|
return start;
|
|
291
307
|
}
|
|
292
308
|
|
|
293
|
-
/** Waits until the given
|
|
294
|
-
public async
|
|
309
|
+
/** Waits until the given checkpoint number is mined. */
|
|
310
|
+
public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout = 120) {
|
|
295
311
|
await retryUntil(
|
|
296
|
-
() => Promise.resolve(target <= this.monitor.
|
|
297
|
-
`Wait until
|
|
312
|
+
() => Promise.resolve(target <= this.monitor.checkpointNumber),
|
|
313
|
+
`Wait until checkpoint ${target}`,
|
|
298
314
|
timeout,
|
|
299
315
|
0.1,
|
|
300
316
|
);
|
|
301
317
|
}
|
|
302
318
|
|
|
303
|
-
/** Waits until the given
|
|
304
|
-
public async
|
|
319
|
+
/** Waits until the given checkpoint number is marked as proven. */
|
|
320
|
+
public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout = 120) {
|
|
305
321
|
await retryUntil(
|
|
306
|
-
() => Promise.resolve(
|
|
307
|
-
`Wait proven
|
|
322
|
+
() => Promise.resolve(target <= this.monitor.provenCheckpointNumber),
|
|
323
|
+
`Wait proven checkpoint ${target}`,
|
|
308
324
|
timeout,
|
|
309
325
|
0.1,
|
|
310
326
|
);
|
|
311
|
-
return this.monitor.
|
|
327
|
+
return this.monitor.provenCheckpointNumber;
|
|
312
328
|
}
|
|
313
329
|
|
|
314
330
|
/** Waits until the last slot of the proof submission window for a given epoch. */
|
|
315
331
|
public async waitUntilLastSlotOfProofSubmissionWindow(epochNumber: number | bigint) {
|
|
316
|
-
const deadline = getProofSubmissionDeadlineTimestamp(BigInt(epochNumber), this.constants);
|
|
332
|
+
const deadline = getProofSubmissionDeadlineTimestamp(EpochNumber.fromBigInt(BigInt(epochNumber)), this.constants);
|
|
317
333
|
const oneSlotBefore = deadline - BigInt(this.constants.slotDuration);
|
|
318
334
|
const date = new Date(Number(oneSlotBefore) * 1000);
|
|
319
335
|
this.logger.info(`Waiting until last slot of submission window for epoch ${epochNumber} at ${date}`, {
|
|
320
336
|
oneSlotBefore,
|
|
321
337
|
});
|
|
322
|
-
|
|
338
|
+
// Use a timeout that accounts for the full proof submission window
|
|
339
|
+
const proofSubmissionWindowDuration =
|
|
340
|
+
this.constants.proofSubmissionEpochs * this.epochDuration * this.L2_SLOT_DURATION_IN_S;
|
|
341
|
+
await waitUntilL1Timestamp(this.l1Client, oneSlotBefore, undefined, proofSubmissionWindowDuration * 2);
|
|
323
342
|
}
|
|
324
343
|
|
|
325
344
|
/** Waits for the aztec node to sync to the target block number. */
|
|
326
|
-
public async waitForNodeToSync(blockNumber:
|
|
345
|
+
public async waitForNodeToSync(blockNumber: BlockNumber, type: 'proven' | 'finalized' | 'historic') {
|
|
327
346
|
const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
|
|
328
347
|
let synched = false;
|
|
329
348
|
while (!synched) {
|
|
@@ -334,7 +353,7 @@ export class EpochsTestContext {
|
|
|
334
353
|
]);
|
|
335
354
|
this.logger.info(`Wait for node synch ${blockNumber} ${type}`, { blockNumber, type, syncState, tips });
|
|
336
355
|
if (type === 'proven') {
|
|
337
|
-
synched = tips.proven.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
|
|
356
|
+
synched = tips.proven.block.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
|
|
338
357
|
} else if (type === 'finalized') {
|
|
339
358
|
synched = syncState.finalizedBlockNumber >= blockNumber;
|
|
340
359
|
} else {
|
|
@@ -356,23 +375,34 @@ export class EpochsTestContext {
|
|
|
356
375
|
return SpamContract.at(instance.address, wallet);
|
|
357
376
|
}
|
|
358
377
|
|
|
378
|
+
/** Registers the TestContract on the given wallet. */
|
|
379
|
+
public async registerTestContract(wallet: Wallet, salt = Fr.ZERO) {
|
|
380
|
+
const instance = await getContractInstanceFromInstantiationParams(TestContract.artifact, {
|
|
381
|
+
constructorArgs: [],
|
|
382
|
+
constructorArtifact: undefined,
|
|
383
|
+
salt,
|
|
384
|
+
publicKeys: undefined,
|
|
385
|
+
deployer: undefined,
|
|
386
|
+
});
|
|
387
|
+
await wallet.registerContract(instance, TestContract.artifact);
|
|
388
|
+
return TestContract.at(instance.address, wallet);
|
|
389
|
+
}
|
|
390
|
+
|
|
359
391
|
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
|
|
360
392
|
public async createL1Client() {
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
this.l1Client.chain,
|
|
366
|
-
),
|
|
367
|
-
this.context.dateProvider!,
|
|
368
|
-
{ ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S },
|
|
393
|
+
const rawClient = createExtendedL1Client(
|
|
394
|
+
[...this.l1Client.chain.rpcUrls.default.http],
|
|
395
|
+
privateKeyToAccount(this.getNextPrivateKey()),
|
|
396
|
+
this.l1Client.chain,
|
|
369
397
|
);
|
|
398
|
+
const delayer = createDelayer(this.context.dateProvider, { ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S }, {});
|
|
399
|
+
const client = wrapClientWithDelayer(rawClient, delayer);
|
|
370
400
|
expect(await client.getBalance({ address: client.account.address })).toBeGreaterThan(0n);
|
|
371
401
|
return { client, delayer };
|
|
372
402
|
}
|
|
373
403
|
|
|
374
404
|
/** Verifies whether the given block number is found on the aztec node. */
|
|
375
|
-
public async verifyHistoricBlock(blockNumber:
|
|
405
|
+
public async verifyHistoricBlock(blockNumber: BlockParameter, expectedSuccess: boolean) {
|
|
376
406
|
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
377
407
|
// at a particular block, so we know whether that historic block is available or has been
|
|
378
408
|
// pruned. Note that `getBlock` would not work here, since it only hits the archiver.
|
|
@@ -383,6 +413,38 @@ export class EpochsTestContext {
|
|
|
383
413
|
expect(result).toBe(expectedSuccess);
|
|
384
414
|
}
|
|
385
415
|
|
|
416
|
+
/** Verifies at least one checkpoint has the target number of blocks (for MBPS validation). */
|
|
417
|
+
public async assertMultipleBlocksPerSlot(targetBlockCount: number) {
|
|
418
|
+
const archiver = (this.context.aztecNode as AztecNodeService).getBlockSource() as Archiver;
|
|
419
|
+
const checkpoints = await archiver.getCheckpoints(CheckpointNumber(1), 50);
|
|
420
|
+
|
|
421
|
+
this.logger.warn(`Retrieved ${checkpoints.length} checkpoints from archiver`, {
|
|
422
|
+
checkpoints: checkpoints.map(pc => pc.checkpoint.getStats()),
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
let expectedBlockNumber = checkpoints[0].checkpoint.blocks[0].number;
|
|
426
|
+
let targetFound = false;
|
|
427
|
+
|
|
428
|
+
for (const checkpoint of checkpoints) {
|
|
429
|
+
const blockCount = checkpoint.checkpoint.blocks.length;
|
|
430
|
+
targetFound = targetFound || blockCount >= targetBlockCount;
|
|
431
|
+
|
|
432
|
+
this.logger.verbose(`Checkpoint ${checkpoint.checkpoint.number} has ${blockCount} blocks`, {
|
|
433
|
+
checkpoint: checkpoint.checkpoint.getStats(),
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
for (let i = 0; i < blockCount; i++) {
|
|
437
|
+
const block = checkpoint.checkpoint.blocks[i];
|
|
438
|
+
expect(block.indexWithinCheckpoint).toBe(i);
|
|
439
|
+
expect(block.checkpointNumber).toBe(checkpoint.checkpoint.number);
|
|
440
|
+
expect(block.number).toBe(expectedBlockNumber);
|
|
441
|
+
expectedBlockNumber++;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
expect(targetFound).toBe(true);
|
|
446
|
+
}
|
|
447
|
+
|
|
386
448
|
public watchSequencerEvents(
|
|
387
449
|
sequencers: SequencerClient[],
|
|
388
450
|
getMetadata: (i: number) => Record<string, any> = () => ({}),
|
|
@@ -390,11 +452,11 @@ export class EpochsTestContext {
|
|
|
390
452
|
const stateChanges: TrackedSequencerEvent[] = [];
|
|
391
453
|
const failEvents: TrackedSequencerEvent[] = [];
|
|
392
454
|
|
|
393
|
-
// Note we do not include the 'tx-count-check-failed' event here, since it is fine if we dont build
|
|
455
|
+
// Note we do not include the 'block-tx-count-check-failed' event here, since it is fine if we dont build
|
|
394
456
|
// due to lack of txs available.
|
|
395
457
|
const failEventsKeys: (keyof SequencerEvents)[] = [
|
|
396
458
|
'block-build-failed',
|
|
397
|
-
'
|
|
459
|
+
'checkpoint-publish-failed',
|
|
398
460
|
'proposer-rollup-check-failed',
|
|
399
461
|
];
|
|
400
462
|
|
|
@@ -1,14 +1,14 @@
|
|
|
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
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
8
7
|
|
|
9
8
|
import { jest } from '@jest/globals';
|
|
10
9
|
import type { Hex } from 'viem';
|
|
11
10
|
|
|
11
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
12
12
|
import { FeesTest } from './fees_test.js';
|
|
13
13
|
|
|
14
14
|
jest.setTimeout(300_000);
|
|
@@ -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 () => {
|
|
@@ -60,7 +57,7 @@ describe('e2e_fees bridging_race', () => {
|
|
|
60
57
|
const origApprove = l1TokenManager.approve.bind(l1TokenManager);
|
|
61
58
|
l1TokenManager.approve = async (amount: bigint, address: Hex, addressName = '') => {
|
|
62
59
|
await origApprove(amount, address, addressName);
|
|
63
|
-
const sleepTime = (Number(t.chainMonitor.
|
|
60
|
+
const sleepTime = (Number(t.chainMonitor.checkpointTimestamp) + AZTEC_SLOT_DURATION) * 1000 - Date.now() - 500;
|
|
64
61
|
logger.info(`Sleeping for ${sleepTime}ms until near end of L2 slot before sending L1 fee juice to L2 inbox`);
|
|
65
62
|
await sleep(sleepTime);
|
|
66
63
|
};
|
|
@@ -70,10 +67,7 @@ describe('e2e_fees bridging_race', () => {
|
|
|
70
67
|
// Yes, we need to REFACTOR it at some point
|
|
71
68
|
const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(bobsAddress);
|
|
72
69
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
73
|
-
await t.feeJuiceContract.methods
|
|
74
|
-
.claim(bobsAddress, claim.claimAmount, secret, index)
|
|
75
|
-
.send({ from: bobsAddress })
|
|
76
|
-
.wait();
|
|
70
|
+
await t.feeJuiceContract.methods.claim(bobsAddress, claim.claimAmount, secret, index).send({ from: bobsAddress });
|
|
77
71
|
const [balance] = await t.getGasBalanceFn(bobsAddress);
|
|
78
72
|
expect(balance).toEqual(claim.claimAmount);
|
|
79
73
|
});
|