@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
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared setup for the docker-compose HA full suite.
|
|
3
|
+
*
|
|
4
|
+
* Stands up the complete HA cluster used by `e2e_ha_full.parallel.test.ts` and
|
|
5
|
+
* `e2e_ha_distribute_work.test.ts`: a bootstrap RPC/P2P node plus NODE_COUNT in-proc
|
|
6
|
+
* `AztecNodeService` HA peers that share one PostgreSQL slashing-protection DB and a Web3Signer keystore.
|
|
7
|
+
* Requires the docker-compose HA suite (run_test.sh ha): live Postgres (DATABASE_URL) and Web3Signer
|
|
8
|
+
* sidecar.
|
|
9
|
+
*
|
|
10
|
+
* The suite is split across two files because the "distribute work" test kills nodes as it runs, leaving
|
|
11
|
+
* the cluster unusable; giving it its own file (its own cluster) removes the previous "must run last"
|
|
12
|
+
* ordering contract without changing what any test asserts.
|
|
13
|
+
*/
|
|
14
|
+
import { type AztecNodeConfig, AztecNodeService, createAztecNodeService } from '@aztec/aztec-node';
|
|
15
|
+
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
16
|
+
import { NO_WAIT, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
17
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
18
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
19
|
+
import { type AztecNode, waitForTx } from '@aztec/aztec.js/node';
|
|
20
|
+
import { GovernanceProposerContract } from '@aztec/ethereum/contracts';
|
|
21
|
+
import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
22
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
23
|
+
import { withLoggerBindings } from '@aztec/foundation/log/server';
|
|
24
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
25
|
+
import type { TestDateProvider } from '@aztec/foundation/timer';
|
|
26
|
+
import { TestContract } from '@aztec/noir-test-contracts.js/Test';
|
|
27
|
+
import { TopicType } from '@aztec/stdlib/p2p';
|
|
28
|
+
import { TxHash, type TxReceipt, TxStatus } from '@aztec/stdlib/tx';
|
|
29
|
+
import type { GenesisData } from '@aztec/stdlib/world-state';
|
|
30
|
+
|
|
31
|
+
import getPort, { portNumbers } from 'get-port';
|
|
32
|
+
import { mkdtemp, rm, writeFile } from 'node:fs/promises';
|
|
33
|
+
import { tmpdir } from 'node:os';
|
|
34
|
+
import { join } from 'node:path';
|
|
35
|
+
import { Pool } from 'pg';
|
|
36
|
+
|
|
37
|
+
import { PIPELINING_SETUP_OPTS } from '../../fixtures/fixtures.js';
|
|
38
|
+
import {
|
|
39
|
+
type HADatabaseConfig,
|
|
40
|
+
cleanupHADatabase,
|
|
41
|
+
createHADatabaseConfig,
|
|
42
|
+
createInitialValidatorsFromPrivateKeys,
|
|
43
|
+
getAddressesFromPrivateKeys,
|
|
44
|
+
setupHADatabase,
|
|
45
|
+
} from '../../fixtures/ha_setup.js';
|
|
46
|
+
import { getPrivateKeyFromIndex, setup } from '../../fixtures/utils.js';
|
|
47
|
+
import {
|
|
48
|
+
createWeb3SignerKeystore,
|
|
49
|
+
getWeb3SignerTestKeystoreDir,
|
|
50
|
+
getWeb3SignerUrl,
|
|
51
|
+
refreshWeb3Signer,
|
|
52
|
+
} from '../../fixtures/web3signer.js';
|
|
53
|
+
import type { TestWallet } from '../../test-wallet/test_wallet.js';
|
|
54
|
+
import { proveInteraction } from '../../test-wallet/utils.js';
|
|
55
|
+
|
|
56
|
+
export const NODE_COUNT = 5;
|
|
57
|
+
export const VALIDATOR_COUNT = 4;
|
|
58
|
+
export const COMMITTEE_SIZE = 4;
|
|
59
|
+
|
|
60
|
+
// Allocate p2p listen ports from above the OS ephemeral range (Linux default tops out at 60999) so they
|
|
61
|
+
// never collide with an ephemeral socket the OS may already have handed out -- e.g. the in-process prover
|
|
62
|
+
// node (which listens on p2pPort 0) or any outbound connection. The previous fixed 4040x ports sat inside
|
|
63
|
+
// the ephemeral range, so an ephemeral socket occasionally held a node's port at bind time, surfacing as
|
|
64
|
+
// libp2p ERR_NO_VALID_ADDRESSES and aborting beforeAll. get-port also locks each returned port briefly, so
|
|
65
|
+
// concurrent calls within this process never hand back the same one.
|
|
66
|
+
const getFreeP2PPort = () => getPort({ port: portNumbers(61000, 65535) });
|
|
67
|
+
|
|
68
|
+
export async function registerTestContract(wallet: TestWallet): Promise<TestContract> {
|
|
69
|
+
const instance = await getContractInstanceFromInstantiationParams(TestContract.artifact, {
|
|
70
|
+
constructorArgs: [],
|
|
71
|
+
constructorArtifact: undefined,
|
|
72
|
+
salt: Fr.ZERO,
|
|
73
|
+
publicKeys: undefined,
|
|
74
|
+
deployer: undefined,
|
|
75
|
+
});
|
|
76
|
+
await wallet.registerContract(instance, TestContract.artifact);
|
|
77
|
+
return TestContract.at(instance.address, wallet);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export async function submitTriggerTx(
|
|
81
|
+
wallet: TestWallet,
|
|
82
|
+
testContract: TestContract,
|
|
83
|
+
from: AztecAddress,
|
|
84
|
+
): Promise<TxHash> {
|
|
85
|
+
const tx = await proveInteraction(wallet, testContract.methods.emit_nullifier(Fr.random()), { from });
|
|
86
|
+
return await tx.send({ wait: NO_WAIT });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export async function waitForTriggerTx(node: AztecNode, txHash: TxHash): Promise<TxReceipt> {
|
|
90
|
+
const receipt = await waitForTx(node, txHash, { waitForStatus: TxStatus.CHECKPOINTED });
|
|
91
|
+
if (!receipt.blockNumber) {
|
|
92
|
+
throw new Error('Trigger tx was checkpointed without a block number');
|
|
93
|
+
}
|
|
94
|
+
return receipt;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Owns the full HA cluster lifecycle and the shared helpers the two HA test files drive it with. Each
|
|
99
|
+
* test file constructs one instance and calls {@link setup} in `beforeAll` / {@link teardown} in
|
|
100
|
+
* `afterAll`; state fields are populated by {@link setup} and read directly by the tests.
|
|
101
|
+
*/
|
|
102
|
+
export class HaFullTestContext {
|
|
103
|
+
logger!: Logger;
|
|
104
|
+
wallet!: TestWallet;
|
|
105
|
+
ownerAddress!: AztecAddress;
|
|
106
|
+
testContract!: TestContract;
|
|
107
|
+
aztecNode!: AztecNode;
|
|
108
|
+
config!: AztecNodeConfig;
|
|
109
|
+
accounts!: AztecAddress[];
|
|
110
|
+
dateProvider!: TestDateProvider;
|
|
111
|
+
genesis: GenesisData | undefined;
|
|
112
|
+
|
|
113
|
+
haNodePools!: Pool[]; // Database pools for HA nodes (for cleanup)
|
|
114
|
+
haNodeServices!: AztecNodeService[]; // All N HA peer nodes
|
|
115
|
+
haKeystoreDirs!: string[];
|
|
116
|
+
mainPool!: Pool;
|
|
117
|
+
databaseConfig!: HADatabaseConfig;
|
|
118
|
+
attesterPrivateKeys!: `0x${string}`[];
|
|
119
|
+
attesterAddresses!: string[];
|
|
120
|
+
publisherPrivateKeys!: `0x${string}`[];
|
|
121
|
+
publisherAddresses!: string[];
|
|
122
|
+
web3SignerUrl!: string;
|
|
123
|
+
deployL1ContractsValues!: DeployAztecL1ContractsReturnType;
|
|
124
|
+
governanceProposer!: GovernanceProposerContract;
|
|
125
|
+
/** Per-node initial keystore JSON (all 4 attesters, node's own publisher) for restore after reload test */
|
|
126
|
+
initialKeystoreJsons!: string[];
|
|
127
|
+
|
|
128
|
+
private teardownBootstrap: () => Promise<void> = async () => {};
|
|
129
|
+
private haSequencersStarted = false;
|
|
130
|
+
private readonly stoppedHANodeIndexes = new Set<number>();
|
|
131
|
+
|
|
132
|
+
getSignatureContext = () => ({
|
|
133
|
+
chainId: this.config.l1ChainId,
|
|
134
|
+
rollupAddress: this.deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
startHASequencers = async () => {
|
|
138
|
+
if (this.haSequencersStarted) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
await Promise.all(
|
|
143
|
+
this.haNodeServices.map(async (service, i) => {
|
|
144
|
+
this.logger.info(`Starting HA peer node ${i} sequencer`);
|
|
145
|
+
await service.getSequencer()?.start();
|
|
146
|
+
}),
|
|
147
|
+
);
|
|
148
|
+
this.haSequencersStarted = true;
|
|
149
|
+
this.logger.info('All HA peer sequencers started');
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
sendTriggerTx = async (): Promise<TxReceipt> => {
|
|
153
|
+
await this.startHASequencers();
|
|
154
|
+
const txHash = await submitTriggerTx(this.wallet, this.testContract, this.ownerAddress);
|
|
155
|
+
return await waitForTriggerTx(this.aztecNode, txHash);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
stopHANode = async (nodeIndex: number) => {
|
|
159
|
+
if (this.stoppedHANodeIndexes.has(nodeIndex)) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
this.logger.info(`Stopping HA peer node ${nodeIndex}`);
|
|
164
|
+
await this.haNodeServices[nodeIndex].stop();
|
|
165
|
+
this.stoppedHANodeIndexes.add(nodeIndex);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
async setup(): Promise<void> {
|
|
169
|
+
// Check required environment variables
|
|
170
|
+
if (!process.env.DATABASE_URL) {
|
|
171
|
+
throw new Error('DATABASE_URL environment variable must be set for HA tests');
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
this.web3SignerUrl = getWeb3SignerUrl();
|
|
175
|
+
if (!this.web3SignerUrl) {
|
|
176
|
+
throw new Error('WEB3_SIGNER_URL environment variable must be set for HA tests');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Setup database configuration
|
|
180
|
+
this.databaseConfig = createHADatabaseConfig('ha-full-test');
|
|
181
|
+
|
|
182
|
+
// Connect to database (migrations already run by docker-compose entrypoint)
|
|
183
|
+
this.mainPool = setupHADatabase(this.databaseConfig.databaseUrl.getValue()!);
|
|
184
|
+
|
|
185
|
+
this.attesterPrivateKeys = Array.from(
|
|
186
|
+
{ length: VALIDATOR_COUNT },
|
|
187
|
+
(_, i) => `0x${getPrivateKeyFromIndex(i)!.toString('hex')}` as `0x${string}`,
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
this.publisherPrivateKeys = Array.from(
|
|
191
|
+
{ length: NODE_COUNT },
|
|
192
|
+
(_, i) => `0x${getPrivateKeyFromIndex(i + VALIDATOR_COUNT)!.toString('hex')}` as `0x${string}`,
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
const web3SignerDir = getWeb3SignerTestKeystoreDir();
|
|
196
|
+
const allKeys = [...this.attesterPrivateKeys, ...this.publisherPrivateKeys];
|
|
197
|
+
for (const key of allKeys) {
|
|
198
|
+
await createWeb3SignerKeystore(web3SignerDir, key);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
this.attesterAddresses = getAddressesFromPrivateKeys(this.attesterPrivateKeys);
|
|
202
|
+
|
|
203
|
+
this.publisherAddresses = getAddressesFromPrivateKeys(this.publisherPrivateKeys);
|
|
204
|
+
|
|
205
|
+
// Refresh Web3Signer to load all the keys (attesters + publishers)
|
|
206
|
+
await refreshWeb3Signer(this.web3SignerUrl, ...this.attesterAddresses, ...this.publisherAddresses);
|
|
207
|
+
|
|
208
|
+
// Create database pools for HA nodes
|
|
209
|
+
this.haNodePools = Array.from({ length: NODE_COUNT }, () => {
|
|
210
|
+
const pool = new Pool({ connectionString: this.databaseConfig.databaseUrl.getValue()! });
|
|
211
|
+
// pg-pool re-emits idle-client errors on the pool; with no listener the emit throws - in production this
|
|
212
|
+
// crashes the validator process.
|
|
213
|
+
pool.on('error', (err: Error) => this.logger?.warn(`HA node pool error: ${err.message}`));
|
|
214
|
+
return pool;
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
const initialValidators = createInitialValidatorsFromPrivateKeys(this.attesterPrivateKeys);
|
|
218
|
+
|
|
219
|
+
const bootstrapP2PPort = await getFreeP2PPort();
|
|
220
|
+
|
|
221
|
+
({
|
|
222
|
+
teardown: this.teardownBootstrap,
|
|
223
|
+
logger: this.logger,
|
|
224
|
+
wallet: this.wallet,
|
|
225
|
+
aztecNode: this.aztecNode,
|
|
226
|
+
config: this.config,
|
|
227
|
+
accounts: this.accounts,
|
|
228
|
+
dateProvider: this.dateProvider,
|
|
229
|
+
deployL1ContractsValues: this.deployL1ContractsValues,
|
|
230
|
+
genesis: this.genesis,
|
|
231
|
+
} = await setup(
|
|
232
|
+
// A single default initializerless account, created/funded/registered by setup with no on-chain
|
|
233
|
+
// deploy tx -- the bootstrap node can't build blocks (disableValidator), so the owner must be usable
|
|
234
|
+
// without one.
|
|
235
|
+
1,
|
|
236
|
+
{
|
|
237
|
+
...PIPELINING_SETUP_OPTS,
|
|
238
|
+
automineL1Setup: true,
|
|
239
|
+
initialValidators,
|
|
240
|
+
sequencerPublisherPrivateKeys: [new SecretValue(this.publisherPrivateKeys[0])],
|
|
241
|
+
aztecTargetCommitteeSize: COMMITTEE_SIZE,
|
|
242
|
+
// The full HA docker/Web3Signer stack can still be joining and syncing after the shared
|
|
243
|
+
// 12s pipelining preset's 2.5s start window has closed. Keep real sequencing, but give
|
|
244
|
+
// HA validators enough time to pass the enforced build-start gate in CI.
|
|
245
|
+
aztecSlotDuration: 16,
|
|
246
|
+
// This suite validates HA coordination on tx-bearing checkpoints. Requiring one tx avoids a startup empty
|
|
247
|
+
// checkpoint from occupying the shared HA publisher while the trigger tx is still being prepared.
|
|
248
|
+
minTxsPerBlock: 1,
|
|
249
|
+
archiverPollingIntervalMS: 200,
|
|
250
|
+
sequencerPollingIntervalMS: 200,
|
|
251
|
+
worldStateBlockCheckIntervalMS: 200,
|
|
252
|
+
blockCheckIntervalMS: 200,
|
|
253
|
+
startProverNode: true,
|
|
254
|
+
// The bootstrap node is only an RPC/P2P anchor. HA validators are the first block producers in this suite.
|
|
255
|
+
disableValidator: true,
|
|
256
|
+
// Enable P2P for transaction gossip
|
|
257
|
+
p2pEnabled: true,
|
|
258
|
+
// Bind the bootstrap node above the ephemeral range too (see getFreeP2PPort), so it can't lose
|
|
259
|
+
// its port to an ephemeral socket and abort the whole suite before any HA node is created. Set
|
|
260
|
+
// the broadcast port explicitly to the same value: discv5 otherwise defaults p2pBroadcastPort to
|
|
261
|
+
// p2pPort by mutating this config object in place, and that mutated value would then leak into the
|
|
262
|
+
// HA nodes' configs below (built by spreading `config`), making them advertise the wrong port.
|
|
263
|
+
p2pPort: bootstrapP2PPort,
|
|
264
|
+
p2pBroadcastPort: bootstrapP2PPort,
|
|
265
|
+
// Enable slashing for testing governance + slashing vote coordination
|
|
266
|
+
slasherEnabled: true,
|
|
267
|
+
slashingRoundSizeInEpochs: 1, // 32 slots (1 epoch)
|
|
268
|
+
slashingQuorum: 17, // >50% of 32 slots for tally quorum,
|
|
269
|
+
},
|
|
270
|
+
{ syncChainTip: 'proven' },
|
|
271
|
+
));
|
|
272
|
+
|
|
273
|
+
this.ownerAddress = this.accounts[0];
|
|
274
|
+
this.testContract = await registerTestContract(this.wallet);
|
|
275
|
+
|
|
276
|
+
if (!this.dateProvider) {
|
|
277
|
+
throw new Error('dateProvider must be provided by setup for HA tests');
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
this.logger.info(
|
|
281
|
+
'Bootstrap node setup complete; funded initializerless account and test contract registered locally',
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
// Get bootstrap node's P2P ENR for HA nodes to connect to
|
|
285
|
+
const bootstrapNodeEnr = await this.aztecNode.getEncodedEnr();
|
|
286
|
+
if (!bootstrapNodeEnr) {
|
|
287
|
+
throw new Error('Failed to get bootstrap node ENR - P2P may not be enabled');
|
|
288
|
+
}
|
|
289
|
+
this.logger.info(`Bootstrap node ENR: ${bootstrapNodeEnr}`);
|
|
290
|
+
|
|
291
|
+
// L1 contract wrappers for querying votes
|
|
292
|
+
this.governanceProposer = new GovernanceProposerContract(
|
|
293
|
+
this.deployL1ContractsValues.l1Client,
|
|
294
|
+
this.deployL1ContractsValues.l1ContractAddresses.governanceProposerAddress.toString(),
|
|
295
|
+
);
|
|
296
|
+
this.logger.info('L1 contract wrappers initialized');
|
|
297
|
+
|
|
298
|
+
this.haNodeServices = [];
|
|
299
|
+
this.haKeystoreDirs = [];
|
|
300
|
+
this.logger.info(`Starting ${NODE_COUNT} HA peer nodes...`);
|
|
301
|
+
|
|
302
|
+
// Per-node keystore: all attesters but only this node's publisher to avoid nonce conflicts.
|
|
303
|
+
// When keyStoreDirectory is set the node loads validators/publishers from file only, so we omit them from config.
|
|
304
|
+
this.initialKeystoreJsons = [];
|
|
305
|
+
|
|
306
|
+
for (let i = 0; i < NODE_COUNT; i++) {
|
|
307
|
+
const nodeId = `${this.databaseConfig.nodeId}-${i + 1}`;
|
|
308
|
+
this.logger.info(`Starting HA peer node ${i} with nodeId: ${nodeId}`);
|
|
309
|
+
|
|
310
|
+
const keystoreContent = {
|
|
311
|
+
schemaVersion: 1,
|
|
312
|
+
validators: [
|
|
313
|
+
{
|
|
314
|
+
attester: this.attesterAddresses,
|
|
315
|
+
feeRecipient: AztecAddress.ZERO.toString(),
|
|
316
|
+
coinbase: EthAddress.fromString(this.attesterAddresses[0]).toChecksumString(),
|
|
317
|
+
remoteSigner: this.web3SignerUrl,
|
|
318
|
+
publisher: [this.publisherAddresses[i]],
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
};
|
|
322
|
+
const keystoreJson = JSON.stringify(keystoreContent, null, 2);
|
|
323
|
+
this.initialKeystoreJsons.push(keystoreJson);
|
|
324
|
+
|
|
325
|
+
const keystoreDir = await mkdtemp(join(tmpdir(), `ha-keystore-${i}-`));
|
|
326
|
+
this.haKeystoreDirs.push(keystoreDir);
|
|
327
|
+
await writeFile(join(keystoreDir, 'keystore.json'), keystoreJson);
|
|
328
|
+
|
|
329
|
+
const dataDirectory = this.config.dataDirectory ? `${this.config.dataDirectory}-${i}` : undefined;
|
|
330
|
+
|
|
331
|
+
const nodeP2PPort = await getFreeP2PPort();
|
|
332
|
+
const nodeConfig: AztecNodeConfig = {
|
|
333
|
+
...this.config,
|
|
334
|
+
nodeId,
|
|
335
|
+
keyStoreDirectory: keystoreDir,
|
|
336
|
+
// Ensure txs are included in proposals to test full signing path
|
|
337
|
+
publishTxsWithProposals: true,
|
|
338
|
+
dataDirectory,
|
|
339
|
+
databaseUrl: this.databaseConfig.databaseUrl,
|
|
340
|
+
pollingIntervalMs: this.databaseConfig.pollingIntervalMs,
|
|
341
|
+
peerSigningTimeoutMs: this.databaseConfig.peerSigningTimeoutMs,
|
|
342
|
+
maxStuckDutiesAgeMs: this.databaseConfig.maxStuckDutiesAgeMs,
|
|
343
|
+
haSigningEnabled: true,
|
|
344
|
+
disableValidator: false,
|
|
345
|
+
// Enable P2P for transaction and block gossip
|
|
346
|
+
p2pEnabled: true,
|
|
347
|
+
// Each HA node gets its own free port above the ephemeral range. Override the broadcast port too:
|
|
348
|
+
// `...config` carries the bootstrap node's broadcast port (discv5 sets it in place), which would
|
|
349
|
+
// otherwise make every HA node advertise the bootstrap's port instead of its own.
|
|
350
|
+
p2pPort: nodeP2PPort,
|
|
351
|
+
p2pBroadcastPort: nodeP2PPort,
|
|
352
|
+
// Connect to bootstrap node for tx gossip
|
|
353
|
+
bootstrapNodes: [bootstrapNodeEnr],
|
|
354
|
+
web3SignerUrl: this.web3SignerUrl,
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
const nodeService = await withLoggerBindings({ actor: `HA-${i}` }, async () => {
|
|
358
|
+
return await createAztecNodeService(
|
|
359
|
+
nodeConfig,
|
|
360
|
+
{ dateProvider: this.dateProvider },
|
|
361
|
+
{ genesis: this.genesis, dontStartSequencer: true },
|
|
362
|
+
);
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
this.haNodeServices.push(nodeService);
|
|
366
|
+
this.logger.info(`HA peer node ${i} started successfully`);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
this.logger.info(`All ${NODE_COUNT} HA peer nodes started and coordinating via PostgreSQL database`);
|
|
370
|
+
this.logger.info('Waiting for HA peer nodes to join the tx gossip mesh');
|
|
371
|
+
await retryUntil(
|
|
372
|
+
async () => {
|
|
373
|
+
const meshStates = await Promise.all(
|
|
374
|
+
this.haNodeServices.map(async (service, nodeIndex) => {
|
|
375
|
+
const p2p = service.getP2P();
|
|
376
|
+
const [peers, txMeshPeerCount] = await Promise.all([
|
|
377
|
+
p2p.getPeers(),
|
|
378
|
+
p2p.getGossipMeshPeerCount(TopicType.tx),
|
|
379
|
+
]);
|
|
380
|
+
|
|
381
|
+
return { nodeIndex, peerCount: peers.length, txMeshPeerCount };
|
|
382
|
+
}),
|
|
383
|
+
);
|
|
384
|
+
|
|
385
|
+
this.logger.debug('HA tx gossip mesh status', { meshStates });
|
|
386
|
+
return meshStates.every(({ peerCount, txMeshPeerCount }) => peerCount > 0 && txMeshPeerCount > 0)
|
|
387
|
+
? true
|
|
388
|
+
: undefined;
|
|
389
|
+
},
|
|
390
|
+
'HA tx gossip mesh readiness',
|
|
391
|
+
60,
|
|
392
|
+
1,
|
|
393
|
+
);
|
|
394
|
+
|
|
395
|
+
// The owner is an initializerless account, so it needs no deployment tx -- it was funded at genesis
|
|
396
|
+
// and registered during setup, and is ready to transact as soon as the HA nodes start building blocks.
|
|
397
|
+
this.logger.info(`Test account ready at ${this.ownerAddress}`);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
async teardown(): Promise<void> {
|
|
401
|
+
// Stop all sequencers before tearing down the nodes: a sequencer stop awaits its in-flight
|
|
402
|
+
// iteration, which can spend tens of seconds finishing a vote or checkpoint publish on L1.
|
|
403
|
+
// Stops must be awaited fully — jest runs without forceExit, so a node abandoned mid-stop
|
|
404
|
+
// outlives the test environment and keeps the worker process alive until the CI job timeout.
|
|
405
|
+
// The dateProvider reset must wait until nodes are stopped: it rewinds the shared clock from
|
|
406
|
+
// chain time to wall time (minutes apart after the automine deploy burst), and any publisher
|
|
407
|
+
// deadline armed against the rewound clock would block shutdown until wall time catches up.
|
|
408
|
+
if (this.haNodeServices) {
|
|
409
|
+
await Promise.allSettled(
|
|
410
|
+
this.haNodeServices.map(async (service, i) => {
|
|
411
|
+
try {
|
|
412
|
+
await service.getSequencer()?.stop();
|
|
413
|
+
} catch (error) {
|
|
414
|
+
this.logger.error(`Failed to stop sequencer of HA peer node ${i}: ${error}`);
|
|
415
|
+
}
|
|
416
|
+
}),
|
|
417
|
+
);
|
|
418
|
+
await Promise.allSettled(
|
|
419
|
+
this.haNodeServices.map((_, i) =>
|
|
420
|
+
this.stopHANode(i).catch(error => {
|
|
421
|
+
this.logger.error(`Failed to stop HA peer node ${i}: ${error}`);
|
|
422
|
+
}),
|
|
423
|
+
),
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
this.dateProvider?.reset();
|
|
428
|
+
|
|
429
|
+
// Cleanup HA keystore temp directories
|
|
430
|
+
if (this.haKeystoreDirs) {
|
|
431
|
+
for (let i = 0; i < this.haKeystoreDirs.length; i++) {
|
|
432
|
+
try {
|
|
433
|
+
await rm(this.haKeystoreDirs[i], { recursive: true });
|
|
434
|
+
} catch (error) {
|
|
435
|
+
this.logger.error(`Failed to remove HA keystore dir ${i}: ${error}`);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// Cleanup HA resources (database pools, etc.)
|
|
441
|
+
if (this.haNodePools) {
|
|
442
|
+
for (const pool of this.haNodePools) {
|
|
443
|
+
try {
|
|
444
|
+
await pool.end();
|
|
445
|
+
} catch (error) {
|
|
446
|
+
this.logger.error(`Failed to close HA node pool: ${error}`);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
await cleanupHADatabase(this.mainPool, this.logger);
|
|
451
|
+
await this.mainPool.end();
|
|
452
|
+
|
|
453
|
+
// Cleanup bootstrap node and test infrastructure (this cleans up the shared data directory)
|
|
454
|
+
await this.teardownBootstrap();
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/** Clean up database state between tests. */
|
|
458
|
+
async resetDutiesTable(): Promise<void> {
|
|
459
|
+
try {
|
|
460
|
+
await this.mainPool.query('DELETE FROM validator_duties');
|
|
461
|
+
} catch (error) {
|
|
462
|
+
// Ignore cleanup errors (table might not exist on first run failure)
|
|
463
|
+
this.logger?.warn(`Failed to clean up validator_duties: ${error}`);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { getAddressFromPrivateKey } from '@aztec/ethereum';
|
|
2
|
+
import { getAddressFromPrivateKey } from '@aztec/ethereum/account';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import type { EthPrivateKey } from '@aztec/node-keystore';
|
|
5
5
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ContractFunctionInteraction,
|
|
3
|
+
SendInteractionOptions,
|
|
4
|
+
SimulateInteractionOptions,
|
|
5
|
+
} from '@aztec/aztec.js/contracts';
|
|
6
|
+
import type { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Builds a proxy forwarding call from an action, selecting the right forward_private_N method.
|
|
10
|
+
*/
|
|
11
|
+
async function buildProxyCall(proxy: GenericProxyContract, action: ContractFunctionInteraction) {
|
|
12
|
+
const call = await action.getFunctionCall();
|
|
13
|
+
const argCount = call.args.length;
|
|
14
|
+
if (argCount === 2) {
|
|
15
|
+
return proxy.methods.forward_private_2(call.to, call.selector, call.args);
|
|
16
|
+
} else if (argCount === 3) {
|
|
17
|
+
return proxy.methods.forward_private_3(call.to, call.selector, call.args);
|
|
18
|
+
} else if (argCount === 4) {
|
|
19
|
+
return proxy.methods.forward_private_4(call.to, call.selector, call.args);
|
|
20
|
+
} else if (argCount === 5) {
|
|
21
|
+
return proxy.methods.forward_private_5(call.to, call.selector, call.args);
|
|
22
|
+
} else if (argCount === 6) {
|
|
23
|
+
return proxy.methods.forward_private_6(call.to, call.selector, call.args);
|
|
24
|
+
}
|
|
25
|
+
throw new Error(`No forward_private_${argCount} method on proxy`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Sends a contract call through the authwit proxy.
|
|
30
|
+
* The proxy becomes msg_sender in the target (triggering authwit validation),
|
|
31
|
+
* while the actual tx sender retains their keys in scope.
|
|
32
|
+
*/
|
|
33
|
+
export async function sendThroughAuthwitProxy(
|
|
34
|
+
proxy: GenericProxyContract,
|
|
35
|
+
action: ContractFunctionInteraction,
|
|
36
|
+
options: SendInteractionOptions,
|
|
37
|
+
) {
|
|
38
|
+
const proxyCall = await buildProxyCall(proxy, action);
|
|
39
|
+
return proxyCall.send(options);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Simulates a contract call through the authwit proxy.
|
|
44
|
+
* The proxy becomes msg_sender in the target (triggering authwit validation),
|
|
45
|
+
* while the actual tx sender retains their keys in scope.
|
|
46
|
+
*/
|
|
47
|
+
export async function simulateThroughAuthwitProxy(
|
|
48
|
+
proxy: GenericProxyContract,
|
|
49
|
+
action: ContractFunctionInteraction,
|
|
50
|
+
options: SimulateInteractionOptions,
|
|
51
|
+
) {
|
|
52
|
+
const proxyCall = await buildProxyCall(proxy, action);
|
|
53
|
+
return proxyCall.simulate(options);
|
|
54
|
+
}
|