@aztec/end-to-end 0.0.1-commit.5daedc8 → 0.0.1-commit.6201a7b05
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/README.md +27 -0
- 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 +15 -16
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +125 -145
- 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.js +3 -1
- package/dest/bench/utils.d.ts +9 -8
- 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 +11 -9
- 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 +108 -114
- 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 -71
- package/dest/e2e_deploy_contract/deploy_test.d.ts +5 -4
- 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 +42 -15
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +159 -59
- package/dest/e2e_fees/bridging_race.notest.js +4 -6
- 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 +139 -147
- 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 +14 -16
- 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 -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 +9 -12
- package/dest/e2e_p2p/p2p_network.d.ts +25 -21
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +175 -130
- 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 +193 -0
- package/dest/e2e_p2p/shared.d.ts +30 -12
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +84 -67
- 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 +34 -0
- package/dest/fixtures/e2e_prover_test.d.ts +16 -23
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +115 -139
- 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 +17 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +18 -3
- 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/get_bb_config.js +5 -5
- 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/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +39 -0
- package/dest/fixtures/setup.d.ts +246 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +625 -0
- package/dest/fixtures/setup_p2p_test.d.ts +18 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +46 -35
- package/dest/fixtures/token_utils.d.ts +2 -2
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +7 -6
- package/dest/fixtures/utils.d.ts +5 -637
- 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/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- 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 +18 -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 +12 -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.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 -43
- 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 +6 -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 +15 -5
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +132 -43
- 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 +438 -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 -220
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -782
- package/dest/test-wallet/test_wallet.d.ts +84 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +255 -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 +279 -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 -45
- package/src/bench/client_flows/benchmark.ts +24 -2
- package/src/bench/client_flows/client_flows_benchmark.ts +166 -216
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +1 -1
- package/src/bench/utils.ts +36 -21
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +123 -151
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -126
- package/src/e2e_deploy_contract/deploy_test.ts +22 -15
- package/src/e2e_epochs/epochs_test.ts +222 -112
- package/src/e2e_fees/bridging_race.notest.ts +5 -11
- package/src/e2e_fees/fees_test.ts +182 -230
- package/src/e2e_l1_publisher/write_json.ts +16 -16
- 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 +10 -13
- package/src/e2e_p2p/p2p_network.ts +245 -204
- package/src/e2e_p2p/reqresp/utils.ts +257 -0
- package/src/e2e_p2p/shared.ts +111 -81
- 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 +54 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +143 -189
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +34 -5
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +188 -0
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +932 -0
- package/src/fixtures/setup_p2p_test.ts +51 -55
- package/src/fixtures/token_utils.ts +7 -6
- 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/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +104 -0
- package/src/guides/up_quick_start.sh +3 -5
- package/src/legacy-jest-resolver.cjs +135 -0
- 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 +3 -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 -106
- 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 +192 -28
- package/src/spartan/tx_metrics.ts +388 -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 -982
- package/src/test-wallet/test_wallet.ts +357 -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 +214 -0
- package/src/test-wallet/worker_wallet_schema.ts +13 -0
- 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
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
+
import { getAccountContractAddress } from '@aztec/aztec.js/account';
|
|
2
3
|
import { getTimestampRangeForEpoch } from '@aztec/aztec.js/block';
|
|
3
4
|
import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
4
5
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
6
|
import { MerkleTreeId } from '@aztec/aztec.js/trees';
|
|
6
7
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
7
|
-
import {
|
|
8
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
9
|
+
import { DefaultL1ContractsConfig } from '@aztec/ethereum/config';
|
|
8
10
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
+
import { createDelayer, waitUntilL1Timestamp, wrapClientWithDelayer } from '@aztec/ethereum/l1-tx-utils';
|
|
12
|
+
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
13
|
+
import { CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
11
14
|
import { SecretValue } from '@aztec/foundation/config';
|
|
12
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
13
|
-
import {
|
|
15
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
16
|
+
import { withLoggerBindings } from '@aztec/foundation/log/server';
|
|
14
17
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
15
18
|
import { sleep } from '@aztec/foundation/sleep';
|
|
16
19
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
20
|
+
import { TestContract } from '@aztec/noir-test-contracts.js/Test';
|
|
17
21
|
import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
18
22
|
import { SequencerState } from '@aztec/sequencer-client';
|
|
19
23
|
import { EthAddress } from '@aztec/stdlib/block';
|
|
@@ -21,8 +25,9 @@ import { getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers
|
|
|
21
25
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
22
26
|
import { join } from 'path';
|
|
23
27
|
import { privateKeyToAccount } from 'viem/accounts';
|
|
28
|
+
import { SCHNORR_HARDCODED_PRIVATE_KEY, SchnorrHardcodedKeyAccountContract } from '../fixtures/schnorr_hardcoded_account_contract.js';
|
|
24
29
|
import { createAndSyncProverNode, getPrivateKeyFromIndex, setup } from '../fixtures/utils.js';
|
|
25
|
-
export const
|
|
30
|
+
export const WORLD_STATE_CHECKPOINT_HISTORY = 2;
|
|
26
31
|
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
27
32
|
export const ARCHIVER_POLL_INTERVAL = 50;
|
|
28
33
|
export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
@@ -53,10 +58,12 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
53
58
|
static getSlotDurations(opts = {}) {
|
|
54
59
|
const envEthereumSlotDuration = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : DEFAULT_L1_BLOCK_TIME;
|
|
55
60
|
const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
|
|
56
|
-
const aztecSlotDuration = opts.aztecSlotDuration ??
|
|
61
|
+
const aztecSlotDuration = opts.aztecSlotDuration ?? (opts.aztecSlotDurationInL1Slots ?? 2) * ethereumSlotDuration;
|
|
57
62
|
const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
|
|
58
63
|
const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
|
|
64
|
+
const l1PublishingTime = opts.l1PublishingTime ?? 1;
|
|
59
65
|
return {
|
|
66
|
+
l1PublishingTime,
|
|
60
67
|
ethereumSlotDuration,
|
|
61
68
|
aztecSlotDuration,
|
|
62
69
|
aztecEpochDuration,
|
|
@@ -64,18 +71,23 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
64
71
|
};
|
|
65
72
|
}
|
|
66
73
|
async setup(opts = {}) {
|
|
67
|
-
const { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionEpochs } = EpochsTestContext.getSlotDurations(opts);
|
|
74
|
+
const { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionEpochs, l1PublishingTime } = EpochsTestContext.getSlotDurations(opts);
|
|
68
75
|
this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
|
|
69
76
|
this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
|
|
77
|
+
// When skipInitialSequencer is set, auto-create a hardcoded account funded via genesis.
|
|
78
|
+
// This avoids needing to deploy accounts on-chain (which would require a running sequencer).
|
|
79
|
+
const useHardcodedAccount = opts.skipInitialSequencer && !opts.skipHardcodedAccount;
|
|
80
|
+
let hardcodedAccountData;
|
|
81
|
+
if (useHardcodedAccount) {
|
|
82
|
+
hardcodedAccountData = await EpochsTestContext.getHardcodedAccountData(Fr.random(), Fr.random());
|
|
83
|
+
}
|
|
70
84
|
// Set up system without any account nor protocol contracts
|
|
71
85
|
// and with faster block times and shorter epochs.
|
|
72
|
-
const context = await setup(opts.numberOfAccounts ?? 0, {
|
|
86
|
+
const context = await setup(useHardcodedAccount ? 0 : opts.numberOfAccounts ?? 0, {
|
|
73
87
|
automineL1Setup: true,
|
|
74
88
|
checkIntervalMs: 50,
|
|
75
89
|
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
76
90
|
worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
|
|
77
|
-
skipProtocolContracts: true,
|
|
78
|
-
salt: 1,
|
|
79
91
|
aztecEpochDuration,
|
|
80
92
|
aztecSlotDuration,
|
|
81
93
|
ethereumSlotDuration,
|
|
@@ -85,16 +97,29 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
85
97
|
realProofs: false,
|
|
86
98
|
startProverNode: true,
|
|
87
99
|
proverTestDelayMs: opts.proverTestDelayMs ?? 0,
|
|
88
|
-
// We use numeric incremental prover ids for simplicity, but we can switch to
|
|
89
|
-
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
90
|
-
// Use numeric EthAddress for deterministic prover id
|
|
91
100
|
proverId: EthAddress.fromNumber(1),
|
|
92
|
-
|
|
101
|
+
worldStateCheckpointHistory: WORLD_STATE_CHECKPOINT_HISTORY,
|
|
93
102
|
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
94
|
-
|
|
95
|
-
|
|
103
|
+
slasherEnabled: false,
|
|
104
|
+
l1PublishingTime,
|
|
105
|
+
...opts,
|
|
106
|
+
...hardcodedAccountData ? {
|
|
107
|
+
initialFundedAccounts: [
|
|
108
|
+
hardcodedAccountData
|
|
109
|
+
],
|
|
110
|
+
numberOfAccounts: 0
|
|
111
|
+
} : {}
|
|
112
|
+
}, // Use checkpointed chain tip for PXE by default to avoid issues with blocks being dropped due to pruned anchor blocks.
|
|
113
|
+
// Can be overridden via opts.pxeOpts.
|
|
114
|
+
{
|
|
115
|
+
syncChainTip: 'checkpointed',
|
|
116
|
+
...opts.pxeOpts
|
|
96
117
|
});
|
|
97
118
|
this.context = context;
|
|
119
|
+
// Register the hardcoded account in PXE (local only, no on-chain deployment needed).
|
|
120
|
+
if (hardcodedAccountData) {
|
|
121
|
+
await this.registerHardcodedAccount(hardcodedAccountData);
|
|
122
|
+
}
|
|
98
123
|
this.proverNodes = context.proverNode ? [
|
|
99
124
|
context.proverNode
|
|
100
125
|
] : [];
|
|
@@ -109,10 +134,8 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
109
134
|
});
|
|
110
135
|
// Loop that tracks L1 and L2 block numbers and logs whenever there's a new one.
|
|
111
136
|
this.monitor = new ChainMonitor(this.rollup, context.dateProvider, this.logger).start();
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.proverDelayer = context.proverNode ? context.proverNode.publisher.l1TxUtils.delayer : undefined;
|
|
115
|
-
this.sequencerDelayer = context.sequencer ? context.sequencer.sequencer.publisher.l1TxUtils.delayer : undefined;
|
|
137
|
+
this.proverDelayer = context.proverDelayer;
|
|
138
|
+
this.sequencerDelayer = context.sequencerDelayer;
|
|
116
139
|
if (context.proverNode && !this.proverDelayer || context.sequencer && !this.sequencerDelayer) {
|
|
117
140
|
throw new Error(`Could not find prover or sequencer delayer`);
|
|
118
141
|
}
|
|
@@ -124,7 +147,9 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
124
147
|
l1StartBlock: await this.rollup.getL1StartBlock(),
|
|
125
148
|
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
126
149
|
ethereumSlotDuration,
|
|
127
|
-
proofSubmissionEpochs: Number(await this.rollup.getProofSubmissionEpochs())
|
|
150
|
+
proofSubmissionEpochs: Number(await this.rollup.getProofSubmissionEpochs()),
|
|
151
|
+
targetCommitteeSize: await this.rollup.getTargetCommitteeSize(),
|
|
152
|
+
rollupManaLimit: Number(await this.rollup.getManaLimit())
|
|
128
153
|
};
|
|
129
154
|
this.logger.info(`L2 genesis at L1 block ${this.constants.l1StartBlock} (timestamp ${this.constants.l1GenesisTime})`);
|
|
130
155
|
}
|
|
@@ -134,19 +159,64 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
134
159
|
await Promise.all(this.nodes.map((node)=>tryStop(node, this.logger)));
|
|
135
160
|
await this.context.teardown();
|
|
136
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Computes InitialAccountData for a SchnorrHardcodedKeyAccountContract.
|
|
164
|
+
* This contract has a hardcoded signing key and no initializer, so it can be used without
|
|
165
|
+
* on-chain deployment. Pass the returned data in `initialFundedAccounts` so the address
|
|
166
|
+
* gets funded with fee juice in genesis.
|
|
167
|
+
*/ static async getHardcodedAccountData(secret, salt) {
|
|
168
|
+
const contract = new SchnorrHardcodedKeyAccountContract();
|
|
169
|
+
const address = await getAccountContractAddress(contract, secret, salt);
|
|
170
|
+
const signingKey = SCHNORR_HARDCODED_PRIVATE_KEY;
|
|
171
|
+
return {
|
|
172
|
+
secret,
|
|
173
|
+
salt,
|
|
174
|
+
signingKey,
|
|
175
|
+
address
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Registers a SchnorrHardcodedKeyAccountContract in PXE. The account must have been funded
|
|
180
|
+
* at genesis (via getHardcodedAccountData). No on-chain deployment or block mining needed.
|
|
181
|
+
*/ async registerHardcodedAccount(accountData) {
|
|
182
|
+
const contract = new SchnorrHardcodedKeyAccountContract();
|
|
183
|
+
const wallet = this.context.wallet;
|
|
184
|
+
const accountManager = await wallet.createAccount({
|
|
185
|
+
secret: accountData.secret,
|
|
186
|
+
salt: accountData.salt,
|
|
187
|
+
contract
|
|
188
|
+
});
|
|
189
|
+
this.context.accounts = [
|
|
190
|
+
accountManager.address
|
|
191
|
+
];
|
|
192
|
+
return accountManager.address;
|
|
193
|
+
}
|
|
137
194
|
async createProverNode(opts = {}) {
|
|
138
195
|
this.logger.warn('Creating and syncing a simulated prover node...');
|
|
139
196
|
const proverNodePrivateKey = this.getNextPrivateKey();
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
197
|
+
const proverIndex = this.proverNodes.length + 1;
|
|
198
|
+
const { mockGossipSubNetwork } = this.context;
|
|
199
|
+
const { proverNode } = await withLoggerBindings({
|
|
200
|
+
actor: `prover-${proverIndex}`
|
|
201
|
+
}, ()=>createAndSyncProverNode(proverNodePrivateKey, {
|
|
202
|
+
...this.context.config,
|
|
203
|
+
p2pEnabled: this.context.config.p2pEnabled || mockGossipSubNetwork !== undefined,
|
|
204
|
+
proverId: EthAddress.fromNumber(proverIndex),
|
|
146
205
|
dontStart: opts.dontStart,
|
|
147
206
|
...opts
|
|
148
|
-
},
|
|
149
|
-
|
|
207
|
+
}, {
|
|
208
|
+
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex'))
|
|
209
|
+
}, {
|
|
210
|
+
dateProvider: this.context.dateProvider,
|
|
211
|
+
p2pClientDeps: {
|
|
212
|
+
p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined,
|
|
213
|
+
rpcTxProviders: [
|
|
214
|
+
this.context.aztecNode
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
}, {
|
|
218
|
+
genesis: this.context.genesis,
|
|
219
|
+
dontStart: opts.dontStart
|
|
150
220
|
}));
|
|
151
221
|
this.proverNodes.push(proverNode);
|
|
152
222
|
return proverNode;
|
|
@@ -167,7 +237,8 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
167
237
|
});
|
|
168
238
|
}
|
|
169
239
|
async createNode(opts = {}) {
|
|
170
|
-
const
|
|
240
|
+
const nodeIndex = this.nodes.length + 1;
|
|
241
|
+
const actorPrefix = opts.disableValidator ? 'node' : 'validator';
|
|
171
242
|
const { mockGossipSubNetwork } = this.context;
|
|
172
243
|
const resolvedConfig = {
|
|
173
244
|
...this.context.config,
|
|
@@ -175,35 +246,25 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
175
246
|
};
|
|
176
247
|
const p2pEnabled = resolvedConfig.p2pEnabled || mockGossipSubNetwork !== undefined;
|
|
177
248
|
const p2pIp = resolvedConfig.p2pIp ?? (p2pEnabled ? '127.0.0.1' : undefined);
|
|
178
|
-
const node = await
|
|
249
|
+
const node = await withLoggerBindings({
|
|
250
|
+
actor: `${actorPrefix}-${nodeIndex}`
|
|
251
|
+
}, ()=>AztecNodeService.createAndSync({
|
|
179
252
|
...resolvedConfig,
|
|
180
253
|
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex')),
|
|
181
254
|
validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
|
|
255
|
+
nodeId: resolvedConfig.nodeId || `${actorPrefix}-${nodeIndex}`,
|
|
182
256
|
p2pEnabled,
|
|
183
257
|
p2pIp
|
|
184
258
|
}, {
|
|
185
259
|
dateProvider: this.context.dateProvider,
|
|
186
260
|
p2pClientDeps: {
|
|
187
261
|
p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined
|
|
188
|
-
}
|
|
262
|
+
},
|
|
263
|
+
slashingProtectionDb: opts.slashingProtectionDb
|
|
189
264
|
}, {
|
|
190
|
-
|
|
265
|
+
genesis: this.context.genesis,
|
|
191
266
|
...opts
|
|
192
267
|
}));
|
|
193
|
-
// REFACTOR: We're getting too much into the internals of the sequencer here.
|
|
194
|
-
// We should have a single method for constructing an aztec node that returns a TestAztecNodeService
|
|
195
|
-
// which directly exposes the delayer and sets any test config.
|
|
196
|
-
if (opts.txDelayerMaxInclusionTimeIntoSlot !== undefined) {
|
|
197
|
-
this.logger.info(`Setting tx delayer max inclusion time into slot to ${opts.txDelayerMaxInclusionTimeIntoSlot} seconds`);
|
|
198
|
-
// 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.
|
|
199
|
-
// The delayer needs a wallet (a client that can sign), so we have to create one here.
|
|
200
|
-
const l1Client = createExtendedL1Client(resolvedConfig.l1RpcUrls, resolvedConfig.publisherPrivateKeys[0].getValue());
|
|
201
|
-
const sequencer = node.getSequencer();
|
|
202
|
-
const publisher = sequencer.sequencer.publisher;
|
|
203
|
-
const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, this.L1_BLOCK_TIME_IN_S, l1Client);
|
|
204
|
-
delayed.delayer.setMaxInclusionTimeIntoSlot(opts.txDelayerMaxInclusionTimeIntoSlot);
|
|
205
|
-
publisher.l1TxUtils = delayed;
|
|
206
|
-
}
|
|
207
268
|
this.nodes.push(node);
|
|
208
269
|
return node;
|
|
209
270
|
}
|
|
@@ -217,11 +278,11 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
217
278
|
await waitUntilL1Timestamp(this.l1Client, start - BigInt(this.L1_BLOCK_TIME_IN_S), undefined, 30 * this.epochDuration);
|
|
218
279
|
return start;
|
|
219
280
|
}
|
|
220
|
-
/** Waits until the given
|
|
221
|
-
await retryUntil(()=>Promise.resolve(target <= this.monitor.checkpointNumber), `Wait until
|
|
281
|
+
/** Waits until the given checkpoint number is mined. */ async waitUntilCheckpointNumber(target, timeout = 120) {
|
|
282
|
+
await retryUntil(()=>Promise.resolve(target <= this.monitor.checkpointNumber), `Wait until checkpoint ${target}`, timeout, 0.1);
|
|
222
283
|
}
|
|
223
|
-
/** Waits until the given
|
|
224
|
-
await retryUntil(()=>Promise.resolve(
|
|
284
|
+
/** Waits until the given checkpoint number is marked as proven. */ async waitUntilProvenCheckpointNumber(target, timeout = 120) {
|
|
285
|
+
await retryUntil(()=>Promise.resolve(target <= this.monitor.provenCheckpointNumber), `Wait proven checkpoint ${target}`, timeout, 0.1);
|
|
225
286
|
return this.monitor.provenCheckpointNumber;
|
|
226
287
|
}
|
|
227
288
|
/** Waits until the last slot of the proof submission window for a given epoch. */ async waitUntilLastSlotOfProofSubmissionWindow(epochNumber) {
|
|
@@ -231,7 +292,9 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
231
292
|
this.logger.info(`Waiting until last slot of submission window for epoch ${epochNumber} at ${date}`, {
|
|
232
293
|
oneSlotBefore
|
|
233
294
|
});
|
|
234
|
-
|
|
295
|
+
// Use a timeout that accounts for the full proof submission window
|
|
296
|
+
const proofSubmissionWindowDuration = this.constants.proofSubmissionEpochs * this.epochDuration * this.L2_SLOT_DURATION_IN_S;
|
|
297
|
+
await waitUntilL1Timestamp(this.l1Client, oneSlotBefore, undefined, proofSubmissionWindowDuration * 2);
|
|
235
298
|
}
|
|
236
299
|
/** Waits for the aztec node to sync to the target block number. */ async waitForNodeToSync(blockNumber, type) {
|
|
237
300
|
const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
|
|
@@ -249,7 +312,7 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
249
312
|
tips
|
|
250
313
|
});
|
|
251
314
|
if (type === 'proven') {
|
|
252
|
-
synched = tips.proven.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
|
|
315
|
+
synched = tips.proven.block.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
|
|
253
316
|
} else if (type === 'finalized') {
|
|
254
317
|
synched = syncState.finalizedBlockNumber >= blockNumber;
|
|
255
318
|
} else {
|
|
@@ -268,12 +331,25 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
268
331
|
await wallet.registerContract(instance, SpamContract.artifact);
|
|
269
332
|
return SpamContract.at(instance.address, wallet);
|
|
270
333
|
}
|
|
334
|
+
/** Registers the TestContract on the given wallet. */ async registerTestContract(wallet, salt = Fr.ZERO) {
|
|
335
|
+
const instance = await getContractInstanceFromInstantiationParams(TestContract.artifact, {
|
|
336
|
+
constructorArgs: [],
|
|
337
|
+
constructorArtifact: undefined,
|
|
338
|
+
salt,
|
|
339
|
+
publicKeys: undefined,
|
|
340
|
+
deployer: undefined
|
|
341
|
+
});
|
|
342
|
+
await wallet.registerContract(instance, TestContract.artifact);
|
|
343
|
+
return TestContract.at(instance.address, wallet);
|
|
344
|
+
}
|
|
271
345
|
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */ async createL1Client() {
|
|
272
|
-
const
|
|
346
|
+
const rawClient = createExtendedL1Client([
|
|
273
347
|
...this.l1Client.chain.rpcUrls.default.http
|
|
274
|
-
], privateKeyToAccount(this.getNextPrivateKey()), this.l1Client.chain)
|
|
348
|
+
], privateKeyToAccount(this.getNextPrivateKey()), this.l1Client.chain);
|
|
349
|
+
const delayer = createDelayer(this.context.dateProvider, {
|
|
275
350
|
ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S
|
|
276
|
-
});
|
|
351
|
+
}, {});
|
|
352
|
+
const client = wrapClientWithDelayer(rawClient, delayer);
|
|
277
353
|
expect(await client.getBalance({
|
|
278
354
|
address: client.account.address
|
|
279
355
|
})).toBeGreaterThan(0n);
|
|
@@ -291,14 +367,38 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
291
367
|
]).then((_)=>true).catch((_)=>false);
|
|
292
368
|
expect(result).toBe(expectedSuccess);
|
|
293
369
|
}
|
|
370
|
+
/** Verifies at least one checkpoint has the target number of blocks (for MBPS validation). */ async assertMultipleBlocksPerSlot(targetBlockCount) {
|
|
371
|
+
const archiver = this.context.aztecNode.getBlockSource();
|
|
372
|
+
const checkpoints = await archiver.getCheckpoints(CheckpointNumber(1), 50);
|
|
373
|
+
this.logger.warn(`Retrieved ${checkpoints.length} checkpoints from archiver`, {
|
|
374
|
+
checkpoints: checkpoints.map((pc)=>pc.checkpoint.getStats())
|
|
375
|
+
});
|
|
376
|
+
let expectedBlockNumber = checkpoints[0].checkpoint.blocks[0].number;
|
|
377
|
+
let targetFound = false;
|
|
378
|
+
for (const checkpoint of checkpoints){
|
|
379
|
+
const blockCount = checkpoint.checkpoint.blocks.length;
|
|
380
|
+
targetFound = targetFound || blockCount >= targetBlockCount;
|
|
381
|
+
this.logger.verbose(`Checkpoint ${checkpoint.checkpoint.number} has ${blockCount} blocks`, {
|
|
382
|
+
checkpoint: checkpoint.checkpoint.getStats()
|
|
383
|
+
});
|
|
384
|
+
for(let i = 0; i < blockCount; i++){
|
|
385
|
+
const block = checkpoint.checkpoint.blocks[i];
|
|
386
|
+
expect(block.indexWithinCheckpoint).toBe(i);
|
|
387
|
+
expect(block.checkpointNumber).toBe(checkpoint.checkpoint.number);
|
|
388
|
+
expect(block.number).toBe(expectedBlockNumber);
|
|
389
|
+
expectedBlockNumber++;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
expect(targetFound).toBe(true);
|
|
393
|
+
}
|
|
294
394
|
watchSequencerEvents(sequencers, getMetadata = ()=>({})) {
|
|
295
395
|
const stateChanges = [];
|
|
296
396
|
const failEvents = [];
|
|
297
|
-
// Note we do not include the 'tx-count-check-failed' event here, since it is fine if we dont build
|
|
397
|
+
// Note we do not include the 'block-tx-count-check-failed' event here, since it is fine if we dont build
|
|
298
398
|
// due to lack of txs available.
|
|
299
399
|
const failEventsKeys = [
|
|
300
400
|
'block-build-failed',
|
|
301
|
-
'
|
|
401
|
+
'checkpoint-publish-failed',
|
|
302
402
|
'proposer-rollup-check-failed'
|
|
303
403
|
];
|
|
304
404
|
const makeEvent = (i, eventName, args)=>({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
-
import { Fq } from '@aztec/foundation/
|
|
3
|
+
import { Fq } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { sleep } from '@aztec/foundation/sleep';
|
|
5
5
|
import { jest } from '@jest/globals';
|
|
6
6
|
import { FeesTest } from './fees_test.js';
|
|
@@ -16,10 +16,8 @@ describe('e2e_fees bridging_race', ()=>{
|
|
|
16
16
|
minTxsPerBlock: 0
|
|
17
17
|
});
|
|
18
18
|
beforeAll(async ()=>{
|
|
19
|
-
await t.
|
|
20
|
-
|
|
21
|
-
await t.applySetupFeeJuiceSnapshot();
|
|
22
|
-
({ wallet, logger } = await t.setup());
|
|
19
|
+
await t.setup();
|
|
20
|
+
({ wallet, logger } = t);
|
|
23
21
|
});
|
|
24
22
|
afterAll(async ()=>{
|
|
25
23
|
await t.teardown();
|
|
@@ -56,7 +54,7 @@ describe('e2e_fees bridging_race', ()=>{
|
|
|
56
54
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
57
55
|
await t.feeJuiceContract.methods.claim(bobsAddress, claim.claimAmount, secret, index).send({
|
|
58
56
|
from: bobsAddress
|
|
59
|
-
})
|
|
57
|
+
});
|
|
60
58
|
const [balance] = await t.getGasBalanceFn(bobsAddress);
|
|
61
59
|
expect(balance).toEqual(claim.claimAmount);
|
|
62
60
|
});
|
|
@@ -2,8 +2,10 @@ import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
|
2
2
|
import { type Logger } 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 { RollupContract } from '@aztec/ethereum/contracts';
|
|
6
|
+
import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
6
7
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
8
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
7
9
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
10
|
import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription';
|
|
9
11
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
@@ -12,12 +14,13 @@ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
|
12
14
|
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
13
15
|
import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
|
|
14
16
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
15
|
-
import {
|
|
16
|
-
import { type
|
|
17
|
-
import { type BalancesFn
|
|
17
|
+
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
18
|
+
import { type EndToEndContext, type SetupOptions } from '../fixtures/setup.js';
|
|
19
|
+
import { type BalancesFn } from '../fixtures/utils.js';
|
|
18
20
|
import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
|
|
21
|
+
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
19
22
|
/**
|
|
20
|
-
* Test fixture for testing fees. Provides the following
|
|
23
|
+
* Test fixture for testing fees. Provides the following setup steps:
|
|
21
24
|
* InitialAccounts: Initializes 3 Schnorr account contracts.
|
|
22
25
|
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
23
26
|
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
@@ -28,10 +31,12 @@ import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.j
|
|
|
28
31
|
*/
|
|
29
32
|
export declare class FeesTest {
|
|
30
33
|
private numberOfAccounts;
|
|
31
|
-
private
|
|
34
|
+
private setupOptions;
|
|
32
35
|
private accounts;
|
|
36
|
+
context: EndToEndContext;
|
|
33
37
|
logger: Logger;
|
|
34
38
|
aztecNode: AztecNode;
|
|
39
|
+
aztecNodeAdmin: AztecNodeAdmin;
|
|
35
40
|
cheatCodes: CheatCodes;
|
|
36
41
|
wallet: TestWallet;
|
|
37
42
|
aliceAddress: AztecAddress;
|
|
@@ -48,18 +53,17 @@ export declare class FeesTest {
|
|
|
48
53
|
counterContract: CounterContract;
|
|
49
54
|
subscriptionContract: AppSubscriptionContract;
|
|
50
55
|
feeJuiceBridgeTestHarness: GasBridgingTestHarness;
|
|
51
|
-
context: SubsystemsContext;
|
|
52
56
|
chainMonitor: ChainMonitor;
|
|
53
57
|
getCoinbaseBalance: () => Promise<bigint>;
|
|
54
58
|
getCoinbaseSequencerRewards: () => Promise<bigint>;
|
|
55
59
|
getGasBalanceFn: BalancesFn;
|
|
56
60
|
getBananaPublicBalanceFn: BalancesFn;
|
|
57
61
|
getBananaPrivateBalanceFn: BalancesFn;
|
|
58
|
-
getProverFee: (blockNumber:
|
|
62
|
+
getProverFee: (blockNumber: BlockNumber) => Promise<bigint>;
|
|
59
63
|
readonly ALICE_INITIAL_BANANAS: bigint;
|
|
60
64
|
readonly SUBSCRIPTION_AMOUNT: bigint;
|
|
61
65
|
readonly APP_SPONSORED_TX_GAS_LIMIT: bigint;
|
|
62
|
-
constructor(testName: string, numberOfAccounts?: number, setupOptions?: Partial<SetupOptions &
|
|
66
|
+
constructor(testName: string, numberOfAccounts?: number, setupOptions?: Partial<SetupOptions & DeployAztecL1ContractsArgs>);
|
|
63
67
|
setup(): Promise<this>;
|
|
64
68
|
teardown(): Promise<void>;
|
|
65
69
|
setIsMarkingAsProven(b: boolean): void;
|
|
@@ -71,14 +75,14 @@ export declare class FeesTest {
|
|
|
71
75
|
mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress): Promise<void>;
|
|
72
76
|
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */
|
|
73
77
|
mintPrivateBananas(amount: bigint, address: AztecAddress): Promise<void>;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
applyBaseSetup(): Promise<void>;
|
|
79
|
+
applyInitialAccounts(): Promise<void>;
|
|
80
|
+
applyPublicDeployAccounts(): Promise<void>;
|
|
81
|
+
applySetupFeeJuice(): Promise<void>;
|
|
82
|
+
applyDeployBananaToken(): Promise<void>;
|
|
83
|
+
applyFPCSetup(): Promise<void>;
|
|
84
|
+
applySponsoredFPCSetup(): Promise<void>;
|
|
81
85
|
applyFundAliceWithBananas(): Promise<void>;
|
|
82
86
|
applyFundAliceWithPrivateBananas(): Promise<void>;
|
|
83
87
|
}
|
|
84
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
88
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlc190ZXN0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZTJlX2ZlZXMvZmVlc190ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzlELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBZ0IsTUFBTSxxQkFBcUIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN0RCxPQUFPLEVBQUUsVUFBVSxFQUFpQyxNQUFNLHNCQUFzQixDQUF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_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAiC,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KA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