@aztec/end-to-end 0.0.1-commit.b655e406 → 0.0.1-commit.b8a057fa
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 +217 -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/automine/contracts/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.js +120 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts +17 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +123 -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/automine/token/blacklist_token_contract_test.js +166 -0
- 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/automine/token/token_contract_test.js +119 -0
- 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 +17 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +40 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +26 -20
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +159 -140
- 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 +8 -27
- package/dest/bench/utils.d.ts +10 -9
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +126 -23
- 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/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +1 -1
- 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 +27 -29
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +156 -156
- 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 +83 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +86 -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/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 +119 -0
- package/dest/fixtures/index.d.ts +3 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +2 -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/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 +269 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +688 -0
- package/dest/fixtures/setup_p2p_test.d.ts +22 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +60 -41
- 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 +26 -5
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +33 -9
- 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/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/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/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/index.d.ts +1 -1
- package/dest/install_legacy_contracts.d.cts +10 -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/p2p/p2p_network.d.ts +325 -0
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/p2p/p2p_network.js +389 -0
- package/dest/p2p/reqresp/utils.d.ts +19 -0
- package/dest/p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/p2p/reqresp/utils.js +193 -0
- 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/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 +11 -8
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +45 -40
- package/dest/shared/gas_portal_test_harness.d.ts +9 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +28 -16
- 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 +19 -14
- 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 +3 -27
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +86 -54
- 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/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +11 -4
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +33 -19
- 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/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/single-node/fees/bridging_race.notest.d.ts +2 -0
- package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +21 -10
- package/dest/single-node/fees/fees_test.d.ts +93 -0
- package/dest/single-node/fees/fees_test.d.ts.map +1 -0
- package/dest/single-node/fees/fees_test.js +274 -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 +360 -0
- package/dest/single-node/single_node_test_context.d.ts.map +1 -0
- package/dest/single-node/single_node_test_context.js +833 -0
- 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 +169 -30
- package/dest/spartan/tx_metrics.d.ts +111 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +507 -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 +19 -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 +105 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +323 -0
- package/dest/test-wallet/utils.d.ts +76 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +126 -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 +56 -0
- package/dest/test-wallet/worker_wallet.d.ts +53 -0
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet.js +155 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts +4 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet_schema.js +22 -0
- package/package.json +57 -47
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -0
- package/src/automine/contracts/fixtures/storage_proof.json +915 -0
- package/src/automine/contracts/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/automine/contracts/fixtures/storage_proof_fixture.ts +173 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +177 -0
- package/src/automine/token/blacklist_token_contract_test.ts +208 -0
- package/src/automine/token/token_contract_test.ts +146 -0
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +45 -2
- package/src/bench/client_flows/client_flows_benchmark.ts +227 -211
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +7 -28
- package/src/bench/utils.ts +144 -25
- package/src/composed/ha/ha_full_setup.ts +466 -0
- package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +1 -1
- 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 +175 -214
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +110 -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 +192 -0
- package/src/fixtures/index.ts +2 -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 +987 -0
- package/src/fixtures/setup_p2p_test.ts +72 -58
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +47 -11
- package/src/fixtures/utils.ts +26 -947
- package/src/fixtures/wait_helpers.ts +333 -0
- 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 +106 -0
- package/src/guides/up_quick_start.sh +8 -5
- package/src/infra/README.md +12 -0
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/multi-node/README.md +95 -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/p2p/p2p_network.ts +542 -0
- package/src/p2p/reqresp/utils.ts +263 -0
- package/src/p2p/shared.ts +329 -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 +51 -43
- package/src/shared/gas_portal_test_harness.ts +36 -18
- 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 +22 -19
- package/src/shared/timing_env.d.mts +39 -0
- package/src/shared/timing_env.mjs +363 -0
- package/src/shared/uniswap_l1_l2.ts +136 -115
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +40 -20
- package/src/simulators/token_simulator.ts +6 -30
- package/src/single-node/README.md +60 -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 +23 -15
- package/src/single-node/fees/fees_test.ts +368 -0
- 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 +1041 -0
- package/src/spartan/DEVELOP.md +7 -0
- package/src/spartan/setup_test_wallets.ts +243 -32
- package/src/spartan/tx_metrics.ts +460 -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 +429 -0
- package/src/test-wallet/utils.ts +205 -0
- package/src/test-wallet/wallet_worker_script.ts +66 -0
- package/src/test-wallet/worker_wallet.ts +214 -0
- package/src/test-wallet/worker_wallet_schema.ts +14 -0
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -54
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +0 -185
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -41
- 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 -107
- package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -36
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
- package/dest/e2e_deploy_contract/deploy_test.js +0 -45
- package/dest/e2e_epochs/epochs_test.d.ts +0 -92
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -336
- package/dest/e2e_fees/bridging_race.notest.d.ts +0 -2
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -84
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.js +0 -260
- package/dest/e2e_l1_publisher/write_json.d.ts +0 -10
- package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.js +0 -57
- 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 -29
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +0 -63
- 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 -135
- package/dest/e2e_p2p/p2p_network.d.ts +0 -108
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/p2p_network.js +0 -318
- package/dest/e2e_p2p/shared.d.ts +0 -46
- package/dest/e2e_p2p/shared.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.js +0 -183
- package/dest/e2e_token_contract/token_contract_test.d.ts +0 -35
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
- package/dest/e2e_token_contract/token_contract_test.js +0 -126
- 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/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +0 -256
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -178
- package/src/e2e_deploy_contract/deploy_test.ts +0 -78
- package/src/e2e_epochs/epochs_test.ts +0 -437
- package/src/e2e_fees/fees_test.ts +0 -378
- package/src/e2e_l1_publisher/write_json.ts +0 -76
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -95
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -178
- package/src/e2e_p2p/p2p_network.ts +0 -472
- package/src/e2e_p2p/shared.ts +0 -282
- package/src/e2e_token_contract/token_contract_test.ts +0 -167
- package/src/fixtures/setup_l1_contracts.ts +0 -26
- package/src/fixtures/snapshot_manager.ts +0 -665
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
import { type InitialAccountData, generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
2
|
+
import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
+
import { getAccountContractAddress } from '@aztec/aztec.js/account';
|
|
4
|
+
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
5
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
6
|
+
import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
|
|
7
|
+
import { GSEContract, RollupContract, type SlashingProposerContract } from '@aztec/ethereum/contracts';
|
|
8
|
+
import type { Operator } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
9
|
+
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
10
|
+
import { MultiAdderArtifact } from '@aztec/ethereum/l1-artifacts';
|
|
11
|
+
import { createL1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
12
|
+
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
13
|
+
import type { ExtendedViemWalletClient, ViemClient } from '@aztec/ethereum/types';
|
|
14
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
15
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
16
|
+
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
17
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
18
|
+
import { RollupAbi, SlasherAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
19
|
+
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
20
|
+
import type { BootstrapNode } from '@aztec/p2p/bootstrap';
|
|
21
|
+
import { createBootstrapNodeFromPrivateKey, getBootstrapNodeEnr } from '@aztec/p2p/test-helpers';
|
|
22
|
+
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
23
|
+
import { TopicType } from '@aztec/stdlib/p2p';
|
|
24
|
+
import type { GenesisData } from '@aztec/stdlib/world-state';
|
|
25
|
+
import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
|
|
26
|
+
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
27
|
+
|
|
28
|
+
import fs from 'fs';
|
|
29
|
+
import getPort from 'get-port';
|
|
30
|
+
import os from 'os';
|
|
31
|
+
import path from 'path';
|
|
32
|
+
import { type GetContractReturnType, getAddress, getContract } from 'viem';
|
|
33
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
34
|
+
|
|
35
|
+
import {
|
|
36
|
+
SCHNORR_HARDCODED_PRIVATE_KEY,
|
|
37
|
+
SchnorrHardcodedKeyAccountContract,
|
|
38
|
+
} from '../fixtures/schnorr_hardcoded_account_contract.js';
|
|
39
|
+
import {
|
|
40
|
+
type EndToEndContext,
|
|
41
|
+
type SetupOptions,
|
|
42
|
+
getPrivateKeyFromIndex,
|
|
43
|
+
getSponsoredFPCAddress,
|
|
44
|
+
setup,
|
|
45
|
+
teardown,
|
|
46
|
+
} from '../fixtures/setup.js';
|
|
47
|
+
import {
|
|
48
|
+
ATTESTER_PRIVATE_KEYS_START_INDEX,
|
|
49
|
+
createValidatorConfig,
|
|
50
|
+
generatePrivateKeys,
|
|
51
|
+
} from '../fixtures/setup_p2p_test.js';
|
|
52
|
+
import { getEndToEndTestTelemetryClient } from '../fixtures/with_telemetry_utils.js';
|
|
53
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
54
|
+
|
|
55
|
+
// Use a fixed bootstrap node private key so that we can re-use the same snapshot and the nodes can find each other
|
|
56
|
+
const BOOTSTRAP_NODE_PRIVATE_KEY = '080212208f988fc0899e4a73a5aee4d271a5f20670603a756ad8d84f2c94263a6427c591';
|
|
57
|
+
const l1ContractsConfig = getL1ContractsConfigEnvVars();
|
|
58
|
+
export const WAIT_FOR_TX_TIMEOUT = l1ContractsConfig.aztecSlotDuration * 3;
|
|
59
|
+
|
|
60
|
+
export const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES = {
|
|
61
|
+
aztecSlotDuration: 12,
|
|
62
|
+
ethereumSlotDuration: 4,
|
|
63
|
+
aztecProofSubmissionEpochs: 640,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export class P2PNetworkTest {
|
|
67
|
+
public context!: EndToEndContext;
|
|
68
|
+
public baseAccountPrivateKey: `0x${string}`;
|
|
69
|
+
public baseAccount;
|
|
70
|
+
|
|
71
|
+
public logger: Logger;
|
|
72
|
+
public monitor!: ChainMonitor;
|
|
73
|
+
|
|
74
|
+
public ctx!: EndToEndContext;
|
|
75
|
+
public attesterPrivateKeys: `0x${string}`[] = [];
|
|
76
|
+
public attesterPublicKeys: string[] = [];
|
|
77
|
+
public peerIdPrivateKeys: string[] = [];
|
|
78
|
+
public validators: Operator[] = [];
|
|
79
|
+
|
|
80
|
+
public hardcodedAccountData!: InitialAccountData;
|
|
81
|
+
public genesis: GenesisData | undefined;
|
|
82
|
+
|
|
83
|
+
// The re-execution test needs a wallet and a spam contract
|
|
84
|
+
public wallet?: TestWallet;
|
|
85
|
+
public defaultAccountAddress?: AztecAddress;
|
|
86
|
+
public spamContract?: SpamContract;
|
|
87
|
+
|
|
88
|
+
public bootstrapNode?: BootstrapNode;
|
|
89
|
+
|
|
90
|
+
// Root temp directory holding every node's data dir. Created in setup(), removed in teardown().
|
|
91
|
+
public dataDir!: string;
|
|
92
|
+
|
|
93
|
+
// Store setup options for use in setup()
|
|
94
|
+
private setupOptions: SetupOptions;
|
|
95
|
+
private deployL1ContractsArgs: any;
|
|
96
|
+
|
|
97
|
+
constructor(
|
|
98
|
+
public readonly testName: string,
|
|
99
|
+
public bootstrapNodeEnr: string,
|
|
100
|
+
public bootNodePort: number,
|
|
101
|
+
public numberOfValidators: number,
|
|
102
|
+
initialValidatorConfig: SetupOptions,
|
|
103
|
+
public numberOfNodes = 0,
|
|
104
|
+
// If set enable metrics collection
|
|
105
|
+
private metricsPort?: number,
|
|
106
|
+
startProverNode?: boolean,
|
|
107
|
+
) {
|
|
108
|
+
this.logger = createLogger(`e2e:e2e_p2p:${testName}`);
|
|
109
|
+
|
|
110
|
+
// Set up the base account and node private keys for the initial network deployment
|
|
111
|
+
this.baseAccountPrivateKey = `0x${getPrivateKeyFromIndex(1)!.toString('hex')}`;
|
|
112
|
+
this.baseAccount = privateKeyToAccount(this.baseAccountPrivateKey);
|
|
113
|
+
this.attesterPrivateKeys = generatePrivateKeys(
|
|
114
|
+
ATTESTER_PRIVATE_KEYS_START_INDEX + numberOfNodes,
|
|
115
|
+
numberOfValidators,
|
|
116
|
+
);
|
|
117
|
+
this.attesterPublicKeys = this.attesterPrivateKeys.map(privateKey => privateKeyToAccount(privateKey).address);
|
|
118
|
+
|
|
119
|
+
const zkPassportParams = ZkPassportProofParams.random();
|
|
120
|
+
|
|
121
|
+
// Store setup options for later use
|
|
122
|
+
this.setupOptions = {
|
|
123
|
+
...initialValidatorConfig,
|
|
124
|
+
ethereumSlotDuration: initialValidatorConfig.ethereumSlotDuration ?? l1ContractsConfig.ethereumSlotDuration,
|
|
125
|
+
aztecEpochDuration: initialValidatorConfig.aztecEpochDuration ?? l1ContractsConfig.aztecEpochDuration,
|
|
126
|
+
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
127
|
+
aztecProofSubmissionEpochs:
|
|
128
|
+
initialValidatorConfig.aztecProofSubmissionEpochs ?? l1ContractsConfig.aztecProofSubmissionEpochs,
|
|
129
|
+
slashingRoundSizeInEpochs:
|
|
130
|
+
initialValidatorConfig.slashingRoundSizeInEpochs ?? l1ContractsConfig.slashingRoundSizeInEpochs,
|
|
131
|
+
slasherEnabled: initialValidatorConfig.slasherEnabled ?? true,
|
|
132
|
+
aztecTargetCommitteeSize: numberOfValidators,
|
|
133
|
+
metricsPort: metricsPort,
|
|
134
|
+
startProverNode,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
this.deployL1ContractsArgs = {
|
|
138
|
+
...initialValidatorConfig,
|
|
139
|
+
aztecEpochDuration: initialValidatorConfig.aztecEpochDuration ?? l1ContractsConfig.aztecEpochDuration,
|
|
140
|
+
slashingRoundSizeInEpochs:
|
|
141
|
+
initialValidatorConfig.slashingRoundSizeInEpochs ?? l1ContractsConfig.slashingRoundSizeInEpochs,
|
|
142
|
+
slasherEnabled: initialValidatorConfig.slasherEnabled ?? true,
|
|
143
|
+
|
|
144
|
+
ethereumSlotDuration: initialValidatorConfig.ethereumSlotDuration ?? l1ContractsConfig.ethereumSlotDuration,
|
|
145
|
+
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
146
|
+
aztecProofSubmissionEpochs:
|
|
147
|
+
initialValidatorConfig.aztecProofSubmissionEpochs ?? l1ContractsConfig.aztecProofSubmissionEpochs,
|
|
148
|
+
aztecTargetCommitteeSize: numberOfValidators,
|
|
149
|
+
initialValidators: [],
|
|
150
|
+
zkPassportArgs: {
|
|
151
|
+
zkPassportDomain: zkPassportParams.domain,
|
|
152
|
+
zkPassportScope: zkPassportParams.scope,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
static async create({
|
|
158
|
+
testName,
|
|
159
|
+
numberOfNodes,
|
|
160
|
+
numberOfValidators,
|
|
161
|
+
basePort,
|
|
162
|
+
metricsPort,
|
|
163
|
+
initialConfig,
|
|
164
|
+
startProverNode,
|
|
165
|
+
}: {
|
|
166
|
+
testName: string;
|
|
167
|
+
numberOfNodes: number;
|
|
168
|
+
numberOfValidators: number;
|
|
169
|
+
basePort?: number;
|
|
170
|
+
metricsPort?: number;
|
|
171
|
+
initialConfig?: SetupOptions;
|
|
172
|
+
startProverNode?: boolean;
|
|
173
|
+
}) {
|
|
174
|
+
const port = basePort || (await getPort());
|
|
175
|
+
|
|
176
|
+
const bootstrapNodeENR = await getBootstrapNodeEnr(BOOTSTRAP_NODE_PRIVATE_KEY, port);
|
|
177
|
+
const bootstrapNodeEnr = bootstrapNodeENR.encodeTxt();
|
|
178
|
+
|
|
179
|
+
const initialValidatorConfig = await createValidatorConfig(
|
|
180
|
+
(initialConfig ?? {}) as AztecNodeConfig,
|
|
181
|
+
bootstrapNodeEnr,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
return new P2PNetworkTest(
|
|
185
|
+
testName,
|
|
186
|
+
bootstrapNodeEnr,
|
|
187
|
+
port,
|
|
188
|
+
numberOfValidators,
|
|
189
|
+
initialValidatorConfig,
|
|
190
|
+
numberOfNodes,
|
|
191
|
+
metricsPort,
|
|
192
|
+
startProverNode,
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
get fundedAccount() {
|
|
197
|
+
if (!this.hardcodedAccountData) {
|
|
198
|
+
throw new Error('Call setup to initialize the hardcoded account.');
|
|
199
|
+
}
|
|
200
|
+
return this.hardcodedAccountData;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Returns a per-role data directory nested under this test's root data dir. The multi-node factories
|
|
205
|
+
* (`createNodes`) append `-<index>` to this base for each node they spawn; single-node factories
|
|
206
|
+
* (`createProverNode`, `createNonValidatorNode`, `createNode`) use it verbatim. Everything lives under
|
|
207
|
+
* `this.dataDir`, so a single recursive remove in teardown() cleans up all of it.
|
|
208
|
+
*/
|
|
209
|
+
dataDirFor(label: string): string {
|
|
210
|
+
if (!this.dataDir) {
|
|
211
|
+
throw new Error('Call setup to initialize the data directory.');
|
|
212
|
+
}
|
|
213
|
+
return path.join(this.dataDir, label);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
async addBootstrapNode() {
|
|
217
|
+
this.logger.info('Adding bootstrap node');
|
|
218
|
+
const telemetry = await getEndToEndTestTelemetryClient(this.metricsPort);
|
|
219
|
+
this.bootstrapNode = await createBootstrapNodeFromPrivateKey(
|
|
220
|
+
BOOTSTRAP_NODE_PRIVATE_KEY,
|
|
221
|
+
this.bootNodePort,
|
|
222
|
+
telemetry,
|
|
223
|
+
this.context.config,
|
|
224
|
+
);
|
|
225
|
+
// Overwrite enr with updated info
|
|
226
|
+
this.bootstrapNodeEnr = this.bootstrapNode.getENR().encodeTxt();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
getValidators() {
|
|
230
|
+
const validators: Operator[] = [];
|
|
231
|
+
|
|
232
|
+
for (let i = 0; i < this.numberOfValidators; i++) {
|
|
233
|
+
const keyIndex = i;
|
|
234
|
+
const attester = privateKeyToAccount(this.attesterPrivateKeys[keyIndex]!);
|
|
235
|
+
|
|
236
|
+
validators.push({
|
|
237
|
+
attester: EthAddress.fromString(attester.address),
|
|
238
|
+
withdrawer: EthAddress.fromString(attester.address),
|
|
239
|
+
bn254SecretKey: new SecretValue(Fr.random().toBigInt()),
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
this.logger.info(`Adding attester ${attester.address} as validator`);
|
|
243
|
+
}
|
|
244
|
+
return { validators };
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
async applyBaseSetup() {
|
|
248
|
+
await this.addBootstrapNode();
|
|
249
|
+
|
|
250
|
+
this.logger.info('Adding validators');
|
|
251
|
+
const rollup = getContract({
|
|
252
|
+
address: this.context.deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(),
|
|
253
|
+
abi: RollupAbi,
|
|
254
|
+
client: this.context.deployL1ContractsValues.l1Client,
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
this.logger.info(`Adding ${this.numberOfValidators} validators`);
|
|
258
|
+
|
|
259
|
+
const stakingAsset = getContract({
|
|
260
|
+
address: this.context.deployL1ContractsValues.l1ContractAddresses.stakingAssetAddress.toString(),
|
|
261
|
+
abi: TestERC20Abi,
|
|
262
|
+
client: this.context.deployL1ContractsValues.l1Client,
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
const { address: multiAdderAddress } = await deployL1Contract(
|
|
266
|
+
this.context.deployL1ContractsValues.l1Client,
|
|
267
|
+
MultiAdderArtifact.contractAbi,
|
|
268
|
+
MultiAdderArtifact.contractBytecode,
|
|
269
|
+
[rollup.address, this.context.deployL1ContractsValues.l1Client.account.address],
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
const multiAdder = getContract({
|
|
273
|
+
address: multiAdderAddress.toString(),
|
|
274
|
+
abi: MultiAdderArtifact.contractAbi,
|
|
275
|
+
client: this.context.deployL1ContractsValues.l1Client,
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
const stakeNeeded = (await rollup.read.getActivationThreshold()) * BigInt(this.numberOfValidators);
|
|
279
|
+
await Promise.all(
|
|
280
|
+
[await stakingAsset.write.mint([multiAdder.address, stakeNeeded], {} as any)].map(txHash =>
|
|
281
|
+
this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: txHash }),
|
|
282
|
+
),
|
|
283
|
+
);
|
|
284
|
+
|
|
285
|
+
const { validators } = this.getValidators();
|
|
286
|
+
this.validators = validators;
|
|
287
|
+
|
|
288
|
+
const gseAddress = this.context.deployL1ContractsValues.l1ContractAddresses.gseAddress!;
|
|
289
|
+
if (!gseAddress) {
|
|
290
|
+
throw new Error('GSE contract not deployed');
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const gseContract = new GSEContract(this.context.deployL1ContractsValues.l1Client, gseAddress.toString());
|
|
294
|
+
|
|
295
|
+
const makeValidatorTuples = async (validator: Operator) => {
|
|
296
|
+
const registrationTuple = await gseContract.makeRegistrationTuple(validator.bn254SecretKey.getValue());
|
|
297
|
+
return {
|
|
298
|
+
attester: validator.attester.toString() as `0x${string}`,
|
|
299
|
+
withdrawer: validator.withdrawer.toString() as `0x${string}`,
|
|
300
|
+
...registrationTuple,
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
const validatorTuples = await Promise.all(validators.map(makeValidatorTuples));
|
|
304
|
+
|
|
305
|
+
await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({
|
|
306
|
+
hash: await multiAdder.write.addValidators([validatorTuples]),
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
await this.context.cheatCodes.rollup.advanceToEpoch(
|
|
310
|
+
EpochNumber.fromBigInt(
|
|
311
|
+
BigInt(await this.context.cheatCodes.rollup.getEpoch()) +
|
|
312
|
+
(await rollup.read.getLagInEpochsForValidatorSet()) +
|
|
313
|
+
1n,
|
|
314
|
+
),
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
// Send and await a tx to make sure we mine a block for the warp to correctly progress.
|
|
318
|
+
await this._sendDummyTx(this.context.deployL1ContractsValues.l1Client);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/** Points the wallet to a P2P-enabled node so transactions can propagate through the network. */
|
|
322
|
+
setupWalletOnNode(node: AztecNodeService) {
|
|
323
|
+
this.logger.info('Pointing wallet to a P2P-enabled node');
|
|
324
|
+
this.context.wallet.updateNode(node);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/** Registers the hardcoded account in PXE without on-chain deployment. No sequencer needed. */
|
|
328
|
+
async setupAccount() {
|
|
329
|
+
this.logger.info('Registering hardcoded account (no deployment)');
|
|
330
|
+
const contract = new SchnorrHardcodedKeyAccountContract();
|
|
331
|
+
const accountManager = await (this.context.wallet as TestWallet).createAccount({
|
|
332
|
+
secret: this.hardcodedAccountData.secret,
|
|
333
|
+
salt: this.hardcodedAccountData.salt,
|
|
334
|
+
contract,
|
|
335
|
+
});
|
|
336
|
+
this.defaultAccountAddress = accountManager.address;
|
|
337
|
+
this.wallet = this.context.wallet;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
async deploySpamContract() {
|
|
341
|
+
this.logger.info('Deploying spam contract');
|
|
342
|
+
if (!this.wallet) {
|
|
343
|
+
throw new Error('Call setupAccount before deploying spam contract');
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
({ contract: this.spamContract } = await SpamContract.deploy(this.wallet).send({
|
|
347
|
+
from: this.defaultAccountAddress!,
|
|
348
|
+
}));
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
async removeInitialNode() {
|
|
352
|
+
this.logger.info('Removing initial node');
|
|
353
|
+
// Send and await a tx to make sure we mine a block for the warp to correctly progress.
|
|
354
|
+
const { receipt } = await this._sendDummyTx(this.context.deployL1ContractsValues.l1Client);
|
|
355
|
+
const block = await this.context.deployL1ContractsValues.l1Client.getBlock({
|
|
356
|
+
blockNumber: receipt.blockNumber,
|
|
357
|
+
});
|
|
358
|
+
this.context.dateProvider.setTime(Number(block.timestamp) * 1000);
|
|
359
|
+
|
|
360
|
+
await this.context.aztecNodeService.stop();
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
async sendDummyTx() {
|
|
364
|
+
return await this._sendDummyTx(this.ctx.deployL1ContractsValues.l1Client);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
private async _sendDummyTx(l1Client: ExtendedViemWalletClient) {
|
|
368
|
+
const l1TxUtils = createL1TxUtils(l1Client);
|
|
369
|
+
return await l1TxUtils.sendAndMonitorTransaction({
|
|
370
|
+
to: l1Client.account!.address,
|
|
371
|
+
value: 1n,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
async setup() {
|
|
376
|
+
this.logger.info('Setting up subsystems from fresh');
|
|
377
|
+
|
|
378
|
+
this.dataDir = fs.mkdtempSync(path.join(os.tmpdir(), `${this.testName}-`));
|
|
379
|
+
|
|
380
|
+
// Pre-compute hardcoded account data so it gets funded in genesis.
|
|
381
|
+
const contract = new SchnorrHardcodedKeyAccountContract();
|
|
382
|
+
const secret = Fr.random();
|
|
383
|
+
const salt = Fr.random();
|
|
384
|
+
this.hardcodedAccountData = {
|
|
385
|
+
secret,
|
|
386
|
+
salt,
|
|
387
|
+
signingKey: SCHNORR_HARDCODED_PRIVATE_KEY,
|
|
388
|
+
address: await getAccountContractAddress(contract, secret, salt),
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
// Generate funded (initializerless) Schnorr accounts for tests that create accounts from them (e.g. add_rollup).
|
|
392
|
+
const fundedAccounts = await generateSchnorrAccounts(2);
|
|
393
|
+
|
|
394
|
+
this.context = await setup(
|
|
395
|
+
0,
|
|
396
|
+
{
|
|
397
|
+
...this.setupOptions,
|
|
398
|
+
fundSponsoredFPC: true,
|
|
399
|
+
skipInitialSequencer: true,
|
|
400
|
+
additionallyFundedAccounts: [...fundedAccounts, this.hardcodedAccountData],
|
|
401
|
+
slasherEnabled: this.setupOptions.slasherEnabled ?? this.deployL1ContractsArgs.slasherEnabled ?? false,
|
|
402
|
+
aztecTargetCommitteeSize: 0,
|
|
403
|
+
l1ContractsArgs: this.deployL1ContractsArgs,
|
|
404
|
+
},
|
|
405
|
+
// Use checkpointed chain tip for PXE to avoid issues with blocks being dropped due to pruned anchor blocks.
|
|
406
|
+
{ syncChainTip: 'checkpointed' },
|
|
407
|
+
);
|
|
408
|
+
this.ctx = this.context;
|
|
409
|
+
|
|
410
|
+
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
411
|
+
const initialFundedAccounts = [...this.context.additionallyFundedAccounts.map(a => a.address), sponsoredFPCAddress];
|
|
412
|
+
|
|
413
|
+
const { genesis } = await getGenesisValues(
|
|
414
|
+
initialFundedAccounts,
|
|
415
|
+
undefined,
|
|
416
|
+
undefined,
|
|
417
|
+
this.context.genesis!.genesisTimestamp,
|
|
418
|
+
);
|
|
419
|
+
this.genesis = genesis;
|
|
420
|
+
|
|
421
|
+
const rollupContract = RollupContract.getFromL1ContractsValues(this.context.deployL1ContractsValues);
|
|
422
|
+
this.monitor = new ChainMonitor(rollupContract, this.context.dateProvider).start();
|
|
423
|
+
this.monitor.on('l1-block', ({ timestamp }) => this.context.dateProvider.setTime(Number(timestamp) * 1000));
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
async stopNodes(nodes: AztecNodeService[]) {
|
|
427
|
+
this.logger.info('Stopping nodes');
|
|
428
|
+
|
|
429
|
+
if (!nodes || !nodes.length) {
|
|
430
|
+
this.logger.info('No nodes to stop');
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
await Promise.all(nodes.map(node => node.stop()));
|
|
435
|
+
|
|
436
|
+
this.logger.info('Nodes stopped');
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Wait for P2P mesh to be fully formed across all nodes.
|
|
441
|
+
* This ensures that all nodes are connected to each other before proceeding,
|
|
442
|
+
* preventing race conditions where validators propose blocks before the network is ready.
|
|
443
|
+
*
|
|
444
|
+
* @param nodes - Array of nodes to check for P2P connectivity
|
|
445
|
+
* @param expectedNodeCount - Expected number of nodes in the network (defaults to nodes.length)
|
|
446
|
+
* @param timeoutSeconds - Maximum time to wait for connections (default: 30 seconds)
|
|
447
|
+
* @param checkIntervalSeconds - How often to check connectivity (default: 0.1 seconds)
|
|
448
|
+
*/
|
|
449
|
+
async waitForP2PMeshConnectivity(
|
|
450
|
+
nodes: AztecNodeService[],
|
|
451
|
+
expectedNodeCount?: number,
|
|
452
|
+
timeoutSeconds = 30,
|
|
453
|
+
checkIntervalSeconds = 0.1,
|
|
454
|
+
topics: TopicType[] = [TopicType.tx],
|
|
455
|
+
minMeshPeerCount = 1,
|
|
456
|
+
) {
|
|
457
|
+
const nodeCount = expectedNodeCount ?? nodes.length;
|
|
458
|
+
const minPeerCount = nodeCount - 1;
|
|
459
|
+
|
|
460
|
+
this.logger.warn(
|
|
461
|
+
`Waiting for all ${nodeCount} nodes to connect to P2P mesh (at least ${minPeerCount} peers each)...`,
|
|
462
|
+
);
|
|
463
|
+
|
|
464
|
+
await Promise.all(
|
|
465
|
+
nodes.map(async (node, index) => {
|
|
466
|
+
const p2p = node.getP2P();
|
|
467
|
+
await retryUntil(
|
|
468
|
+
async () => {
|
|
469
|
+
const peers = await p2p.getPeers();
|
|
470
|
+
// Each node should be connected to at least N-1 other nodes
|
|
471
|
+
return peers.length >= minPeerCount ? true : undefined;
|
|
472
|
+
},
|
|
473
|
+
`Node ${index} to connect to at least ${minPeerCount} peers`,
|
|
474
|
+
timeoutSeconds,
|
|
475
|
+
checkIntervalSeconds,
|
|
476
|
+
);
|
|
477
|
+
}),
|
|
478
|
+
);
|
|
479
|
+
|
|
480
|
+
this.logger.warn('All nodes connected to P2P mesh');
|
|
481
|
+
|
|
482
|
+
// Wait for the GossipSub mesh to form for all specified topics. By default we only require at
|
|
483
|
+
// least 1 mesh peer per node, since GossipSub stops grafting once it reaches Dlo peers and won't
|
|
484
|
+
// fill the mesh to every available peer. Callers that need a proposal to reach the whole
|
|
485
|
+
// committee within a slot (e.g. quorum-from-genesis tests) raise `minMeshPeerCount` so the mesh
|
|
486
|
+
// is fully formed — a single mesh peer can leave some committee members unreached at first.
|
|
487
|
+
for (const topic of topics) {
|
|
488
|
+
this.logger.warn(`Waiting for GossipSub mesh (>= ${minMeshPeerCount} peers per node) for ${topic} topic...`);
|
|
489
|
+
await Promise.all(
|
|
490
|
+
nodes.map(async (node, index) => {
|
|
491
|
+
const p2p = node.getP2P();
|
|
492
|
+
await retryUntil(
|
|
493
|
+
async () => {
|
|
494
|
+
const meshPeers = await p2p.getGossipMeshPeerCount(topic);
|
|
495
|
+
this.logger.debug(`Node ${index} has ${meshPeers} gossip mesh peers for ${topic} topic`);
|
|
496
|
+
return meshPeers >= minMeshPeerCount ? true : undefined;
|
|
497
|
+
},
|
|
498
|
+
`Node ${index} to have >= ${minMeshPeerCount} gossip mesh peers for ${topic} topic`,
|
|
499
|
+
timeoutSeconds,
|
|
500
|
+
checkIntervalSeconds,
|
|
501
|
+
);
|
|
502
|
+
}),
|
|
503
|
+
);
|
|
504
|
+
this.logger.warn(`All nodes have >= ${minMeshPeerCount} gossip mesh peers for ${topic} topic`);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
async teardown() {
|
|
509
|
+
await this.monitor.stop();
|
|
510
|
+
await tryStop(this.bootstrapNode, this.logger);
|
|
511
|
+
await teardown(this.context);
|
|
512
|
+
if (this.dataDir) {
|
|
513
|
+
fs.rmSync(this.dataDir, { recursive: true, force: true, maxRetries: 3 });
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
async getContracts(): Promise<{
|
|
518
|
+
rollup: RollupContract;
|
|
519
|
+
slasherContract: GetContractReturnType<typeof SlasherAbi, ViemClient>;
|
|
520
|
+
slashingProposer: SlashingProposerContract | undefined;
|
|
521
|
+
}> {
|
|
522
|
+
if (!this.ctx.deployL1ContractsValues) {
|
|
523
|
+
throw new Error('DeployAztecL1ContractsValues not set');
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
const rollup = new RollupContract(
|
|
527
|
+
this.ctx.deployL1ContractsValues!.l1Client,
|
|
528
|
+
this.ctx.deployL1ContractsValues!.l1ContractAddresses.rollupAddress,
|
|
529
|
+
);
|
|
530
|
+
|
|
531
|
+
const slasherContract = getContract({
|
|
532
|
+
address: getAddress((await rollup.getSlasherAddress()).toString()),
|
|
533
|
+
abi: SlasherAbi,
|
|
534
|
+
client: this.ctx.deployL1ContractsValues.l1Client,
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
// Get the actual slashing proposer from rollup
|
|
538
|
+
const slashingProposer = await rollup.getSlashingProposer();
|
|
539
|
+
|
|
540
|
+
return { rollup, slasherContract, slashingProposer };
|
|
541
|
+
}
|
|
542
|
+
}
|