@aztec/end-to-end 0.0.1-commit.42ee6df9b → 0.0.1-commit.431c48d
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 +229 -14
- package/dest/automine/automine_test_context.d.ts +85 -0
- package/dest/automine/automine_test_context.d.ts.map +1 -0
- package/dest/automine/automine_test_context.js +98 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.d.ts +1 -1
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts +48 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts +19 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +141 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.js +23 -36
- package/dest/automine/token/token_contract_test.d.ts +40 -0
- package/dest/automine/token/token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_token_contract → automine/token}/token_contract_test.js +24 -39
- package/dest/automine/token/token_test_helpers.d.ts +73 -0
- package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
- package/dest/automine/token/token_test_helpers.js +97 -0
- package/dest/bench/client_flows/benchmark.d.ts +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +19 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +5 -5
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +45 -29
- package/dest/bench/utils.d.ts +3 -3
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +97 -6
- package/dest/composed/ha/ha_full_setup.d.ts +77 -0
- package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
- package/dest/composed/ha/ha_full_setup.js +383 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.d.ts +1 -1
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
- package/dest/fixtures/authwit_proxy.js +4 -0
- package/dest/fixtures/e2e_prover_test.d.ts +12 -9
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +51 -30
- package/dest/fixtures/fixtures.d.ts +79 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +80 -0
- package/dest/fixtures/ha_setup.d.ts +4 -4
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +5 -2
- 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/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 +37 -0
- package/dest/fixtures/setup.d.ts +81 -42
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +289 -198
- package/dest/fixtures/setup_p2p_test.d.ts +10 -6
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +11 -11
- package/dest/fixtures/standard_contracts_genesis.d.ts +16 -0
- package/dest/fixtures/standard_contracts_genesis.d.ts.map +1 -0
- package/dest/fixtures/standard_contracts_genesis.js +25 -0
- package/dest/fixtures/timing.d.ts +42 -0
- package/dest/fixtures/timing.d.ts.map +1 -0
- package/dest/fixtures/timing.js +72 -0
- package/dest/fixtures/token_utils.d.ts +22 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +21 -1
- package/dest/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- package/dest/fixtures/wait_helpers.d.ts +135 -0
- package/dest/fixtures/wait_helpers.d.ts.map +1 -0
- package/dest/fixtures/wait_helpers.js +154 -0
- 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/install_legacy_contracts.d.cts +13 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/multi-node/block-production/setup.d.ts +97 -0
- package/dest/multi-node/block-production/setup.d.ts.map +1 -0
- package/dest/multi-node/block-production/setup.js +158 -0
- package/dest/multi-node/governance/setup.d.ts +67 -0
- package/dest/multi-node/governance/setup.d.ts.map +1 -0
- package/dest/multi-node/governance/setup.js +126 -0
- package/dest/multi-node/multi_node_test_context.d.ts +212 -0
- package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
- package/dest/multi-node/multi_node_test_context.js +347 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/inactivity_setup.js +111 -0
- package/dest/multi-node/slashing/setup.d.ts +167 -0
- package/dest/multi-node/slashing/setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/setup.js +275 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +19 -10
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.js +82 -38
- package/dest/p2p/reqresp/utils.d.ts +19 -0
- package/dest/p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/reqresp/utils.js +32 -29
- package/dest/p2p/shared.d.ts +72 -0
- package/dest/p2p/shared.d.ts.map +1 -0
- package/dest/p2p/shared.js +212 -0
- package/dest/shared/cross_chain_test_harness.d.ts +6 -4
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +33 -21
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +24 -12
- package/dest/shared/submit-transactions.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +12 -5
- package/dest/shared/timing_env.d.js +5 -0
- package/dest/shared/timing_env.js +365 -0
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +50 -37
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +24 -12
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
- package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
- package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +17 -4
- package/dest/single-node/fees/fees_test.d.ts +95 -0
- package/dest/single-node/fees/fees_test.d.ts.map +1 -0
- package/dest/single-node/fees/fees_test.js +347 -0
- package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
- package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
- package/dest/single-node/l1-reorgs/setup.js +57 -0
- package/dest/single-node/partial-proofs/setup.d.ts +5 -0
- package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
- package/dest/single-node/partial-proofs/setup.js +5 -0
- package/dest/single-node/proving/setup.d.ts +5 -0
- package/dest/single-node/proving/setup.d.ts.map +1 -0
- package/dest/single-node/proving/setup.js +5 -0
- package/dest/single-node/recovery/setup.d.ts +5 -0
- package/dest/single-node/recovery/setup.d.ts.map +1 -0
- package/dest/single-node/recovery/setup.js +5 -0
- package/dest/single-node/setup.d.ts +49 -0
- package/dest/single-node/setup.d.ts.map +1 -0
- package/dest/single-node/setup.js +56 -0
- package/dest/single-node/single_node_test_context.d.ts +374 -0
- package/dest/single-node/single_node_test_context.d.ts.map +1 -0
- package/dest/single-node/single_node_test_context.js +847 -0
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +31 -46
- package/dest/spartan/tx_metrics.d.ts +27 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +105 -20
- package/dest/spartan/utils/config.d.ts +9 -35
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/gossip_metrics.d.ts +9 -0
- package/dest/spartan/utils/gossip_metrics.d.ts.map +1 -0
- package/dest/spartan/utils/gossip_metrics.js +77 -0
- package/dest/spartan/utils/index.d.ts +2 -1
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +2 -0
- package/dest/spartan/utils/nodes.js +2 -2
- package/dest/test-wallet/test_wallet.d.ts +39 -10
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +166 -59
- package/dest/test-wallet/utils.d.ts +38 -3
- package/dest/test-wallet/utils.d.ts.map +1 -1
- package/dest/test-wallet/utils.js +65 -10
- package/dest/test-wallet/wallet_worker_script.js +12 -4
- package/dest/test-wallet/worker_wallet.d.ts +9 -8
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet.js +10 -4
- package/dest/test-wallet/worker_wallet_schema.d.ts +3 -273
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.js +15 -2
- package/package.json +48 -43
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -0
- package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +213 -0
- package/src/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +24 -47
- package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +25 -48
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +21 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +77 -56
- package/src/bench/utils.ts +110 -6
- package/src/composed/ha/ha_full_setup.ts +466 -0
- package/src/fixtures/authwit_proxy.ts +4 -0
- package/src/fixtures/e2e_prover_test.ts +66 -48
- package/src/fixtures/fixtures.ts +100 -0
- package/src/fixtures/ha_setup.ts +11 -5
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +361 -256
- package/src/fixtures/setup_p2p_test.ts +15 -11
- package/src/fixtures/standard_contracts_genesis.ts +28 -0
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +39 -4
- package/src/fixtures/utils.ts +2 -3
- package/src/fixtures/wait_helpers.ts +333 -0
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +106 -0
- package/src/guides/up_quick_start.sh +5 -2
- package/src/infra/README.md +12 -0
- package/src/install_legacy_contracts.cjs +81 -0
- package/src/legacy-jest-resolver.cjs +98 -0
- package/src/multi-node/README.md +96 -0
- package/src/multi-node/block-production/setup.ts +272 -0
- package/src/multi-node/governance/setup.ts +172 -0
- package/src/multi-node/multi_node_test_context.ts +447 -0
- package/src/multi-node/slashing/inactivity_setup.ts +139 -0
- package/src/multi-node/slashing/setup.ts +433 -0
- package/src/p2p/README.md +78 -0
- package/src/{e2e_p2p → p2p}/p2p_network.ts +95 -50
- package/src/{e2e_p2p → p2p}/reqresp/utils.ts +35 -28
- package/src/p2p/shared.ts +329 -0
- package/src/shared/cross_chain_test_harness.ts +36 -17
- package/src/shared/gas_portal_test_harness.ts +32 -14
- package/src/shared/submit-transactions.ts +13 -5
- package/src/shared/timing_env.d.mts +39 -0
- package/src/shared/timing_env.mjs +363 -0
- package/src/shared/uniswap_l1_l2.ts +80 -43
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +28 -14
- package/src/single-node/README.md +66 -0
- package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
- package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
- package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +19 -5
- package/src/{e2e_fees → single-node/fees}/fees_test.ts +176 -70
- package/src/single-node/l1-reorgs/setup.ts +93 -0
- package/src/single-node/partial-proofs/setup.ts +8 -0
- package/src/single-node/proving/setup.ts +15 -0
- package/src/single-node/recovery/setup.ts +8 -0
- package/src/single-node/setup.ts +63 -0
- package/src/single-node/single_node_test_context.ts +1058 -0
- package/src/spartan/setup_test_wallets.ts +32 -41
- package/src/spartan/tx_metrics.ts +107 -23
- package/src/spartan/utils/gossip_metrics.ts +108 -0
- package/src/spartan/utils/index.ts +3 -0
- package/src/spartan/utils/nodes.ts +2 -2
- package/src/test-wallet/test_wallet.ts +185 -60
- package/src/test-wallet/utils.ts +104 -11
- package/src/test-wallet/wallet_worker_script.ts +11 -5
- package/src/test-wallet/worker_wallet.ts +19 -16
- package/src/test-wallet/worker_wallet_schema.ts +4 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -55
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -47
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -129
- package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -37
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
- package/dest/e2e_deploy_contract/deploy_test.js +0 -50
- package/dest/e2e_epochs/epochs_test.d.ts +0 -104
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -389
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -88
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.js +0 -255
- package/dest/e2e_l1_publisher/write_json.d.ts +0 -11
- package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.js +0 -56
- package/dest/e2e_multi_validator/utils.d.ts +0 -12
- package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -26
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +0 -54
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +0 -136
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/reqresp/utils.d.ts +0 -22
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.d.ts +0 -66
- package/dest/e2e_p2p/shared.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.js +0 -212
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +0 -2
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +0 -1
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +0 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +0 -44
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -193
- package/src/e2e_deploy_contract/deploy_test.ts +0 -85
- package/src/e2e_epochs/epochs_test.ts +0 -499
- package/src/e2e_l1_publisher/write_json.ts +0 -77
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -75
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -179
- package/src/e2e_p2p/shared.ts +0 -343
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.js +0 -0
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.js +0 -0
- /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof.json +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.ts +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.ts +0 -0
- /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
import { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
-
import { getTimestampRangeForEpoch } from '@aztec/aztec.js/block';
|
|
3
|
-
import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
4
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
|
-
import { MerkleTreeId } from '@aztec/aztec.js/trees';
|
|
6
|
-
import { EpochCache } from '@aztec/epoch-cache';
|
|
7
|
-
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
8
|
-
import { DefaultL1ContractsConfig } from '@aztec/ethereum/config';
|
|
9
|
-
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
10
|
-
import { createDelayer, waitUntilL1Timestamp, wrapClientWithDelayer } from '@aztec/ethereum/l1-tx-utils';
|
|
11
|
-
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
12
|
-
import { CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
13
|
-
import { SecretValue } from '@aztec/foundation/config';
|
|
14
|
-
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
15
|
-
import { withLoggerBindings } from '@aztec/foundation/log/server';
|
|
16
|
-
import { retryUntil } from '@aztec/foundation/retry';
|
|
17
|
-
import { sleep } from '@aztec/foundation/sleep';
|
|
18
|
-
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
19
|
-
import { TestContract } from '@aztec/noir-test-contracts.js/Test';
|
|
20
|
-
import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
21
|
-
import { SequencerState } from '@aztec/sequencer-client';
|
|
22
|
-
import { EthAddress } from '@aztec/stdlib/block';
|
|
23
|
-
import { getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
24
|
-
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
25
|
-
import { join } from 'path';
|
|
26
|
-
import { privateKeyToAccount } from 'viem/accounts';
|
|
27
|
-
import { createAndSyncProverNode, getPrivateKeyFromIndex, setup } from '../fixtures/utils.js';
|
|
28
|
-
export const WORLD_STATE_CHECKPOINT_HISTORY = 2;
|
|
29
|
-
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
30
|
-
export const ARCHIVER_POLL_INTERVAL = 50;
|
|
31
|
-
export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
32
|
-
/**
|
|
33
|
-
* Tests building of epochs using fast block times and short epochs.
|
|
34
|
-
* Spawns an aztec node and a prover node with fake proofs.
|
|
35
|
-
* Sequencer is allowed to build empty blocks.
|
|
36
|
-
*/ export class EpochsTestContext {
|
|
37
|
-
context;
|
|
38
|
-
l1Client;
|
|
39
|
-
rollup;
|
|
40
|
-
constants;
|
|
41
|
-
logger;
|
|
42
|
-
monitor;
|
|
43
|
-
epochCache;
|
|
44
|
-
proverDelayer;
|
|
45
|
-
sequencerDelayer;
|
|
46
|
-
proverNodes = [];
|
|
47
|
-
nodes = [];
|
|
48
|
-
epochDuration;
|
|
49
|
-
L1_BLOCK_TIME_IN_S;
|
|
50
|
-
L2_SLOT_DURATION_IN_S;
|
|
51
|
-
static async setup(opts = {}) {
|
|
52
|
-
const test = new EpochsTestContext();
|
|
53
|
-
await test.setup(opts);
|
|
54
|
-
return test;
|
|
55
|
-
}
|
|
56
|
-
static getSlotDurations(opts = {}) {
|
|
57
|
-
const envEthereumSlotDuration = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : DEFAULT_L1_BLOCK_TIME;
|
|
58
|
-
const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
|
|
59
|
-
const aztecSlotDuration = opts.aztecSlotDuration ?? (opts.aztecSlotDurationInL1Slots ?? 2) * ethereumSlotDuration;
|
|
60
|
-
const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
|
|
61
|
-
const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
|
|
62
|
-
const l1PublishingTime = opts.l1PublishingTime ?? 1;
|
|
63
|
-
return {
|
|
64
|
-
l1PublishingTime,
|
|
65
|
-
ethereumSlotDuration,
|
|
66
|
-
aztecSlotDuration,
|
|
67
|
-
aztecEpochDuration,
|
|
68
|
-
aztecProofSubmissionEpochs
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
async setup(opts = {}) {
|
|
72
|
-
const { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionEpochs, l1PublishingTime } = EpochsTestContext.getSlotDurations(opts);
|
|
73
|
-
this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
|
|
74
|
-
this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
|
|
75
|
-
// Set up system without any account nor protocol contracts
|
|
76
|
-
// and with faster block times and shorter epochs.
|
|
77
|
-
const context = await setup(opts.numberOfAccounts ?? 0, {
|
|
78
|
-
automineL1Setup: true,
|
|
79
|
-
checkIntervalMs: 50,
|
|
80
|
-
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
81
|
-
worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
|
|
82
|
-
aztecEpochDuration,
|
|
83
|
-
aztecSlotDuration,
|
|
84
|
-
ethereumSlotDuration,
|
|
85
|
-
aztecProofSubmissionEpochs,
|
|
86
|
-
aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
|
|
87
|
-
minTxsPerBlock: 0,
|
|
88
|
-
realProofs: false,
|
|
89
|
-
startProverNode: true,
|
|
90
|
-
proverTestDelayMs: opts.proverTestDelayMs ?? 0,
|
|
91
|
-
// We use numeric incremental prover ids for simplicity, but we can switch to
|
|
92
|
-
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
93
|
-
// Use numeric EthAddress for deterministic prover id
|
|
94
|
-
proverId: EthAddress.fromNumber(1),
|
|
95
|
-
worldStateCheckpointHistory: WORLD_STATE_CHECKPOINT_HISTORY,
|
|
96
|
-
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
97
|
-
slasherFlavor: 'none',
|
|
98
|
-
l1PublishingTime,
|
|
99
|
-
...opts
|
|
100
|
-
}, // Use checkpointed chain tip for PXE by default to avoid issues with blocks being dropped due to pruned anchor blocks.
|
|
101
|
-
// Can be overridden via opts.pxeOpts.
|
|
102
|
-
{
|
|
103
|
-
syncChainTip: 'checkpointed',
|
|
104
|
-
...opts.pxeOpts
|
|
105
|
-
});
|
|
106
|
-
this.context = context;
|
|
107
|
-
this.proverNodes = context.proverNode ? [
|
|
108
|
-
context.proverNode
|
|
109
|
-
] : [];
|
|
110
|
-
this.nodes = context.aztecNode ? [
|
|
111
|
-
context.aztecNode
|
|
112
|
-
] : [];
|
|
113
|
-
this.logger = context.logger;
|
|
114
|
-
this.l1Client = context.deployL1ContractsValues.l1Client;
|
|
115
|
-
this.rollup = RollupContract.getFromConfig(context.config);
|
|
116
|
-
this.epochCache = await EpochCache.create(this.rollup, context.config, {
|
|
117
|
-
dateProvider: context.dateProvider
|
|
118
|
-
});
|
|
119
|
-
// Loop that tracks L1 and L2 block numbers and logs whenever there's a new one.
|
|
120
|
-
this.monitor = new ChainMonitor(this.rollup, context.dateProvider, this.logger).start();
|
|
121
|
-
this.proverDelayer = context.proverDelayer;
|
|
122
|
-
this.sequencerDelayer = context.sequencerDelayer;
|
|
123
|
-
if (context.proverNode && !this.proverDelayer || context.sequencer && !this.sequencerDelayer) {
|
|
124
|
-
throw new Error(`Could not find prover or sequencer delayer`);
|
|
125
|
-
}
|
|
126
|
-
// Constants used for time calculation
|
|
127
|
-
this.epochDuration = aztecEpochDuration;
|
|
128
|
-
this.constants = {
|
|
129
|
-
epochDuration: aztecEpochDuration,
|
|
130
|
-
slotDuration: aztecSlotDuration,
|
|
131
|
-
l1StartBlock: await this.rollup.getL1StartBlock(),
|
|
132
|
-
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
133
|
-
ethereumSlotDuration,
|
|
134
|
-
proofSubmissionEpochs: Number(await this.rollup.getProofSubmissionEpochs()),
|
|
135
|
-
targetCommitteeSize: await this.rollup.getTargetCommitteeSize(),
|
|
136
|
-
rollupManaLimit: Number(await this.rollup.getManaLimit())
|
|
137
|
-
};
|
|
138
|
-
this.logger.info(`L2 genesis at L1 block ${this.constants.l1StartBlock} (timestamp ${this.constants.l1GenesisTime})`);
|
|
139
|
-
}
|
|
140
|
-
async teardown() {
|
|
141
|
-
await this.monitor.stop();
|
|
142
|
-
await Promise.all(this.proverNodes.map((node)=>tryStop(node, this.logger)));
|
|
143
|
-
await Promise.all(this.nodes.map((node)=>tryStop(node, this.logger)));
|
|
144
|
-
await this.context.teardown();
|
|
145
|
-
}
|
|
146
|
-
async createProverNode(opts = {}) {
|
|
147
|
-
this.logger.warn('Creating and syncing a simulated prover node...');
|
|
148
|
-
const proverNodePrivateKey = this.getNextPrivateKey();
|
|
149
|
-
const proverIndex = this.proverNodes.length + 1;
|
|
150
|
-
const { mockGossipSubNetwork } = this.context;
|
|
151
|
-
const { proverNode } = await withLoggerBindings({
|
|
152
|
-
actor: `prover-${proverIndex}`
|
|
153
|
-
}, ()=>createAndSyncProverNode(proverNodePrivateKey, {
|
|
154
|
-
...this.context.config,
|
|
155
|
-
p2pEnabled: this.context.config.p2pEnabled || mockGossipSubNetwork !== undefined,
|
|
156
|
-
proverId: EthAddress.fromNumber(proverIndex),
|
|
157
|
-
dontStart: opts.dontStart,
|
|
158
|
-
...opts
|
|
159
|
-
}, {
|
|
160
|
-
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex'))
|
|
161
|
-
}, {
|
|
162
|
-
dateProvider: this.context.dateProvider,
|
|
163
|
-
p2pClientDeps: {
|
|
164
|
-
p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined,
|
|
165
|
-
rpcTxProviders: [
|
|
166
|
-
this.context.aztecNode
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
}, {
|
|
170
|
-
prefilledPublicData: this.context.prefilledPublicData ?? [],
|
|
171
|
-
dontStart: opts.dontStart
|
|
172
|
-
}));
|
|
173
|
-
this.proverNodes.push(proverNode);
|
|
174
|
-
return proverNode;
|
|
175
|
-
}
|
|
176
|
-
createNonValidatorNode(opts = {}) {
|
|
177
|
-
this.logger.warn('Creating and syncing a node without a validator...');
|
|
178
|
-
return this.createNode({
|
|
179
|
-
...opts,
|
|
180
|
-
disableValidator: true
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
createValidatorNode(privateKeys, opts = {}) {
|
|
184
|
-
this.logger.warn('Creating and syncing a validator node...');
|
|
185
|
-
return this.createNode({
|
|
186
|
-
...opts,
|
|
187
|
-
disableValidator: false,
|
|
188
|
-
validatorPrivateKeys: new SecretValue(privateKeys)
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
async createNode(opts = {}) {
|
|
192
|
-
const nodeIndex = this.nodes.length + 1;
|
|
193
|
-
const actorPrefix = opts.disableValidator ? 'node' : 'validator';
|
|
194
|
-
const { mockGossipSubNetwork } = this.context;
|
|
195
|
-
const resolvedConfig = {
|
|
196
|
-
...this.context.config,
|
|
197
|
-
...opts
|
|
198
|
-
};
|
|
199
|
-
const p2pEnabled = resolvedConfig.p2pEnabled || mockGossipSubNetwork !== undefined;
|
|
200
|
-
const p2pIp = resolvedConfig.p2pIp ?? (p2pEnabled ? '127.0.0.1' : undefined);
|
|
201
|
-
const node = await withLoggerBindings({
|
|
202
|
-
actor: `${actorPrefix}-${nodeIndex}`
|
|
203
|
-
}, ()=>AztecNodeService.createAndSync({
|
|
204
|
-
...resolvedConfig,
|
|
205
|
-
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex')),
|
|
206
|
-
validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
|
|
207
|
-
nodeId: resolvedConfig.nodeId || `${actorPrefix}-${nodeIndex}`,
|
|
208
|
-
p2pEnabled,
|
|
209
|
-
p2pIp
|
|
210
|
-
}, {
|
|
211
|
-
dateProvider: this.context.dateProvider,
|
|
212
|
-
p2pClientDeps: {
|
|
213
|
-
p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined
|
|
214
|
-
},
|
|
215
|
-
slashingProtectionDb: opts.slashingProtectionDb
|
|
216
|
-
}, {
|
|
217
|
-
prefilledPublicData: this.context.prefilledPublicData,
|
|
218
|
-
...opts
|
|
219
|
-
}));
|
|
220
|
-
this.nodes.push(node);
|
|
221
|
-
return node;
|
|
222
|
-
}
|
|
223
|
-
getNextPrivateKey() {
|
|
224
|
-
const key = getPrivateKeyFromIndex(this.nodes.length + this.proverNodes.length + 1);
|
|
225
|
-
return `0x${key.toString('hex')}`;
|
|
226
|
-
}
|
|
227
|
-
/** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */ async waitUntilEpochStarts(epoch) {
|
|
228
|
-
const [start] = getTimestampRangeForEpoch(EpochNumber(epoch), this.constants);
|
|
229
|
-
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
230
|
-
await waitUntilL1Timestamp(this.l1Client, start - BigInt(this.L1_BLOCK_TIME_IN_S), undefined, 30 * this.epochDuration);
|
|
231
|
-
return start;
|
|
232
|
-
}
|
|
233
|
-
/** Waits until the given checkpoint number is mined. */ async waitUntilCheckpointNumber(target, timeout = 120) {
|
|
234
|
-
await retryUntil(()=>Promise.resolve(target <= this.monitor.checkpointNumber), `Wait until checkpoint ${target}`, timeout, 0.1);
|
|
235
|
-
}
|
|
236
|
-
/** Waits until the given checkpoint number is marked as proven. */ async waitUntilProvenCheckpointNumber(target, timeout = 120) {
|
|
237
|
-
await retryUntil(()=>Promise.resolve(target <= this.monitor.provenCheckpointNumber), `Wait proven checkpoint ${target}`, timeout, 0.1);
|
|
238
|
-
return this.monitor.provenCheckpointNumber;
|
|
239
|
-
}
|
|
240
|
-
/** Waits until the last slot of the proof submission window for a given epoch. */ async waitUntilLastSlotOfProofSubmissionWindow(epochNumber) {
|
|
241
|
-
const deadline = getProofSubmissionDeadlineTimestamp(EpochNumber.fromBigInt(BigInt(epochNumber)), this.constants);
|
|
242
|
-
const oneSlotBefore = deadline - BigInt(this.constants.slotDuration);
|
|
243
|
-
const date = new Date(Number(oneSlotBefore) * 1000);
|
|
244
|
-
this.logger.info(`Waiting until last slot of submission window for epoch ${epochNumber} at ${date}`, {
|
|
245
|
-
oneSlotBefore
|
|
246
|
-
});
|
|
247
|
-
// Use a timeout that accounts for the full proof submission window
|
|
248
|
-
const proofSubmissionWindowDuration = this.constants.proofSubmissionEpochs * this.epochDuration * this.L2_SLOT_DURATION_IN_S;
|
|
249
|
-
await waitUntilL1Timestamp(this.l1Client, oneSlotBefore, undefined, proofSubmissionWindowDuration * 2);
|
|
250
|
-
}
|
|
251
|
-
/** Waits for the aztec node to sync to the target block number. */ async waitForNodeToSync(blockNumber, type) {
|
|
252
|
-
const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
|
|
253
|
-
let synched = false;
|
|
254
|
-
while(!synched){
|
|
255
|
-
await sleep(waitTime);
|
|
256
|
-
const [syncState, tips] = await Promise.all([
|
|
257
|
-
this.context.aztecNode.getWorldStateSyncStatus(),
|
|
258
|
-
await this.context.aztecNode.getL2Tips()
|
|
259
|
-
]);
|
|
260
|
-
this.logger.info(`Wait for node synch ${blockNumber} ${type}`, {
|
|
261
|
-
blockNumber,
|
|
262
|
-
type,
|
|
263
|
-
syncState,
|
|
264
|
-
tips
|
|
265
|
-
});
|
|
266
|
-
if (type === 'proven') {
|
|
267
|
-
synched = tips.proven.block.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
|
|
268
|
-
} else if (type === 'finalized') {
|
|
269
|
-
synched = syncState.finalizedBlockNumber >= blockNumber;
|
|
270
|
-
} else {
|
|
271
|
-
synched = syncState.oldestHistoricBlockNumber >= blockNumber;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
/** Registers the SpamContract on the given wallet. */ async registerSpamContract(wallet, salt = Fr.ZERO) {
|
|
276
|
-
const instance = await getContractInstanceFromInstantiationParams(SpamContract.artifact, {
|
|
277
|
-
constructorArgs: [],
|
|
278
|
-
constructorArtifact: undefined,
|
|
279
|
-
salt,
|
|
280
|
-
publicKeys: undefined,
|
|
281
|
-
deployer: undefined
|
|
282
|
-
});
|
|
283
|
-
await wallet.registerContract(instance, SpamContract.artifact);
|
|
284
|
-
return SpamContract.at(instance.address, wallet);
|
|
285
|
-
}
|
|
286
|
-
/** Registers the TestContract on the given wallet. */ async registerTestContract(wallet, salt = Fr.ZERO) {
|
|
287
|
-
const instance = await getContractInstanceFromInstantiationParams(TestContract.artifact, {
|
|
288
|
-
constructorArgs: [],
|
|
289
|
-
constructorArtifact: undefined,
|
|
290
|
-
salt,
|
|
291
|
-
publicKeys: undefined,
|
|
292
|
-
deployer: undefined
|
|
293
|
-
});
|
|
294
|
-
await wallet.registerContract(instance, TestContract.artifact);
|
|
295
|
-
return TestContract.at(instance.address, wallet);
|
|
296
|
-
}
|
|
297
|
-
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */ async createL1Client() {
|
|
298
|
-
const rawClient = createExtendedL1Client([
|
|
299
|
-
...this.l1Client.chain.rpcUrls.default.http
|
|
300
|
-
], privateKeyToAccount(this.getNextPrivateKey()), this.l1Client.chain);
|
|
301
|
-
const delayer = createDelayer(this.context.dateProvider, {
|
|
302
|
-
ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S
|
|
303
|
-
}, {});
|
|
304
|
-
const client = wrapClientWithDelayer(rawClient, delayer);
|
|
305
|
-
expect(await client.getBalance({
|
|
306
|
-
address: client.account.address
|
|
307
|
-
})).toBeGreaterThan(0n);
|
|
308
|
-
return {
|
|
309
|
-
client,
|
|
310
|
-
delayer
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
/** Verifies whether the given block number is found on the aztec node. */ async verifyHistoricBlock(blockNumber, expectedSuccess) {
|
|
314
|
-
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
315
|
-
// at a particular block, so we know whether that historic block is available or has been
|
|
316
|
-
// pruned. Note that `getBlock` would not work here, since it only hits the archiver.
|
|
317
|
-
const result = await this.context.aztecNode.findLeavesIndexes(blockNumber, MerkleTreeId.NULLIFIER_TREE, [
|
|
318
|
-
Fr.ZERO
|
|
319
|
-
]).then((_)=>true).catch((_)=>false);
|
|
320
|
-
expect(result).toBe(expectedSuccess);
|
|
321
|
-
}
|
|
322
|
-
/** Verifies at least one checkpoint has the target number of blocks (for MBPS validation). */ async assertMultipleBlocksPerSlot(targetBlockCount) {
|
|
323
|
-
const archiver = this.context.aztecNode.getBlockSource();
|
|
324
|
-
const checkpoints = await archiver.getCheckpoints(CheckpointNumber(1), 50);
|
|
325
|
-
this.logger.warn(`Retrieved ${checkpoints.length} checkpoints from archiver`, {
|
|
326
|
-
checkpoints: checkpoints.map((pc)=>pc.checkpoint.getStats())
|
|
327
|
-
});
|
|
328
|
-
let expectedBlockNumber = checkpoints[0].checkpoint.blocks[0].number;
|
|
329
|
-
let targetFound = false;
|
|
330
|
-
for (const checkpoint of checkpoints){
|
|
331
|
-
const blockCount = checkpoint.checkpoint.blocks.length;
|
|
332
|
-
targetFound = targetFound || blockCount >= targetBlockCount;
|
|
333
|
-
this.logger.verbose(`Checkpoint ${checkpoint.checkpoint.number} has ${blockCount} blocks`, {
|
|
334
|
-
checkpoint: checkpoint.checkpoint.getStats()
|
|
335
|
-
});
|
|
336
|
-
for(let i = 0; i < blockCount; i++){
|
|
337
|
-
const block = checkpoint.checkpoint.blocks[i];
|
|
338
|
-
expect(block.indexWithinCheckpoint).toBe(i);
|
|
339
|
-
expect(block.checkpointNumber).toBe(checkpoint.checkpoint.number);
|
|
340
|
-
expect(block.number).toBe(expectedBlockNumber);
|
|
341
|
-
expectedBlockNumber++;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
expect(targetFound).toBe(true);
|
|
345
|
-
}
|
|
346
|
-
watchSequencerEvents(sequencers, getMetadata = ()=>({})) {
|
|
347
|
-
const stateChanges = [];
|
|
348
|
-
const failEvents = [];
|
|
349
|
-
// Note we do not include the 'block-tx-count-check-failed' event here, since it is fine if we dont build
|
|
350
|
-
// due to lack of txs available.
|
|
351
|
-
const failEventsKeys = [
|
|
352
|
-
'block-build-failed',
|
|
353
|
-
'checkpoint-publish-failed',
|
|
354
|
-
'proposer-rollup-check-failed'
|
|
355
|
-
];
|
|
356
|
-
const makeEvent = (i, eventName, args)=>({
|
|
357
|
-
...args,
|
|
358
|
-
type: eventName,
|
|
359
|
-
sequencerIndex: i + 2,
|
|
360
|
-
...getMetadata(i)
|
|
361
|
-
});
|
|
362
|
-
sequencers.forEach((sequencer, i)=>{
|
|
363
|
-
const sequencerIndex = i + 2;
|
|
364
|
-
sequencer.getSequencer().on('state-changed', (args)=>{
|
|
365
|
-
const noisyStates = [
|
|
366
|
-
SequencerState.IDLE,
|
|
367
|
-
SequencerState.PROPOSER_CHECK,
|
|
368
|
-
SequencerState.SYNCHRONIZING
|
|
369
|
-
];
|
|
370
|
-
if (!noisyStates.includes(args.newState)) {
|
|
371
|
-
const evt = makeEvent(i, 'state-changed', args);
|
|
372
|
-
stateChanges.push(evt);
|
|
373
|
-
this.logger.verbose(`Sequencer ${sequencerIndex} transitioned from state ${args.oldState} to state ${args.newState}`, evt);
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
failEventsKeys.forEach((eventName)=>{
|
|
377
|
-
sequencer.getSequencer().on(eventName, (args)=>{
|
|
378
|
-
const evt = makeEvent(i, eventName, args);
|
|
379
|
-
failEvents.push(evt);
|
|
380
|
-
this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, undefined, evt);
|
|
381
|
-
});
|
|
382
|
-
});
|
|
383
|
-
});
|
|
384
|
-
return {
|
|
385
|
-
failEvents,
|
|
386
|
-
stateChanges
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridging_race.notest.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/bridging_race.notest.ts"],"names":[],"mappings":""}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { type Logger } from '@aztec/aztec.js/log';
|
|
3
|
-
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
4
|
-
import { CheatCodes } from '@aztec/aztec/testing';
|
|
5
|
-
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
6
|
-
import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
7
|
-
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
8
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
9
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
10
|
-
import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription';
|
|
11
|
-
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
12
|
-
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
13
|
-
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
14
|
-
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
15
|
-
import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
|
|
16
|
-
import { GasSettings } from '@aztec/stdlib/gas';
|
|
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';
|
|
20
|
-
import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
|
|
21
|
-
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
22
|
-
/**
|
|
23
|
-
* Test fixture for testing fees. Provides the following setup steps:
|
|
24
|
-
* InitialAccounts: Initializes 3 Schnorr account contracts.
|
|
25
|
-
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
26
|
-
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
27
|
-
* FPCSetup: Deploys BananaCoin and FPC contracts, and bridges gas from L1.
|
|
28
|
-
* SponsoredFPCSetup: Deploys Sponsored FPC contract, and bridges gas from L1.
|
|
29
|
-
* FundAlice: Mints private and public bananas to Alice.
|
|
30
|
-
* SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
|
|
31
|
-
*/
|
|
32
|
-
export declare class FeesTest {
|
|
33
|
-
private numberOfAccounts;
|
|
34
|
-
private setupOptions;
|
|
35
|
-
private accounts;
|
|
36
|
-
context: EndToEndContext;
|
|
37
|
-
logger: Logger;
|
|
38
|
-
aztecNode: AztecNode;
|
|
39
|
-
aztecNodeAdmin: AztecNodeAdmin;
|
|
40
|
-
cheatCodes: CheatCodes;
|
|
41
|
-
wallet: TestWallet;
|
|
42
|
-
aliceAddress: AztecAddress;
|
|
43
|
-
bobAddress: AztecAddress;
|
|
44
|
-
sequencerAddress: AztecAddress;
|
|
45
|
-
coinbase: EthAddress;
|
|
46
|
-
fpcAdmin: AztecAddress;
|
|
47
|
-
gasSettings: GasSettings;
|
|
48
|
-
rollupContract: RollupContract;
|
|
49
|
-
feeJuiceContract: FeeJuiceContract;
|
|
50
|
-
bananaCoin: BananaCoin;
|
|
51
|
-
bananaFPC: FPCContract;
|
|
52
|
-
sponsoredFPC: SponsoredFPCContract;
|
|
53
|
-
counterContract: CounterContract;
|
|
54
|
-
subscriptionContract: AppSubscriptionContract;
|
|
55
|
-
feeJuiceBridgeTestHarness: GasBridgingTestHarness;
|
|
56
|
-
chainMonitor: ChainMonitor;
|
|
57
|
-
getCoinbaseBalance: () => Promise<bigint>;
|
|
58
|
-
getCoinbaseSequencerRewards: () => Promise<bigint>;
|
|
59
|
-
getGasBalanceFn: BalancesFn;
|
|
60
|
-
getBananaPublicBalanceFn: BalancesFn;
|
|
61
|
-
getBananaPrivateBalanceFn: BalancesFn;
|
|
62
|
-
getProverFee: (blockNumber: BlockNumber) => Promise<bigint>;
|
|
63
|
-
readonly ALICE_INITIAL_BANANAS: bigint;
|
|
64
|
-
readonly SUBSCRIPTION_AMOUNT: bigint;
|
|
65
|
-
readonly APP_SPONSORED_TX_GAS_LIMIT: bigint;
|
|
66
|
-
constructor(testName: string, numberOfAccounts?: number, setupOptions?: Partial<SetupOptions & DeployAztecL1ContractsArgs>);
|
|
67
|
-
setup(): Promise<this>;
|
|
68
|
-
teardown(): Promise<void>;
|
|
69
|
-
setIsMarkingAsProven(b: boolean): void;
|
|
70
|
-
catchUpProvenChain(): Promise<void>;
|
|
71
|
-
getBlockRewards(): Promise<{
|
|
72
|
-
sequencerBlockRewards: bigint;
|
|
73
|
-
proverBlockRewards: bigint;
|
|
74
|
-
}>;
|
|
75
|
-
mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress): Promise<void>;
|
|
76
|
-
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */
|
|
77
|
-
mintPrivateBananas(amount: bigint, address: AztecAddress): Promise<void>;
|
|
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>;
|
|
85
|
-
applyFundAliceWithBananas(): Promise<void>;
|
|
86
|
-
applyFundAliceWithPrivateBananas(): Promise<void>;
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlc190ZXN0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZTJlX2ZlZXMvZmVlc190ZXN0Ln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