@aztec/end-to-end 0.0.1-commit.d431d1c → 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/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.js +50 -54
- package/dest/automine/token/token_contract_test.d.ts +40 -0
- package/dest/automine/token/token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_token_contract → automine/token}/token_contract_test.js +44 -49
- package/dest/automine/token/token_test_helpers.d.ts +73 -0
- package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
- package/dest/automine/token/token_test_helpers.js +97 -0
- package/dest/bench/client_flows/benchmark.d.ts +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +19 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +6 -6
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +68 -44
- 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 +1 -0
- package/dest/bench/utils.d.ts +7 -6
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +108 -12
- package/dest/composed/ha/ha_full_setup.d.ts +77 -0
- package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
- package/dest/composed/ha/ha_full_setup.js +383 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.d.ts +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 +18 -14
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +85 -74
- package/dest/fixtures/elu_monitor.d.ts +21 -0
- package/dest/fixtures/elu_monitor.d.ts.map +1 -0
- package/dest/fixtures/elu_monitor.js +102 -0
- package/dest/fixtures/fixtures.d.ts +83 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +86 -0
- 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/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 +113 -60
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +330 -326
- 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 +46 -35
- 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 +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- package/dest/fixtures/wait_helpers.d.ts +135 -0
- package/dest/fixtures/wait_helpers.d.ts.map +1 -0
- package/dest/fixtures/wait_helpers.js +154 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/install_legacy_contracts.d.cts +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 +22 -12
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.js +99 -35
- 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/shared/cross_chain_test_harness.d.ts +8 -7
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +44 -39
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +27 -15
- package/dest/shared/index.d.ts +2 -1
- 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 +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +67 -55
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +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 +18 -5
- 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/{e2e_fees → single-node/fees}/fees_test.js +96 -70
- 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 +12 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +153 -49
- package/dest/spartan/tx_metrics.d.ts +64 -5
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +280 -21
- 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 -260
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -942
- 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 +53 -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/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +56 -69
- package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +51 -59
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +21 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +111 -90
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +1 -0
- package/src/bench/utils.ts +123 -12
- package/src/composed/ha/ha_full_setup.ts +466 -0
- 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 +102 -103
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +110 -0
- 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/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +421 -444
- package/src/fixtures/setup_p2p_test.ts +54 -54
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +46 -10
- package/src/fixtures/utils.ts +2 -3
- package/src/fixtures/wait_helpers.ts +333 -0
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +106 -0
- package/src/guides/up_quick_start.sh +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/{e2e_p2p → p2p}/p2p_network.ts +132 -57
- package/src/p2p/reqresp/utils.ts +263 -0
- package/src/p2p/shared.ts +329 -0
- package/src/shared/cross_chain_test_harness.ts +52 -41
- package/src/shared/gas_portal_test_harness.ts +34 -16
- package/src/shared/index.ts +1 -0
- 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 +109 -74
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +35 -17
- 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 +20 -9
- package/src/{e2e_fees → single-node/fees}/fees_test.ts +120 -95
- 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 +208 -34
- package/src/spartan/tx_metrics.ts +255 -26
- 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 -1246
- 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 -53
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -47
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -128
- package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -37
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
- package/dest/e2e_deploy_contract/deploy_test.js +0 -50
- package/dest/e2e_epochs/epochs_test.d.ts +0 -94
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -339
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -88
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_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 -62
- package/dest/e2e_multi_validator/utils.d.ts +0 -12
- package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -26
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +0 -56
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +0 -136
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/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 -42
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -194
- package/src/e2e_deploy_contract/deploy_test.ts +0 -85
- package/src/e2e_epochs/epochs_test.ts +0 -451
- package/src/e2e_l1_publisher/write_json.ts +0 -82
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -75
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -179
- package/src/e2e_p2p/shared.ts +0 -290
- /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
- /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { appendFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { basename } from 'node:path';
|
|
3
|
+
|
|
4
|
+
import CustomEnvironment from '../../../foundation/src/jest/env.mjs';
|
|
5
|
+
|
|
6
|
+
// Per-test e2e timing environment. Gated entirely on the TEST_TIMING_FILE env var: when unset, this
|
|
7
|
+
// behaves exactly like the base CustomEnvironment (it only delegates). When set, it records, per test
|
|
8
|
+
// worker process, the time spent in jest before/after hooks and the test body, and folds in the named
|
|
9
|
+
// spans recorded via the `testSpan()` wrapper (fixtures/timing.ts) through a collector shared on
|
|
10
|
+
// `this.global`.
|
|
11
|
+
//
|
|
12
|
+
// Output is one JSONL file per worker process (the env runs once per worker). Each line carries a
|
|
13
|
+
// `type` discriminator and is one of:
|
|
14
|
+
// - `type: 'test'` (`name` set): beforeEach hooks, the it() body, afterEach hooks for one test; or
|
|
15
|
+
// - `type: 'suite'` (`name: null`): the suite-scoped beforeAll/afterAll hooks for the whole file.
|
|
16
|
+
//
|
|
17
|
+
// Each line also gains a `spans` map: per `category:label` tag the test/suite touched, the collector
|
|
18
|
+
// records `{ count, totalMs, busyMs, maxMs }`. `busyMs` is the duration of the union of the spans'
|
|
19
|
+
// `[start, end)` intervals on the shared `performance.now()` clock, so concurrent spans (Promise.all
|
|
20
|
+
// fan-out) do not inflate it the way `totalMs` does. The legacy `setupFnMs`/`teardownFnMs` fields are
|
|
21
|
+
// kept for back-compat, derived from the `setup:env`/`teardown:env` spans.
|
|
22
|
+
//
|
|
23
|
+
// When `TEST_TIMING_SPANS=1`, the collector additionally retains every raw span occurrence and emits
|
|
24
|
+
// one `type:"span"` line per occurrence (owner, name, ms) for deep dives, at the cost of a larger file.
|
|
25
|
+
export default class TimingEnvironment extends CustomEnvironment {
|
|
26
|
+
constructor(config, context) {
|
|
27
|
+
super(config, context);
|
|
28
|
+
|
|
29
|
+
this.timingFile = process.env.TEST_TIMING_FILE;
|
|
30
|
+
if (!this.timingFile) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
this.suite = basename(context?.testPath ?? config?.testPath ?? 'unknown').replace(/\.test\.[cm]?[jt]s$/, '');
|
|
35
|
+
this.meta = {
|
|
36
|
+
commit: process.env.COMMIT_HASH ?? null,
|
|
37
|
+
branch: process.env.TARGET_BRANCH ?? process.env.REF_NAME ?? null,
|
|
38
|
+
runId: process.env.RUN_ID ?? null,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Opt-in per-occurrence emission for deep dives (off by default keeps the JSONL one line per test).
|
|
42
|
+
this.emitSpanLines = process.env.TEST_TIMING_SPANS === '1';
|
|
43
|
+
|
|
44
|
+
// Shared collector. The instrumented helpers (running in the sandbox realm) read
|
|
45
|
+
// `globalThis.__e2eTimings`; this env (host realm) reads `this.global.__e2eTimings` — they are the
|
|
46
|
+
// same object. `current` is the full name of the test currently running (null during
|
|
47
|
+
// beforeAll/afterAll), used to attribute each span to a test or to the suite-scoped line. `spans`
|
|
48
|
+
// accumulates every recorded span until flush. The `start`/`end` timestamps come from the sandbox
|
|
49
|
+
// realm's `performance.now()`; Node's perf clock is process-wide (one monotonic origin across all
|
|
50
|
+
// realms), so merging the intervals here for `busyMs` is valid.
|
|
51
|
+
this.collector = { current: null, spans: [] };
|
|
52
|
+
this.global.__e2eTimings = this.collector;
|
|
53
|
+
|
|
54
|
+
// Records to flush as JSONL on teardown. One per test plus one suite-scoped record.
|
|
55
|
+
this.records = [];
|
|
56
|
+
this.recordsByName = new Map();
|
|
57
|
+
// The suite-scoped record (beforeAll/afterAll); bodyMs/totalMs are computed at flush time.
|
|
58
|
+
this.suiteRecord = { name: null, status: 'passed', beforeHooksMs: 0, afterHooksMs: 0 };
|
|
59
|
+
// Start times keyed by hook type (beforeAll/beforeEach/afterAll/afterEach).
|
|
60
|
+
this.hookStarts = {};
|
|
61
|
+
this.testStarts = new Map();
|
|
62
|
+
// Guards against double-flushing (we flush on both the teardown event and the teardown method).
|
|
63
|
+
this.flushed = false;
|
|
64
|
+
// Raw per-occurrence spans retained only when TEST_TIMING_SPANS=1, emitted as `type:"span"` lines.
|
|
65
|
+
this.rawSpans = [];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Flush on the teardown method too: the jest lifecycle always calls this, whereas the 'teardown'
|
|
69
|
+
// event is not reliably delivered when a test run is interrupted. Whichever fires first wins.
|
|
70
|
+
async teardown() {
|
|
71
|
+
this.finalizeAndFlush();
|
|
72
|
+
await super.teardown();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async handleTestEvent(event, state) {
|
|
76
|
+
// Run the base env first so its unhandledRejection patching for after-hooks stays intact.
|
|
77
|
+
await super.handleTestEvent(event, state);
|
|
78
|
+
|
|
79
|
+
if (!this.timingFile) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const now = Date.now();
|
|
84
|
+
switch (event.name) {
|
|
85
|
+
case 'hook_start': {
|
|
86
|
+
this.hookStarts[event.hook.type] = now;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
case 'hook_success':
|
|
90
|
+
case 'hook_failure': {
|
|
91
|
+
const start = this.hookStarts[event.hook.type];
|
|
92
|
+
if (start === undefined) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
delete this.hookStarts[event.hook.type];
|
|
96
|
+
const ms = now - start;
|
|
97
|
+
if (event.hook.type === 'beforeEach') {
|
|
98
|
+
this.addToCurrent('beforeHooksMs', ms);
|
|
99
|
+
} else if (event.hook.type === 'afterEach') {
|
|
100
|
+
this.addToCurrent('afterHooksMs', ms);
|
|
101
|
+
} else if (event.hook.type === 'beforeAll') {
|
|
102
|
+
this.suiteRecord.beforeHooksMs += ms;
|
|
103
|
+
} else if (event.hook.type === 'afterAll') {
|
|
104
|
+
this.suiteRecord.afterHooksMs += ms;
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case 'test_start': {
|
|
109
|
+
const name = this.fullTestName(event.test);
|
|
110
|
+
const record = {
|
|
111
|
+
type: 'test',
|
|
112
|
+
name,
|
|
113
|
+
status: 'passed',
|
|
114
|
+
setupFnMs: 0,
|
|
115
|
+
beforeHooksMs: 0,
|
|
116
|
+
bodyMs: 0,
|
|
117
|
+
teardownFnMs: 0,
|
|
118
|
+
afterHooksMs: 0,
|
|
119
|
+
totalMs: 0,
|
|
120
|
+
startedAt: new Date(now).toISOString(),
|
|
121
|
+
};
|
|
122
|
+
this.records.push(record);
|
|
123
|
+
this.recordsByName.set(name, record);
|
|
124
|
+
this.testStarts.set(name, now);
|
|
125
|
+
this.collector.current = name;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
case 'test_fn_start': {
|
|
129
|
+
this.testStarts.set(`fn:${this.fullTestName(event.test)}`, now);
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
case 'test_fn_success':
|
|
133
|
+
case 'test_fn_failure': {
|
|
134
|
+
const name = this.fullTestName(event.test);
|
|
135
|
+
const start = this.testStarts.get(`fn:${name}`);
|
|
136
|
+
const record = this.recordsByName.get(name);
|
|
137
|
+
if (record && start !== undefined) {
|
|
138
|
+
record.bodyMs = now - start;
|
|
139
|
+
}
|
|
140
|
+
if (record && event.name === 'test_fn_failure') {
|
|
141
|
+
record.status = 'failed';
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
case 'test_done': {
|
|
146
|
+
const name = this.fullTestName(event.test);
|
|
147
|
+
const record = this.recordsByName.get(name);
|
|
148
|
+
const start = this.testStarts.get(name);
|
|
149
|
+
if (record && start !== undefined) {
|
|
150
|
+
record.totalMs = now - start;
|
|
151
|
+
}
|
|
152
|
+
if (record && event.test?.errors?.length) {
|
|
153
|
+
record.status = 'failed';
|
|
154
|
+
}
|
|
155
|
+
this.collector.current = null;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
case 'teardown': {
|
|
159
|
+
this.finalizeAndFlush();
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
default:
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** The record for the test currently running, if any. */
|
|
168
|
+
currentRecord() {
|
|
169
|
+
return this.collector.current ? this.recordsByName.get(this.collector.current) : undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Adds `ms` to a hook bucket on the current per-test record, or the suite record during beforeAll/afterAll. */
|
|
173
|
+
addToCurrent(field, ms) {
|
|
174
|
+
const record = this.currentRecord();
|
|
175
|
+
if (record) {
|
|
176
|
+
record[field] += ms;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Builds the full test name by walking up the describe blocks, matching jest's currentTestName. */
|
|
181
|
+
fullTestName(test) {
|
|
182
|
+
if (!test) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
const parts = [];
|
|
186
|
+
let node = test;
|
|
187
|
+
while (node && node.name && node.name !== 'ROOT_DESCRIBE_BLOCK') {
|
|
188
|
+
parts.unshift(node.name);
|
|
189
|
+
node = node.parent;
|
|
190
|
+
}
|
|
191
|
+
return parts.join(' ');
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** Folds the collected spans into the per-test / suite records via {@link foldSpansInto}, then drains the collector. */
|
|
195
|
+
foldSpans() {
|
|
196
|
+
const rawSpans = foldSpansInto(this.collector.spans, {
|
|
197
|
+
recordsByName: this.recordsByName,
|
|
198
|
+
suiteRecord: this.suiteRecord,
|
|
199
|
+
emitSpanLines: this.emitSpanLines,
|
|
200
|
+
});
|
|
201
|
+
this.rawSpans.push(...rawSpans);
|
|
202
|
+
this.collector.spans = [];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Folds spans into records, finalizes the suite-scoped record, and writes all JSONL. */
|
|
206
|
+
finalizeAndFlush() {
|
|
207
|
+
if (this.flushed || !this.timingFile) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
this.flushed = true;
|
|
211
|
+
this.foldSpans();
|
|
212
|
+
|
|
213
|
+
const lines = [];
|
|
214
|
+
for (const record of this.records) {
|
|
215
|
+
lines.push(this.toLine({ ...record }));
|
|
216
|
+
}
|
|
217
|
+
lines.push(
|
|
218
|
+
this.toLine({
|
|
219
|
+
type: 'suite',
|
|
220
|
+
name: null,
|
|
221
|
+
status: 'passed',
|
|
222
|
+
setupFnMs: this.suiteRecord.setupFnMs ?? 0,
|
|
223
|
+
beforeHooksMs: this.suiteRecord.beforeHooksMs,
|
|
224
|
+
teardownFnMs: this.suiteRecord.teardownFnMs ?? 0,
|
|
225
|
+
afterHooksMs: this.suiteRecord.afterHooksMs,
|
|
226
|
+
totalMs: this.suiteRecord.beforeHooksMs + this.suiteRecord.afterHooksMs,
|
|
227
|
+
spans: this.suiteRecord.spans,
|
|
228
|
+
}),
|
|
229
|
+
);
|
|
230
|
+
for (const raw of this.rawSpans) {
|
|
231
|
+
lines.push(this.toLine({ type: 'span', name: raw.owner, span: raw.name, ms: raw.ms }));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const payload = lines.join('\n') + '\n';
|
|
235
|
+
try {
|
|
236
|
+
// One file per worker process, but a worker may run several suites: append so we keep them all.
|
|
237
|
+
appendFileSync(this.timingFile, payload);
|
|
238
|
+
} catch {
|
|
239
|
+
try {
|
|
240
|
+
writeFileSync(this.timingFile, payload);
|
|
241
|
+
} catch {
|
|
242
|
+
// Timing is best-effort; never fail a test because we couldn't write the file.
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Flattens metadata onto a record and serializes to a single JSON line, rounding all Ms fields. */
|
|
248
|
+
toLine(record) {
|
|
249
|
+
const obj = { suite: this.suite, ...record, ...this.meta };
|
|
250
|
+
for (const key of Object.keys(obj)) {
|
|
251
|
+
if (key.endsWith('Ms') && typeof obj[key] === 'number') {
|
|
252
|
+
obj[key] = Math.round(obj[key]);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// Round the nested span aggregates' Ms fields too (totalMs/busyMs/maxMs per tag).
|
|
256
|
+
if (obj.spans && typeof obj.spans === 'object') {
|
|
257
|
+
for (const agg of Object.values(obj.spans)) {
|
|
258
|
+
for (const key of Object.keys(agg)) {
|
|
259
|
+
if (key.endsWith('Ms') && typeof agg[key] === 'number') {
|
|
260
|
+
agg[key] = Math.round(agg[key]);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return JSON.stringify(obj);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Aggregates a list of `{ start, end }` spans of one tag into `{ count, totalMs, busyMs, maxMs }`.
|
|
271
|
+
* `totalMs` is the naive sum of per-occurrence durations (correct for serial repeats); `busyMs` is
|
|
272
|
+
* the duration of the union of the `[start, end)` intervals (concurrency-correct — N concurrent
|
|
273
|
+
* spans collapse to their wall-clock span instead of summing to ~N×); `maxMs` is the longest single
|
|
274
|
+
* occurrence. All durations are on the shared process-wide `performance.now()` clock. Does not mutate
|
|
275
|
+
* the input array.
|
|
276
|
+
*/
|
|
277
|
+
export function aggregateSpans(spans) {
|
|
278
|
+
let totalMs = 0;
|
|
279
|
+
let maxMs = 0;
|
|
280
|
+
for (const span of spans) {
|
|
281
|
+
const ms = span.end - span.start;
|
|
282
|
+
totalMs += ms;
|
|
283
|
+
if (ms > maxMs) {
|
|
284
|
+
maxMs = ms;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
// busyMs: sort by start and merge overlapping intervals, summing the merged lengths.
|
|
288
|
+
const sorted = [...spans].sort((a, b) => a.start - b.start);
|
|
289
|
+
let busyMs = 0;
|
|
290
|
+
let mergeStart = null;
|
|
291
|
+
let mergeEnd = null;
|
|
292
|
+
for (const span of sorted) {
|
|
293
|
+
if (mergeStart === null) {
|
|
294
|
+
mergeStart = span.start;
|
|
295
|
+
mergeEnd = span.end;
|
|
296
|
+
} else if (span.start <= mergeEnd) {
|
|
297
|
+
if (span.end > mergeEnd) {
|
|
298
|
+
mergeEnd = span.end;
|
|
299
|
+
}
|
|
300
|
+
} else {
|
|
301
|
+
busyMs += mergeEnd - mergeStart;
|
|
302
|
+
mergeStart = span.start;
|
|
303
|
+
mergeEnd = span.end;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (mergeStart !== null) {
|
|
307
|
+
busyMs += mergeEnd - mergeStart;
|
|
308
|
+
}
|
|
309
|
+
return { count: spans.length, totalMs, busyMs, maxMs };
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Groups `spans` by owner, then by tag, and attaches a `spans` map of aggregates to the matching
|
|
314
|
+
* per-test record (looked up in `recordsByName`) or, for `null`-owner spans, to `suiteRecord`. Also
|
|
315
|
+
* derives the back-compat `setupFnMs` / `teardownFnMs` fields from the `setup:env:<mode>` /
|
|
316
|
+
* `teardown:env` aggregates (additive over any pre-existing value). Spans whose owner matches no
|
|
317
|
+
* record (e.g. the pinned `other:mempool-feeder` owner) are dropped. Returns the raw per-occurrence
|
|
318
|
+
* list (`{ owner, name, ms }`), which is empty unless `emitSpanLines` is set.
|
|
319
|
+
*/
|
|
320
|
+
export function foldSpansInto(spans, { recordsByName, suiteRecord, emitSpanLines = false }) {
|
|
321
|
+
const rawSpans = [];
|
|
322
|
+
// Group by owner (null owner → suite record), then by tag.
|
|
323
|
+
const byOwner = new Map();
|
|
324
|
+
for (const span of spans) {
|
|
325
|
+
const owner = span.owner ?? null;
|
|
326
|
+
let byName = byOwner.get(owner);
|
|
327
|
+
if (!byName) {
|
|
328
|
+
byName = new Map();
|
|
329
|
+
byOwner.set(owner, byName);
|
|
330
|
+
}
|
|
331
|
+
let list = byName.get(span.name);
|
|
332
|
+
if (!list) {
|
|
333
|
+
list = [];
|
|
334
|
+
byName.set(span.name, list);
|
|
335
|
+
}
|
|
336
|
+
list.push(span);
|
|
337
|
+
if (emitSpanLines) {
|
|
338
|
+
rawSpans.push({ owner, name: span.name, ms: span.end - span.start });
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
for (const [owner, byName] of byOwner) {
|
|
343
|
+
const record = owner === null ? suiteRecord : recordsByName.get(owner);
|
|
344
|
+
if (!record) {
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
const aggregates = {};
|
|
348
|
+
for (const [name, list] of byName) {
|
|
349
|
+
aggregates[name] = aggregateSpans(list);
|
|
350
|
+
}
|
|
351
|
+
record.spans = aggregates;
|
|
352
|
+
// Back-compat: the legacy fn-span buckets are derived from the top-level env setup/teardown tags.
|
|
353
|
+
// The top-level setup is tagged `setup:env:<proverMode>` (the mode is a closed set, distinct from
|
|
354
|
+
// the `:anvil`/`:l1-deploy`/... sub-phase tags), so sum those three exact tags.
|
|
355
|
+
const setupFnMs =
|
|
356
|
+
(aggregates['setup:env:none']?.totalMs ?? 0) +
|
|
357
|
+
(aggregates['setup:env:fake']?.totalMs ?? 0) +
|
|
358
|
+
(aggregates['setup:env:real']?.totalMs ?? 0);
|
|
359
|
+
record.setupFnMs = setupFnMs + (record.setupFnMs ?? 0);
|
|
360
|
+
record.teardownFnMs = (aggregates['teardown:env']?.totalMs ?? 0) + (record.teardownFnMs ?? 0);
|
|
361
|
+
}
|
|
362
|
+
return rawSpans;
|
|
363
|
+
}
|