@aztec/end-to-end 0.0.1-commit.d3ec352c → 0.0.1-commit.d58ff9d0
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/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/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 +19 -20
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +155 -159
- 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 +4 -1
- package/dest/bench/utils.d.ts +11 -10
- 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 +25 -29
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +147 -151
- 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 +84 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +87 -2
- 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/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 +49 -38
- 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 +28 -7
- package/dest/fixtures/utils.d.ts +5 -638
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -647
- package/dest/fixtures/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.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/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/{e2e_p2p → p2p}/p2p_network.d.ts +33 -21
- 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 +22 -9
- 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 +19 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +27 -15
- 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 +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/lending_simulator.d.ts +15 -4
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +29 -17
- 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/{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 +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 +15 -5
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +155 -50
- 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 -221
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -782
- 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 +320 -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 +157 -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 +23 -0
- package/package.json +54 -46
- 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/interactive_handshake_responder.ts +125 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +213 -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 +222 -251
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +2 -1
- 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 +172 -205
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +111 -3
- 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 +57 -57
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +46 -10
- package/src/fixtures/utils.ts +26 -966
- 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 +7 -4
- 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 -44
- package/src/shared/gas_portal_test_harness.ts +35 -17
- 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 +36 -18
- 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/setup_test_wallets.ts +217 -36
- 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 -983
- package/src/test-wallet/test_wallet.ts +426 -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 +216 -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 -108
- 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 -93
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -337
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -85
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.js +0 -263
- 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 -58
- 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 -64
- 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 -139
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/p2p_network.js +0 -320
- 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 -184
- 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 -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/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +0 -256
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -179
- package/src/e2e_deploy_contract/deploy_test.ts +0 -78
- package/src/e2e_epochs/epochs_test.ts +0 -438
- package/src/e2e_fees/fees_test.ts +0 -382
- package/src/e2e_l1_publisher/write_json.ts +0 -77
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -96
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -182
- package/src/e2e_p2p/p2p_network.ts +0 -476
- package/src/e2e_p2p/shared.ts +0 -285
- 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
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
-
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { RollupContract } from '@aztec/ethereum';
|
|
4
|
-
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
5
|
-
|
|
6
|
-
import fs from 'fs';
|
|
7
|
-
import 'jest-extended';
|
|
8
|
-
import os from 'os';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
|
|
11
|
-
import { createNodes } from '../fixtures/setup_p2p_test.js';
|
|
12
|
-
import { P2PNetworkTest } from './p2p_network.js';
|
|
13
|
-
|
|
14
|
-
const NUM_NODES = 6;
|
|
15
|
-
const NUM_VALIDATORS = NUM_NODES;
|
|
16
|
-
const COMMITTEE_SIZE = NUM_VALIDATORS;
|
|
17
|
-
const SLASHING_QUORUM = 3;
|
|
18
|
-
const EPOCH_DURATION = 2;
|
|
19
|
-
const SLASHING_ROUND_SIZE_IN_EPOCHS = 2;
|
|
20
|
-
const BOOT_NODE_UDP_PORT = 4500;
|
|
21
|
-
const ETHEREUM_SLOT_DURATION = process.env.CI ? 8 : 4;
|
|
22
|
-
const AZTEC_SLOT_DURATION = ETHEREUM_SLOT_DURATION * 2;
|
|
23
|
-
const SLASHING_UNIT = BigInt(1e18);
|
|
24
|
-
const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
|
|
25
|
-
|
|
26
|
-
// How many epochs it may take to set everything up, so we dont slash during this period
|
|
27
|
-
const SETUP_EPOCH_DURATION = 5;
|
|
28
|
-
|
|
29
|
-
export class P2PInactivityTest {
|
|
30
|
-
public nodes!: AztecNodeService[];
|
|
31
|
-
public activeNodes!: AztecNodeService[];
|
|
32
|
-
public inactiveNodes!: AztecNodeService[];
|
|
33
|
-
|
|
34
|
-
public rollup!: RollupContract;
|
|
35
|
-
public offlineValidators!: EthAddress[];
|
|
36
|
-
|
|
37
|
-
private dataDir: string;
|
|
38
|
-
private inactiveNodeCount: number;
|
|
39
|
-
private keepInitialNode: boolean;
|
|
40
|
-
|
|
41
|
-
constructor(
|
|
42
|
-
public readonly test: P2PNetworkTest,
|
|
43
|
-
opts: { inactiveNodeCount: number; keepInitialNode?: boolean },
|
|
44
|
-
) {
|
|
45
|
-
this.dataDir = fs.mkdtempSync(path.join(os.tmpdir(), test.testName));
|
|
46
|
-
this.inactiveNodeCount = opts.inactiveNodeCount;
|
|
47
|
-
this.keepInitialNode = opts.keepInitialNode ?? false;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static async create(
|
|
51
|
-
testName: string,
|
|
52
|
-
opts: { slashInactivityConsecutiveEpochThreshold: number; inactiveNodeCount: number; keepInitialNode?: boolean },
|
|
53
|
-
) {
|
|
54
|
-
const test = await P2PNetworkTest.create({
|
|
55
|
-
testName,
|
|
56
|
-
numberOfNodes: 0,
|
|
57
|
-
numberOfValidators: NUM_VALIDATORS,
|
|
58
|
-
basePort: BOOT_NODE_UDP_PORT,
|
|
59
|
-
startProverNode: true,
|
|
60
|
-
initialConfig: {
|
|
61
|
-
proverNodeConfig: { proverNodeEpochProvingDelayMs: AZTEC_SLOT_DURATION * 1000 },
|
|
62
|
-
aztecTargetCommitteeSize: COMMITTEE_SIZE,
|
|
63
|
-
aztecSlotDuration: AZTEC_SLOT_DURATION,
|
|
64
|
-
ethereumSlotDuration: ETHEREUM_SLOT_DURATION,
|
|
65
|
-
aztecProofSubmissionEpochs: 1024, // effectively do not reorg
|
|
66
|
-
listenAddress: '127.0.0.1',
|
|
67
|
-
minTxsPerBlock: 0,
|
|
68
|
-
aztecEpochDuration: EPOCH_DURATION,
|
|
69
|
-
validatorReexecute: false,
|
|
70
|
-
sentinelEnabled: true,
|
|
71
|
-
slashingQuorum: SLASHING_QUORUM,
|
|
72
|
-
slashingRoundSizeInEpochs: SLASHING_ROUND_SIZE_IN_EPOCHS,
|
|
73
|
-
slashInactivityTargetPercentage: 0.8,
|
|
74
|
-
slashGracePeriodL2Slots: SETUP_EPOCH_DURATION * EPOCH_DURATION, // do not slash during setup
|
|
75
|
-
slashAmountSmall: SLASHING_UNIT,
|
|
76
|
-
slashAmountMedium: SLASHING_UNIT * 2n,
|
|
77
|
-
slashAmountLarge: SLASHING_UNIT * 3n,
|
|
78
|
-
...opts,
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
return new P2PInactivityTest(test, opts);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
public async setup() {
|
|
85
|
-
await this.test.applyBaseSnapshots();
|
|
86
|
-
await this.test.setup();
|
|
87
|
-
|
|
88
|
-
// Set slashing penalties for inactivity
|
|
89
|
-
const { rollup } = await this.test.getContracts();
|
|
90
|
-
const [activationThreshold, ejectionThreshold, localEjectionThreshold] = await Promise.all([
|
|
91
|
-
rollup.getActivationThreshold(),
|
|
92
|
-
rollup.getEjectionThreshold(),
|
|
93
|
-
rollup.getLocalEjectionThreshold(),
|
|
94
|
-
]);
|
|
95
|
-
const biggestEjection = ejectionThreshold > localEjectionThreshold ? ejectionThreshold : localEjectionThreshold;
|
|
96
|
-
expect(activationThreshold - SLASHING_AMOUNT).toBeLessThan(biggestEjection);
|
|
97
|
-
this.test.ctx.aztecNodeConfig.slashInactivityPenalty = SLASHING_AMOUNT;
|
|
98
|
-
this.rollup = rollup;
|
|
99
|
-
|
|
100
|
-
if (!this.keepInitialNode) {
|
|
101
|
-
await this.test.ctx.aztecNode.stop();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Create all active nodes
|
|
105
|
-
this.activeNodes = await createNodes(
|
|
106
|
-
this.test.ctx.aztecNodeConfig,
|
|
107
|
-
this.test.ctx.dateProvider,
|
|
108
|
-
this.test.bootstrapNodeEnr,
|
|
109
|
-
NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode),
|
|
110
|
-
BOOT_NODE_UDP_PORT,
|
|
111
|
-
this.test.prefilledPublicData,
|
|
112
|
-
this.dataDir,
|
|
113
|
-
undefined,
|
|
114
|
-
Number(this.keepInitialNode),
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
// And the ones with an initially disabled sequencer
|
|
118
|
-
const inactiveConfig = { ...this.test.ctx.aztecNodeConfig, dontStartSequencer: true };
|
|
119
|
-
this.inactiveNodes = await createNodes(
|
|
120
|
-
inactiveConfig,
|
|
121
|
-
this.test.ctx.dateProvider,
|
|
122
|
-
this.test.bootstrapNodeEnr,
|
|
123
|
-
this.inactiveNodeCount,
|
|
124
|
-
BOOT_NODE_UDP_PORT,
|
|
125
|
-
this.test.prefilledPublicData,
|
|
126
|
-
this.dataDir,
|
|
127
|
-
undefined,
|
|
128
|
-
NUM_NODES - this.inactiveNodeCount,
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
this.nodes = [
|
|
132
|
-
...(this.keepInitialNode ? [this.test.ctx.aztecNode] : []),
|
|
133
|
-
...this.activeNodes,
|
|
134
|
-
...this.inactiveNodes,
|
|
135
|
-
];
|
|
136
|
-
|
|
137
|
-
if (this.nodes.length !== NUM_NODES) {
|
|
138
|
-
throw new Error(`Expected ${NUM_NODES} nodes but got ${this.nodes.length}`);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
this.offlineValidators = this.test.validators
|
|
142
|
-
.slice(this.test.validators.length - this.inactiveNodeCount)
|
|
143
|
-
.map(a => a.attester);
|
|
144
|
-
|
|
145
|
-
this.test.logger.warn(`Setup complete. Offline validators are ${this.offlineValidators.join(', ')}.`, {
|
|
146
|
-
validators: this.test.validators,
|
|
147
|
-
offlineValidators: this.offlineValidators,
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// Wait for P2P mesh to be fully formed before starting slashing period
|
|
151
|
-
// This prevents race conditions where validators propose blocks before the network is ready
|
|
152
|
-
await this.test.waitForP2PMeshConnectivity(this.nodes, NUM_NODES);
|
|
153
|
-
|
|
154
|
-
const ethereumSlotDuration = this.test.ctx.aztecNodeConfig.ethereumSlotDuration!;
|
|
155
|
-
this.test.logger.warn(`Advancing to the L1 slot before epoch ${SETUP_EPOCH_DURATION + 1} to start slashing`);
|
|
156
|
-
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(EpochNumber(SETUP_EPOCH_DURATION + 1), {
|
|
157
|
-
offset: -ethereumSlotDuration,
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
return this;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
public async teardown() {
|
|
164
|
-
await this.test.stopNodes(this.nodes);
|
|
165
|
-
await this.test.teardown();
|
|
166
|
-
for (let i = 0; i < NUM_NODES; i++) {
|
|
167
|
-
fs.rmSync(`${this.dataDir}-${i}`, { recursive: true, force: true, maxRetries: 3 });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
public get ctx() {
|
|
172
|
-
return this.test.ctx;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
public get logger() {
|
|
176
|
-
return this.test.logger;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
public get slashingAmount() {
|
|
180
|
-
return SLASHING_AMOUNT;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
|
-
import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
4
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
|
-
import {
|
|
6
|
-
type EmpireSlashingProposerContract,
|
|
7
|
-
type ExtendedViemWalletClient,
|
|
8
|
-
GSEContract,
|
|
9
|
-
MultiAdderArtifact,
|
|
10
|
-
type Operator,
|
|
11
|
-
RollupContract,
|
|
12
|
-
type TallySlashingProposerContract,
|
|
13
|
-
type ViemClient,
|
|
14
|
-
createL1TxUtilsFromViemWallet,
|
|
15
|
-
deployL1Contract,
|
|
16
|
-
getL1ContractsConfigEnvVars,
|
|
17
|
-
} from '@aztec/ethereum';
|
|
18
|
-
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
19
|
-
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
20
|
-
import { SecretValue } from '@aztec/foundation/config';
|
|
21
|
-
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
22
|
-
import { retryUntil } from '@aztec/foundation/retry';
|
|
23
|
-
import { RollupAbi, SlasherAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
24
|
-
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
25
|
-
import type { BootstrapNode } from '@aztec/p2p/bootstrap';
|
|
26
|
-
import { createBootstrapNodeFromPrivateKey, getBootstrapNodeEnr } from '@aztec/p2p/test-helpers';
|
|
27
|
-
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
28
|
-
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
29
|
-
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
30
|
-
import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
|
|
31
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
32
|
-
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
33
|
-
|
|
34
|
-
import getPort from 'get-port';
|
|
35
|
-
import { type GetContractReturnType, getAddress, getContract } from 'viem';
|
|
36
|
-
import { privateKeyToAccount } from 'viem/accounts';
|
|
37
|
-
|
|
38
|
-
import {
|
|
39
|
-
ATTESTER_PRIVATE_KEYS_START_INDEX,
|
|
40
|
-
createValidatorConfig,
|
|
41
|
-
generatePrivateKeys,
|
|
42
|
-
} from '../fixtures/setup_p2p_test.js';
|
|
43
|
-
import {
|
|
44
|
-
type ISnapshotManager,
|
|
45
|
-
type SubsystemsContext,
|
|
46
|
-
createSnapshotManager,
|
|
47
|
-
deployAccounts,
|
|
48
|
-
} from '../fixtures/snapshot_manager.js';
|
|
49
|
-
import { type SetupOptions, getPrivateKeyFromIndex, getSponsoredFPCAddress } from '../fixtures/utils.js';
|
|
50
|
-
import { getEndToEndTestTelemetryClient } from '../fixtures/with_telemetry_utils.js';
|
|
51
|
-
|
|
52
|
-
// Use a fixed bootstrap node private key so that we can re-use the same snapshot and the nodes can find each other
|
|
53
|
-
const BOOTSTRAP_NODE_PRIVATE_KEY = '080212208f988fc0899e4a73a5aee4d271a5f20670603a756ad8d84f2c94263a6427c591';
|
|
54
|
-
const l1ContractsConfig = getL1ContractsConfigEnvVars();
|
|
55
|
-
export const WAIT_FOR_TX_TIMEOUT = l1ContractsConfig.aztecSlotDuration * 3;
|
|
56
|
-
|
|
57
|
-
export const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES = {
|
|
58
|
-
aztecSlotDuration: 12,
|
|
59
|
-
ethereumSlotDuration: 4,
|
|
60
|
-
aztecProofSubmissionWindow: 640,
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export class P2PNetworkTest {
|
|
64
|
-
private snapshotManager: ISnapshotManager;
|
|
65
|
-
public baseAccountPrivateKey: `0x${string}`;
|
|
66
|
-
public baseAccount;
|
|
67
|
-
|
|
68
|
-
public logger: Logger;
|
|
69
|
-
public monitor!: ChainMonitor;
|
|
70
|
-
|
|
71
|
-
public ctx!: SubsystemsContext;
|
|
72
|
-
public attesterPrivateKeys: `0x${string}`[] = [];
|
|
73
|
-
public attesterPublicKeys: string[] = [];
|
|
74
|
-
public peerIdPrivateKeys: string[] = [];
|
|
75
|
-
public validators: Operator[] = [];
|
|
76
|
-
|
|
77
|
-
public deployedAccounts: InitialAccountData[] = [];
|
|
78
|
-
public prefilledPublicData: PublicDataTreeLeaf[] = [];
|
|
79
|
-
|
|
80
|
-
// The re-execution test needs a wallet and a spam contract
|
|
81
|
-
public wallet?: TestWallet;
|
|
82
|
-
public defaultAccountAddress?: AztecAddress;
|
|
83
|
-
public spamContract?: SpamContract;
|
|
84
|
-
|
|
85
|
-
public bootstrapNode?: BootstrapNode;
|
|
86
|
-
|
|
87
|
-
constructor(
|
|
88
|
-
public readonly testName: string,
|
|
89
|
-
public bootstrapNodeEnr: string,
|
|
90
|
-
public bootNodePort: number,
|
|
91
|
-
public numberOfValidators: number,
|
|
92
|
-
initialValidatorConfig: SetupOptions,
|
|
93
|
-
public numberOfNodes = 0,
|
|
94
|
-
// If set enable metrics collection
|
|
95
|
-
private metricsPort?: number,
|
|
96
|
-
startProverNode?: boolean,
|
|
97
|
-
mockZkPassportVerifier?: boolean,
|
|
98
|
-
) {
|
|
99
|
-
this.logger = createLogger(`e2e:e2e_p2p:${testName}`);
|
|
100
|
-
|
|
101
|
-
// Set up the base account and node private keys for the initial network deployment
|
|
102
|
-
this.baseAccountPrivateKey = `0x${getPrivateKeyFromIndex(1)!.toString('hex')}`;
|
|
103
|
-
this.baseAccount = privateKeyToAccount(this.baseAccountPrivateKey);
|
|
104
|
-
this.attesterPrivateKeys = generatePrivateKeys(
|
|
105
|
-
ATTESTER_PRIVATE_KEYS_START_INDEX + numberOfNodes,
|
|
106
|
-
numberOfValidators,
|
|
107
|
-
);
|
|
108
|
-
this.attesterPublicKeys = this.attesterPrivateKeys.map(privateKey => privateKeyToAccount(privateKey).address);
|
|
109
|
-
|
|
110
|
-
const zkPassportParams = ZkPassportProofParams.random();
|
|
111
|
-
|
|
112
|
-
this.snapshotManager = createSnapshotManager(
|
|
113
|
-
`e2e_p2p_network/${testName}`,
|
|
114
|
-
process.env.E2E_DATA_PATH,
|
|
115
|
-
{
|
|
116
|
-
...initialValidatorConfig,
|
|
117
|
-
ethereumSlotDuration: initialValidatorConfig.ethereumSlotDuration ?? l1ContractsConfig.ethereumSlotDuration,
|
|
118
|
-
aztecEpochDuration: initialValidatorConfig.aztecEpochDuration ?? l1ContractsConfig.aztecEpochDuration,
|
|
119
|
-
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
120
|
-
aztecProofSubmissionEpochs:
|
|
121
|
-
initialValidatorConfig.aztecProofSubmissionEpochs ?? l1ContractsConfig.aztecProofSubmissionEpochs,
|
|
122
|
-
slashingRoundSizeInEpochs:
|
|
123
|
-
initialValidatorConfig.slashingRoundSizeInEpochs ?? l1ContractsConfig.slashingRoundSizeInEpochs,
|
|
124
|
-
slasherFlavor: initialValidatorConfig.slasherFlavor ?? 'tally',
|
|
125
|
-
aztecTargetCommitteeSize: numberOfValidators,
|
|
126
|
-
salt: 420,
|
|
127
|
-
metricsPort: metricsPort,
|
|
128
|
-
numberOfInitialFundedAccounts: 2,
|
|
129
|
-
startProverNode,
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
...initialValidatorConfig,
|
|
133
|
-
aztecEpochDuration: initialValidatorConfig.aztecEpochDuration ?? l1ContractsConfig.aztecEpochDuration,
|
|
134
|
-
slashingRoundSizeInEpochs:
|
|
135
|
-
initialValidatorConfig.slashingRoundSizeInEpochs ?? l1ContractsConfig.slashingRoundSizeInEpochs,
|
|
136
|
-
slasherFlavor: initialValidatorConfig.slasherFlavor ?? 'tally',
|
|
137
|
-
|
|
138
|
-
ethereumSlotDuration: initialValidatorConfig.ethereumSlotDuration ?? l1ContractsConfig.ethereumSlotDuration,
|
|
139
|
-
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
140
|
-
aztecProofSubmissionEpochs:
|
|
141
|
-
initialValidatorConfig.aztecProofSubmissionEpochs ?? l1ContractsConfig.aztecProofSubmissionEpochs,
|
|
142
|
-
aztecTargetCommitteeSize: numberOfValidators,
|
|
143
|
-
initialValidators: [],
|
|
144
|
-
zkPassportArgs: {
|
|
145
|
-
mockZkPassportVerifier,
|
|
146
|
-
zkPassportDomain: zkPassportParams.domain,
|
|
147
|
-
zkPassportScope: zkPassportParams.scope,
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
static async create({
|
|
154
|
-
testName,
|
|
155
|
-
numberOfNodes,
|
|
156
|
-
numberOfValidators,
|
|
157
|
-
basePort,
|
|
158
|
-
metricsPort,
|
|
159
|
-
initialConfig,
|
|
160
|
-
startProverNode,
|
|
161
|
-
mockZkPassportVerifier,
|
|
162
|
-
}: {
|
|
163
|
-
testName: string;
|
|
164
|
-
numberOfNodes: number;
|
|
165
|
-
numberOfValidators: number;
|
|
166
|
-
basePort?: number;
|
|
167
|
-
metricsPort?: number;
|
|
168
|
-
initialConfig?: SetupOptions;
|
|
169
|
-
startProverNode?: boolean;
|
|
170
|
-
mockZkPassportVerifier?: boolean;
|
|
171
|
-
}) {
|
|
172
|
-
const port = basePort || (await getPort());
|
|
173
|
-
|
|
174
|
-
const bootstrapNodeENR = await getBootstrapNodeEnr(BOOTSTRAP_NODE_PRIVATE_KEY, port);
|
|
175
|
-
const bootstrapNodeEnr = bootstrapNodeENR.encodeTxt();
|
|
176
|
-
|
|
177
|
-
const initialValidatorConfig = await createValidatorConfig(
|
|
178
|
-
(initialConfig ?? {}) as AztecNodeConfig,
|
|
179
|
-
bootstrapNodeEnr,
|
|
180
|
-
);
|
|
181
|
-
|
|
182
|
-
return new P2PNetworkTest(
|
|
183
|
-
testName,
|
|
184
|
-
bootstrapNodeEnr,
|
|
185
|
-
port,
|
|
186
|
-
numberOfValidators,
|
|
187
|
-
initialValidatorConfig,
|
|
188
|
-
numberOfNodes,
|
|
189
|
-
metricsPort,
|
|
190
|
-
startProverNode,
|
|
191
|
-
mockZkPassportVerifier,
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
get fundedAccount() {
|
|
196
|
-
if (!this.deployedAccounts[0]) {
|
|
197
|
-
throw new Error('Call snapshot t.setupAccount to create a funded account.');
|
|
198
|
-
}
|
|
199
|
-
return this.deployedAccounts[0];
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
async addBootstrapNode() {
|
|
203
|
-
await this.snapshotManager.snapshot('add-bootstrap-node', async ({ aztecNodeConfig }) => {
|
|
204
|
-
const telemetry = getEndToEndTestTelemetryClient(this.metricsPort);
|
|
205
|
-
this.bootstrapNode = await createBootstrapNodeFromPrivateKey(
|
|
206
|
-
BOOTSTRAP_NODE_PRIVATE_KEY,
|
|
207
|
-
this.bootNodePort,
|
|
208
|
-
telemetry,
|
|
209
|
-
aztecNodeConfig,
|
|
210
|
-
);
|
|
211
|
-
// Overwrite enr with updated info
|
|
212
|
-
this.bootstrapNodeEnr = this.bootstrapNode.getENR().encodeTxt();
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
getValidators() {
|
|
217
|
-
const validators: Operator[] = [];
|
|
218
|
-
|
|
219
|
-
for (let i = 0; i < this.numberOfValidators; i++) {
|
|
220
|
-
const keyIndex = i;
|
|
221
|
-
const attester = privateKeyToAccount(this.attesterPrivateKeys[keyIndex]!);
|
|
222
|
-
|
|
223
|
-
validators.push({
|
|
224
|
-
attester: EthAddress.fromString(attester.address),
|
|
225
|
-
withdrawer: EthAddress.fromString(attester.address),
|
|
226
|
-
bn254SecretKey: new SecretValue(Fr.random().toBigInt()),
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
this.logger.info(`Adding attester ${attester.address} as validator`);
|
|
230
|
-
}
|
|
231
|
-
return { validators };
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
async applyBaseSnapshots() {
|
|
235
|
-
await this.addBootstrapNode();
|
|
236
|
-
await this.snapshotManager.snapshot('add-validators', async ({ deployL1ContractsValues, cheatCodes }) => {
|
|
237
|
-
const rollup = getContract({
|
|
238
|
-
address: deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(),
|
|
239
|
-
abi: RollupAbi,
|
|
240
|
-
client: deployL1ContractsValues.l1Client,
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
this.logger.info(`Adding ${this.numberOfValidators} validators`);
|
|
244
|
-
|
|
245
|
-
const stakingAsset = getContract({
|
|
246
|
-
address: deployL1ContractsValues.l1ContractAddresses.stakingAssetAddress.toString(),
|
|
247
|
-
abi: TestERC20Abi,
|
|
248
|
-
client: deployL1ContractsValues.l1Client,
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
const { address: multiAdderAddress } = await deployL1Contract(
|
|
252
|
-
deployL1ContractsValues.l1Client,
|
|
253
|
-
MultiAdderArtifact.contractAbi,
|
|
254
|
-
MultiAdderArtifact.contractBytecode,
|
|
255
|
-
[rollup.address, deployL1ContractsValues.l1Client.account.address],
|
|
256
|
-
);
|
|
257
|
-
|
|
258
|
-
const multiAdder = getContract({
|
|
259
|
-
address: multiAdderAddress.toString(),
|
|
260
|
-
abi: MultiAdderArtifact.contractAbi,
|
|
261
|
-
client: deployL1ContractsValues.l1Client,
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
const stakeNeeded = (await rollup.read.getActivationThreshold()) * BigInt(this.numberOfValidators);
|
|
265
|
-
await Promise.all(
|
|
266
|
-
[await stakingAsset.write.mint([multiAdder.address, stakeNeeded], {} as any)].map(txHash =>
|
|
267
|
-
deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: txHash }),
|
|
268
|
-
),
|
|
269
|
-
);
|
|
270
|
-
|
|
271
|
-
const { validators } = this.getValidators();
|
|
272
|
-
this.validators = validators;
|
|
273
|
-
|
|
274
|
-
const gseAddress = deployL1ContractsValues.l1ContractAddresses.gseAddress!;
|
|
275
|
-
if (!gseAddress) {
|
|
276
|
-
throw new Error('GSE contract not deployed');
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
const gseContract = new GSEContract(deployL1ContractsValues.l1Client, gseAddress.toString());
|
|
280
|
-
|
|
281
|
-
const makeValidatorTuples = async (validator: Operator) => {
|
|
282
|
-
const registrationTuple = await gseContract.makeRegistrationTuple(validator.bn254SecretKey.getValue());
|
|
283
|
-
return {
|
|
284
|
-
attester: validator.attester.toString() as `0x${string}`,
|
|
285
|
-
withdrawer: validator.withdrawer.toString() as `0x${string}`,
|
|
286
|
-
...registrationTuple,
|
|
287
|
-
};
|
|
288
|
-
};
|
|
289
|
-
const validatorTuples = await Promise.all(validators.map(makeValidatorTuples));
|
|
290
|
-
|
|
291
|
-
await deployL1ContractsValues.l1Client.waitForTransactionReceipt({
|
|
292
|
-
hash: await multiAdder.write.addValidators([validatorTuples]),
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
await cheatCodes.rollup.advanceToEpoch(
|
|
296
|
-
EpochNumber.fromBigInt(
|
|
297
|
-
BigInt(await cheatCodes.rollup.getEpoch()) + (await rollup.read.getLagInEpochsForValidatorSet()) + 1n,
|
|
298
|
-
),
|
|
299
|
-
);
|
|
300
|
-
|
|
301
|
-
// Send and await a tx to make sure we mine a block for the warp to correctly progress.
|
|
302
|
-
await this._sendDummyTx(deployL1ContractsValues.l1Client);
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
async setupAccount() {
|
|
307
|
-
await this.snapshotManager.snapshot(
|
|
308
|
-
'setup-account',
|
|
309
|
-
deployAccounts(1, this.logger),
|
|
310
|
-
({ deployedAccounts }, { wallet }) => {
|
|
311
|
-
this.deployedAccounts = deployedAccounts;
|
|
312
|
-
[{ address: this.defaultAccountAddress }] = deployedAccounts;
|
|
313
|
-
this.wallet = wallet;
|
|
314
|
-
return Promise.resolve();
|
|
315
|
-
},
|
|
316
|
-
);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
async deploySpamContract() {
|
|
320
|
-
await this.snapshotManager.snapshot(
|
|
321
|
-
'add-spam-contract',
|
|
322
|
-
async () => {
|
|
323
|
-
if (!this.wallet) {
|
|
324
|
-
throw new Error('Call snapshot t.setupAccount before deploying account contract');
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
const spamContract = await SpamContract.deploy(this.wallet)
|
|
328
|
-
.send({ from: this.defaultAccountAddress! })
|
|
329
|
-
.deployed();
|
|
330
|
-
return { contractAddress: spamContract.address };
|
|
331
|
-
},
|
|
332
|
-
({ contractAddress }) => {
|
|
333
|
-
if (!this.wallet) {
|
|
334
|
-
throw new Error('Call snapshot t.setupAccount before deploying account contract');
|
|
335
|
-
}
|
|
336
|
-
this.spamContract = SpamContract.at(contractAddress, this.wallet);
|
|
337
|
-
return Promise.resolve();
|
|
338
|
-
},
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
async removeInitialNode() {
|
|
343
|
-
await this.snapshotManager.snapshot(
|
|
344
|
-
'remove-initial-validator',
|
|
345
|
-
async ({ deployL1ContractsValues, aztecNode, dateProvider }) => {
|
|
346
|
-
// Send and await a tx to make sure we mine a block for the warp to correctly progress.
|
|
347
|
-
const { receipt } = await this._sendDummyTx(deployL1ContractsValues.l1Client);
|
|
348
|
-
const block = await deployL1ContractsValues.l1Client.getBlock({
|
|
349
|
-
blockNumber: receipt.blockNumber,
|
|
350
|
-
});
|
|
351
|
-
dateProvider.setTime(Number(block.timestamp) * 1000);
|
|
352
|
-
|
|
353
|
-
await aztecNode.stop();
|
|
354
|
-
},
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
async sendDummyTx() {
|
|
359
|
-
return await this._sendDummyTx(this.ctx.deployL1ContractsValues.l1Client);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
private async _sendDummyTx(l1Client: ExtendedViemWalletClient) {
|
|
363
|
-
const l1TxUtils = createL1TxUtilsFromViemWallet(l1Client);
|
|
364
|
-
return await l1TxUtils.sendAndMonitorTransaction({
|
|
365
|
-
to: l1Client.account!.address,
|
|
366
|
-
value: 1n,
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
async setup() {
|
|
371
|
-
this.ctx = await this.snapshotManager.setup();
|
|
372
|
-
|
|
373
|
-
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
374
|
-
const initialFundedAccounts = [...this.ctx.initialFundedAccounts.map(a => a.address), sponsoredFPCAddress];
|
|
375
|
-
|
|
376
|
-
const { prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
|
|
377
|
-
this.prefilledPublicData = prefilledPublicData;
|
|
378
|
-
|
|
379
|
-
const rollupContract = RollupContract.getFromL1ContractsValues(this.ctx.deployL1ContractsValues);
|
|
380
|
-
this.monitor = new ChainMonitor(rollupContract, this.ctx.dateProvider).start();
|
|
381
|
-
this.monitor.on('l1-block', ({ timestamp }) => this.ctx.dateProvider.setTime(Number(timestamp) * 1000));
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
async stopNodes(nodes: AztecNodeService[]) {
|
|
385
|
-
this.logger.info('Stopping nodes');
|
|
386
|
-
|
|
387
|
-
if (!nodes || !nodes.length) {
|
|
388
|
-
this.logger.info('No nodes to stop');
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
await Promise.all(nodes.map(node => node.stop()));
|
|
393
|
-
|
|
394
|
-
this.logger.info('Nodes stopped');
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* Wait for P2P mesh to be fully formed across all nodes.
|
|
399
|
-
* This ensures that all nodes are connected to each other before proceeding,
|
|
400
|
-
* preventing race conditions where validators propose blocks before the network is ready.
|
|
401
|
-
*
|
|
402
|
-
* @param nodes - Array of nodes to check for P2P connectivity
|
|
403
|
-
* @param expectedNodeCount - Expected number of nodes in the network (defaults to nodes.length)
|
|
404
|
-
* @param timeoutSeconds - Maximum time to wait for connections (default: 30 seconds)
|
|
405
|
-
* @param checkIntervalSeconds - How often to check connectivity (default: 0.1 seconds)
|
|
406
|
-
*/
|
|
407
|
-
async waitForP2PMeshConnectivity(
|
|
408
|
-
nodes: AztecNodeService[],
|
|
409
|
-
expectedNodeCount?: number,
|
|
410
|
-
timeoutSeconds = 30,
|
|
411
|
-
checkIntervalSeconds = 0.1,
|
|
412
|
-
) {
|
|
413
|
-
const nodeCount = expectedNodeCount ?? nodes.length;
|
|
414
|
-
const minPeerCount = nodeCount - 1;
|
|
415
|
-
|
|
416
|
-
this.logger.warn(
|
|
417
|
-
`Waiting for all ${nodeCount} nodes to connect to P2P mesh (at least ${minPeerCount} peers each)...`,
|
|
418
|
-
);
|
|
419
|
-
|
|
420
|
-
await Promise.all(
|
|
421
|
-
nodes.map(async (node, index) => {
|
|
422
|
-
const p2p = node.getP2P();
|
|
423
|
-
await retryUntil(
|
|
424
|
-
async () => {
|
|
425
|
-
const peers = await p2p.getPeers();
|
|
426
|
-
// Each node should be connected to at least N-1 other nodes
|
|
427
|
-
return peers.length >= minPeerCount ? true : undefined;
|
|
428
|
-
},
|
|
429
|
-
`Node ${index} to connect to at least ${minPeerCount} peers`,
|
|
430
|
-
timeoutSeconds,
|
|
431
|
-
checkIntervalSeconds,
|
|
432
|
-
);
|
|
433
|
-
}),
|
|
434
|
-
);
|
|
435
|
-
|
|
436
|
-
this.logger.warn('All nodes connected to P2P mesh');
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
async teardown() {
|
|
440
|
-
await this.monitor.stop();
|
|
441
|
-
await tryStop(this.bootstrapNode, this.logger);
|
|
442
|
-
await this.snapshotManager.teardown();
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
async getContracts(): Promise<{
|
|
446
|
-
rollup: RollupContract;
|
|
447
|
-
slasherContract: GetContractReturnType<typeof SlasherAbi, ViemClient>;
|
|
448
|
-
slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
|
|
449
|
-
slashFactory: SlashFactoryContract;
|
|
450
|
-
}> {
|
|
451
|
-
if (!this.ctx.deployL1ContractsValues) {
|
|
452
|
-
throw new Error('DeployL1ContractsValues not set');
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
const rollup = new RollupContract(
|
|
456
|
-
this.ctx.deployL1ContractsValues!.l1Client,
|
|
457
|
-
this.ctx.deployL1ContractsValues!.l1ContractAddresses.rollupAddress,
|
|
458
|
-
);
|
|
459
|
-
|
|
460
|
-
const slasherContract = getContract({
|
|
461
|
-
address: getAddress(await rollup.getSlasherAddress()),
|
|
462
|
-
abi: SlasherAbi,
|
|
463
|
-
client: this.ctx.deployL1ContractsValues.l1Client,
|
|
464
|
-
});
|
|
465
|
-
|
|
466
|
-
// Get the actual slashing proposer from rollup (which handles both empire and tally)
|
|
467
|
-
const slashingProposer = await rollup.getSlashingProposer();
|
|
468
|
-
|
|
469
|
-
const slashFactory = new SlashFactoryContract(
|
|
470
|
-
this.ctx.deployL1ContractsValues.l1Client,
|
|
471
|
-
getAddress(this.ctx.deployL1ContractsValues.l1ContractAddresses.slashFactoryAddress!.toString()),
|
|
472
|
-
);
|
|
473
|
-
|
|
474
|
-
return { rollup, slasherContract, slashingProposer, slashFactory };
|
|
475
|
-
}
|
|
476
|
-
}
|