@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 @@
|
|
|
1
|
+
{"version":3,"file":"wallet_worker_script.d.ts","sourceRoot":"","sources":["../../src/test-wallet/wallet_worker_script.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DefaultWaitOpts } from '@aztec/aztec.js/contracts';
|
|
2
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
3
|
+
import { BackendType, BarretenbergSync } from '@aztec/bb.js';
|
|
4
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
5
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
6
|
+
import { getSchemaParameters, parseWithOptionals, schemaHasMethod } from '@aztec/foundation/schemas';
|
|
7
|
+
import { NodeListener, TransportServer } from '@aztec/foundation/transport';
|
|
8
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
9
|
+
import { workerData } from 'worker_threads';
|
|
10
|
+
import { TestWallet } from './test_wallet.js';
|
|
11
|
+
import { WorkerWalletSchema } from './worker_wallet_schema.js';
|
|
12
|
+
const logger = createLogger('e2e:test-wallet:worker');
|
|
13
|
+
try {
|
|
14
|
+
const { nodeUrl, pxeConfig } = workerData;
|
|
15
|
+
logger.info('Initializing worker wallet', {
|
|
16
|
+
nodeUrl
|
|
17
|
+
});
|
|
18
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
19
|
+
// Worker sync bb use is limited to crypto and proof serialization helpers.
|
|
20
|
+
await BarretenbergSync.initSingleton({
|
|
21
|
+
backend: BackendType.Wasm
|
|
22
|
+
});
|
|
23
|
+
const wallet = await TestWallet.create(node, pxeConfig);
|
|
24
|
+
// Worker wallets are only used by spartan tests against remote JSON-RPC nodes: keep the 1s poll cadence.
|
|
25
|
+
wallet.setDefaultWaitInterval(DefaultWaitOpts.interval);
|
|
26
|
+
logger.info('Worker wallet initialized');
|
|
27
|
+
const customMethods = {
|
|
28
|
+
proveTx: async (exec, opts)=>{
|
|
29
|
+
const provenTx = await wallet.proveTx(exec, opts);
|
|
30
|
+
return new Tx(provenTx.getTxHash(), provenTx.data, provenTx.chonkProof, provenTx.contractClassLogFields, provenTx.publicFunctionCalldata);
|
|
31
|
+
},
|
|
32
|
+
registerAccount: async (secret, salt, signingKey)=>{
|
|
33
|
+
const manager = await wallet.createSchnorrAccount(secret, salt, signingKey);
|
|
34
|
+
return manager.address;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const schema = WorkerWalletSchema;
|
|
38
|
+
const listener = new NodeListener();
|
|
39
|
+
const server = new TransportServer(listener, async (msg)=>{
|
|
40
|
+
if (!schemaHasMethod(schema, msg.fn)) {
|
|
41
|
+
throw new Error(`Unknown method: ${msg.fn}`);
|
|
42
|
+
}
|
|
43
|
+
const jsonParams = JSON.parse(msg.args);
|
|
44
|
+
const args = await parseWithOptionals(jsonParams, getSchemaParameters(schema[msg.fn]));
|
|
45
|
+
// we have to erase the fn type in order to be able to spread ...args
|
|
46
|
+
const handler = msg.fn in customMethods ? customMethods[msg.fn] : undefined;
|
|
47
|
+
const result = handler ? await handler(...args) : await wallet[msg.fn](...args);
|
|
48
|
+
return jsonStringify(result);
|
|
49
|
+
});
|
|
50
|
+
server.start();
|
|
51
|
+
} catch (err) {
|
|
52
|
+
logger.error('Worker wallet initialization failed', {
|
|
53
|
+
error: err instanceof Error ? err.stack : String(err)
|
|
54
|
+
});
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CallIntent, IntentInnerHash } from '@aztec/aztec.js/authorization';
|
|
2
|
+
import type { InteractionWaitOptions, SendReturn } from '@aztec/aztec.js/contracts';
|
|
3
|
+
import type { Aliased, AppCapabilities, BatchResults, BatchedMethod, ContractClassMetadata, ContractMetadata, ExecuteUtilityOptions, PrivateEvent, PrivateEventFilter, ProfileOptions, SendOptions, SimulateOptions, TxSimulationResultWithAppOffset, Wallet, WalletCapabilities } from '@aztec/aztec.js/wallet';
|
|
4
|
+
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
5
|
+
import type { Fq, Fr } from '@aztec/foundation/curves/bn254';
|
|
6
|
+
import type { PXEConfig } from '@aztec/pxe/config';
|
|
7
|
+
import type { ContractArtifact, EventMetadataDefinition, FunctionCall } from '@aztec/stdlib/abi';
|
|
8
|
+
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
9
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
|
+
import type { ContractInstancePreimage } from '@aztec/stdlib/contract';
|
|
11
|
+
import type { ExecutionPayload, TxProfileResult, UtilityExecutionResult } from '@aztec/stdlib/tx';
|
|
12
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
13
|
+
/**
|
|
14
|
+
* Wallet implementation that offloads all work to a worker thread.
|
|
15
|
+
* Implements the Wallet interface by proxying calls over a transport layer
|
|
16
|
+
* using JSON serialization with Zod schema parsing on both ends.
|
|
17
|
+
*/
|
|
18
|
+
export declare class WorkerWallet implements Wallet {
|
|
19
|
+
private worker;
|
|
20
|
+
private client;
|
|
21
|
+
private constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Creates a WorkerWallet by spawning a worker thread that creates a TestWallet internally.
|
|
24
|
+
* @param nodeUrl - URL of the Aztec node to connect to.
|
|
25
|
+
* @param pxeConfig - Optional PXE configuration overrides.
|
|
26
|
+
* @returns A WorkerWallet ready to use.
|
|
27
|
+
*/
|
|
28
|
+
static create(nodeUrl: string, pxeConfig?: Partial<PXEConfig>): Promise<WorkerWallet>;
|
|
29
|
+
private callRaw;
|
|
30
|
+
private call;
|
|
31
|
+
getChainInfo(): Promise<ChainInfo>;
|
|
32
|
+
getContractMetadata(address: AztecAddress): Promise<ContractMetadata>;
|
|
33
|
+
getContractClassMetadata(id: Fr): Promise<ContractClassMetadata>;
|
|
34
|
+
getPrivateEvents<T>(eventMetadata: EventMetadataDefinition, eventFilter: PrivateEventFilter): Promise<PrivateEvent<T>[]>;
|
|
35
|
+
registerSender(address: AztecAddress, alias?: string): Promise<AztecAddress>;
|
|
36
|
+
getAddressBook(): Promise<Aliased<AztecAddress>[]>;
|
|
37
|
+
getAccounts(): Promise<Aliased<AztecAddress>[]>;
|
|
38
|
+
registerContract(instance: ContractInstancePreimage, artifact?: ContractArtifact, secretKey?: Fr): Promise<void>;
|
|
39
|
+
registerContractClass(artifact: ContractArtifact): Promise<void>;
|
|
40
|
+
simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResultWithAppOffset>;
|
|
41
|
+
executeUtility(call: FunctionCall, opts: ExecuteUtilityOptions): Promise<UtilityExecutionResult>;
|
|
42
|
+
profileTx(exec: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult>;
|
|
43
|
+
sendTx<W extends InteractionWaitOptions = undefined>(exec: ExecutionPayload, opts: SendOptions<W>): Promise<SendReturn<W>>;
|
|
44
|
+
proveTx(exec: ExecutionPayload, opts: Omit<SendOptions, 'wait'>): Promise<Tx>;
|
|
45
|
+
/** Registers an account inside the worker's TestWallet, populating its accounts map. */
|
|
46
|
+
registerAccount(secret: Fr, salt: Fr, signingKey: Fq): Promise<AztecAddress>;
|
|
47
|
+
createAuthWit(from: AztecAddress, messageHashOrIntent: IntentInnerHash | CallIntent): Promise<AuthWitness>;
|
|
48
|
+
requestCapabilities(manifest: AppCapabilities): Promise<WalletCapabilities>;
|
|
49
|
+
batch<const T extends readonly BatchedMethod[]>(methods: T): Promise<BatchResults<T>>;
|
|
50
|
+
/** Shuts down the worker thread and closes the transport. */
|
|
51
|
+
stop(): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
//# sourceM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,YAAY,EAAE,mBAAmB,EAAE,eAAe,GAAG,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAEzG;IAED,mBAAmB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAE1E;IAED,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAEpF;IAED,6DAA6D;IACvD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAG1B;CACF"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
2
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
4
|
+
import { getSchemaReturnType } from '@aztec/foundation/schemas';
|
|
5
|
+
import { sleep } from '@aztec/foundation/sleep';
|
|
6
|
+
import { NodeConnector, TransportClient } from '@aztec/foundation/transport';
|
|
7
|
+
import { Worker } from 'worker_threads';
|
|
8
|
+
import { WorkerWalletSchema } from './worker_wallet_schema.js';
|
|
9
|
+
const log = createLogger('e2e:test-wallet:worker-wallet');
|
|
10
|
+
const WORKER_READY_TIMEOUT_MS = 120_000;
|
|
11
|
+
/**
|
|
12
|
+
* Wallet implementation that offloads all work to a worker thread.
|
|
13
|
+
* Implements the Wallet interface by proxying calls over a transport layer
|
|
14
|
+
* using JSON serialization with Zod schema parsing on both ends.
|
|
15
|
+
*/ export class WorkerWallet {
|
|
16
|
+
worker;
|
|
17
|
+
client;
|
|
18
|
+
constructor(worker, client){
|
|
19
|
+
this.worker = worker;
|
|
20
|
+
this.client = client;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a WorkerWallet by spawning a worker thread that creates a TestWallet internally.
|
|
24
|
+
* @param nodeUrl - URL of the Aztec node to connect to.
|
|
25
|
+
* @param pxeConfig - Optional PXE configuration overrides.
|
|
26
|
+
* @returns A WorkerWallet ready to use.
|
|
27
|
+
*/ static async create(nodeUrl, pxeConfig) {
|
|
28
|
+
// replace stc/ with dest/ so the wallet works in Jest tests
|
|
29
|
+
const workerUrl = new URL('./wallet_worker_script.js', import.meta.url);
|
|
30
|
+
workerUrl.pathname = workerUrl.pathname.replace('/src/', '/dest/');
|
|
31
|
+
// remove JEST_WORKER_ID so the worker uses pino-pretty transport instead of Jest's raw output.
|
|
32
|
+
const { JEST_WORKER_ID: _, ...parentEnv } = process.env;
|
|
33
|
+
const worker = new Worker(workerUrl, {
|
|
34
|
+
workerData: {
|
|
35
|
+
nodeUrl,
|
|
36
|
+
pxeConfig
|
|
37
|
+
},
|
|
38
|
+
env: {
|
|
39
|
+
...parentEnv,
|
|
40
|
+
...process.stderr.isTTY || process.env.FORCE_COLOR ? {
|
|
41
|
+
FORCE_COLOR: '1'
|
|
42
|
+
} : {},
|
|
43
|
+
LOG_LEVEL: process.env.WORKER_LOG_LEVEL ?? 'info'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const connector = new NodeConnector(worker);
|
|
47
|
+
const client = new TransportClient(connector);
|
|
48
|
+
await client.open();
|
|
49
|
+
const wallet = new WorkerWallet(worker, client);
|
|
50
|
+
const { promise: workerDied, reject: rejectWorkerDied } = promiseWithResolvers();
|
|
51
|
+
// reject if the worker exits or errors before the warmup completes.
|
|
52
|
+
const onError = (err)=>{
|
|
53
|
+
worker.off('exit', onExit);
|
|
54
|
+
rejectWorkerDied(new Error(`Worker wallet thread error: ${err.message}`));
|
|
55
|
+
};
|
|
56
|
+
const onExit = (code)=>{
|
|
57
|
+
worker.off('error', onError);
|
|
58
|
+
rejectWorkerDied(new Error(`Worker wallet thread exited with code ${code} before becoming ready`));
|
|
59
|
+
};
|
|
60
|
+
worker.once('error', onError);
|
|
61
|
+
worker.once('exit', onExit);
|
|
62
|
+
const timeout = sleep(WORKER_READY_TIMEOUT_MS).then(()=>{
|
|
63
|
+
throw new Error(`Worker wallet creation timed out after ${WORKER_READY_TIMEOUT_MS / 1000}s`);
|
|
64
|
+
});
|
|
65
|
+
try {
|
|
66
|
+
// wait for worker wallet to start
|
|
67
|
+
await Promise.race([
|
|
68
|
+
wallet.getChainInfo(),
|
|
69
|
+
workerDied,
|
|
70
|
+
timeout
|
|
71
|
+
]);
|
|
72
|
+
} catch (err) {
|
|
73
|
+
log.error('Worker wallet creation failed, cleaning up', {
|
|
74
|
+
error: String(err)
|
|
75
|
+
});
|
|
76
|
+
client.close();
|
|
77
|
+
await worker.terminate();
|
|
78
|
+
throw err;
|
|
79
|
+
} finally{
|
|
80
|
+
worker.off('error', onError);
|
|
81
|
+
worker.off('exit', onExit);
|
|
82
|
+
}
|
|
83
|
+
return wallet;
|
|
84
|
+
}
|
|
85
|
+
async callRaw(fn, ...args) {
|
|
86
|
+
const argsJson = jsonStringify(args);
|
|
87
|
+
return await this.client.request({
|
|
88
|
+
fn,
|
|
89
|
+
args: argsJson
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
async call(fn, ...args) {
|
|
93
|
+
const resultJson = await this.callRaw(fn, ...args);
|
|
94
|
+
const methodSchema = WorkerWalletSchema[fn];
|
|
95
|
+
// Void-returning methods (e.g. registerContract) serialize to `undefined` on the worker side, which
|
|
96
|
+
// JSON.parse cannot handle; hand it straight to the schema, whose `z.void()` output accepts undefined.
|
|
97
|
+
return getSchemaReturnType(methodSchema).parseAsync(resultJson === undefined ? undefined : JSON.parse(resultJson));
|
|
98
|
+
}
|
|
99
|
+
getChainInfo() {
|
|
100
|
+
return this.call('getChainInfo');
|
|
101
|
+
}
|
|
102
|
+
getContractMetadata(address) {
|
|
103
|
+
return this.call('getContractMetadata', address);
|
|
104
|
+
}
|
|
105
|
+
getContractClassMetadata(id) {
|
|
106
|
+
return this.call('getContractClassMetadata', id);
|
|
107
|
+
}
|
|
108
|
+
getPrivateEvents(eventMetadata, eventFilter) {
|
|
109
|
+
return this.call('getPrivateEvents', eventMetadata, eventFilter);
|
|
110
|
+
}
|
|
111
|
+
registerSender(address, alias) {
|
|
112
|
+
return this.call('registerSender', address, alias);
|
|
113
|
+
}
|
|
114
|
+
getAddressBook() {
|
|
115
|
+
return this.call('getAddressBook');
|
|
116
|
+
}
|
|
117
|
+
getAccounts() {
|
|
118
|
+
return this.call('getAccounts');
|
|
119
|
+
}
|
|
120
|
+
registerContract(instance, artifact, secretKey) {
|
|
121
|
+
return this.call('registerContract', instance, artifact, secretKey);
|
|
122
|
+
}
|
|
123
|
+
registerContractClass(artifact) {
|
|
124
|
+
return this.call('registerContractClass', artifact);
|
|
125
|
+
}
|
|
126
|
+
simulateTx(exec, opts) {
|
|
127
|
+
return this.call('simulateTx', exec, opts);
|
|
128
|
+
}
|
|
129
|
+
executeUtility(call, opts) {
|
|
130
|
+
return this.call('executeUtility', call, opts);
|
|
131
|
+
}
|
|
132
|
+
profileTx(exec, opts) {
|
|
133
|
+
return this.call('profileTx', exec, opts);
|
|
134
|
+
}
|
|
135
|
+
sendTx(exec, opts) {
|
|
136
|
+
return this.call('sendTx', exec, opts);
|
|
137
|
+
}
|
|
138
|
+
proveTx(exec, opts) {
|
|
139
|
+
return this.call('proveTx', exec, opts);
|
|
140
|
+
}
|
|
141
|
+
/** Registers an account inside the worker's TestWallet, populating its accounts map. */ registerAccount(secret, salt, signingKey) {
|
|
142
|
+
return this.call('registerAccount', secret, salt, signingKey);
|
|
143
|
+
}
|
|
144
|
+
createAuthWit(from, messageHashOrIntent) {
|
|
145
|
+
return this.call('createAuthWit', from, messageHashOrIntent);
|
|
146
|
+
}
|
|
147
|
+
requestCapabilities(manifest) {
|
|
148
|
+
return this.call('requestCapabilities', manifest);
|
|
149
|
+
}
|
|
150
|
+
batch(methods) {
|
|
151
|
+
return this.call('batch', methods);
|
|
152
|
+
}
|
|
153
|
+
/** Shuts down the worker thread and closes the transport. */ async stop() {
|
|
154
|
+
this.client.close();
|
|
155
|
+
await this.worker.terminate();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ApiSchema } from '@aztec/foundation/schemas';
|
|
2
|
+
/** Schema for the WorkerWallet API — extends WalletSchema with proveTx and registerAccount. */
|
|
3
|
+
export declare const WorkerWalletSchema: ApiSchema;
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyX3dhbGxldF9zY2hlbWEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0LXdhbGxldC93b3JrZXJfd2FsbGV0X3NjaGVtYS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQU8zRCxpR0FBK0Y7QUFDL0YsZUFBTyxNQUFNLGtCQUFrQixFQUFFLFNBSWhDLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker_wallet_schema.d.ts","sourceRoot":"","sources":["../../src/test-wallet/worker_wallet_schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAO3D,iGAA+F;AAC/F,eAAO,MAAM,kBAAkB,EAAE,SAIhC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ExecutionPayloadSchema, SendOptionsSchema, WalletSchema } from '@aztec/aztec.js/wallet';
|
|
2
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
3
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/** Schema for the WorkerWallet API — extends WalletSchema with proveTx and registerAccount. */ export const WorkerWalletSchema = {
|
|
7
|
+
...WalletSchema,
|
|
8
|
+
proveTx: z.function({
|
|
9
|
+
input: z.tuple([
|
|
10
|
+
ExecutionPayloadSchema,
|
|
11
|
+
SendOptionsSchema
|
|
12
|
+
]),
|
|
13
|
+
output: Tx.schema
|
|
14
|
+
}),
|
|
15
|
+
registerAccount: z.function({
|
|
16
|
+
input: z.tuple([
|
|
17
|
+
schemas.Fr,
|
|
18
|
+
schemas.Fr,
|
|
19
|
+
schemas.Fq
|
|
20
|
+
]),
|
|
21
|
+
output: AztecAddress.schema
|
|
22
|
+
})
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.d58ff9d0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"exports":
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./dest/index.js",
|
|
7
|
+
"./*": "./dest/*"
|
|
8
|
+
},
|
|
6
9
|
"inherits": [
|
|
7
10
|
"../package.common.json",
|
|
8
11
|
"./package.local.json"
|
|
@@ -12,56 +15,59 @@
|
|
|
12
15
|
"build:dev": "../scripts/tsc.sh --watch",
|
|
13
16
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
14
17
|
"test:with-alerts": "./scripts/test-with-alerts.sh",
|
|
15
|
-
"test:e2e": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000
|
|
18
|
+
"test:e2e": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000",
|
|
16
19
|
"test:e2e-docker": "./scripts/run_test.sh simple",
|
|
17
20
|
"test:e2e-no-docker": "echo 'The command test:e2e-no-docker is now the same as test:e2e. You can now run this dropping the no-docker suffix.'; yarn test:e2e",
|
|
18
|
-
"test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000
|
|
21
|
+
"test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000",
|
|
19
22
|
"serve:flames": "python3 -m http.server --directory \"flame_graph\" 8000",
|
|
20
|
-
"test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000
|
|
23
|
+
"test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000",
|
|
21
24
|
"test:integration": "concurrently -k -s first -c reset,dim -n test,anvil \"yarn test:integration:run\" \"anvil\"",
|
|
22
25
|
"test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --no-cache --runInBand --config jest.integration.config.json",
|
|
23
26
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests src/fixtures",
|
|
24
27
|
"test:compose": "./scripts/run_test.sh compose",
|
|
28
|
+
"test:ha": "./scripts/run_test.sh ha",
|
|
25
29
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
30
|
},
|
|
27
31
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
29
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
30
|
-
"@aztec/aztec": "0.0.1-commit.
|
|
31
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
32
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
33
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
34
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
35
|
-
"@aztec/blob-
|
|
36
|
-
"@aztec/blob-
|
|
37
|
-
"@aztec/bot": "0.0.1-commit.
|
|
38
|
-
"@aztec/cli": "0.0.1-commit.
|
|
39
|
-
"@aztec/constants": "0.0.1-commit.
|
|
40
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
41
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
42
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
43
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
44
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
45
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
46
|
-
"@aztec/
|
|
47
|
-
"@aztec/
|
|
48
|
-
"@aztec/noir-
|
|
49
|
-
"@aztec/noir-
|
|
50
|
-
"@aztec/noir-
|
|
51
|
-
"@aztec/
|
|
52
|
-
"@aztec/
|
|
53
|
-
"@aztec/
|
|
54
|
-
"@aztec/prover-
|
|
55
|
-
"@aztec/
|
|
56
|
-
"@aztec/
|
|
57
|
-
"@aztec/
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
60
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
61
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
62
|
-
"@aztec/
|
|
63
|
-
"@aztec/validator-
|
|
64
|
-
"@aztec/
|
|
32
|
+
"@aztec/accounts": "0.0.1-commit.d58ff9d0",
|
|
33
|
+
"@aztec/archiver": "0.0.1-commit.d58ff9d0",
|
|
34
|
+
"@aztec/aztec": "0.0.1-commit.d58ff9d0",
|
|
35
|
+
"@aztec/aztec-node": "0.0.1-commit.d58ff9d0",
|
|
36
|
+
"@aztec/aztec.js": "0.0.1-commit.d58ff9d0",
|
|
37
|
+
"@aztec/bb-prover": "0.0.1-commit.d58ff9d0",
|
|
38
|
+
"@aztec/bb.js": "0.0.1-commit.d58ff9d0",
|
|
39
|
+
"@aztec/blob-client": "0.0.1-commit.d58ff9d0",
|
|
40
|
+
"@aztec/blob-lib": "0.0.1-commit.d58ff9d0",
|
|
41
|
+
"@aztec/bot": "0.0.1-commit.d58ff9d0",
|
|
42
|
+
"@aztec/cli": "0.0.1-commit.d58ff9d0",
|
|
43
|
+
"@aztec/constants": "0.0.1-commit.d58ff9d0",
|
|
44
|
+
"@aztec/entrypoints": "0.0.1-commit.d58ff9d0",
|
|
45
|
+
"@aztec/epoch-cache": "0.0.1-commit.d58ff9d0",
|
|
46
|
+
"@aztec/ethereum": "0.0.1-commit.d58ff9d0",
|
|
47
|
+
"@aztec/foundation": "0.0.1-commit.d58ff9d0",
|
|
48
|
+
"@aztec/kv-store": "0.0.1-commit.d58ff9d0",
|
|
49
|
+
"@aztec/l1-artifacts": "0.0.1-commit.d58ff9d0",
|
|
50
|
+
"@aztec/node-keystore": "0.0.1-commit.d58ff9d0",
|
|
51
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.d58ff9d0",
|
|
52
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.d58ff9d0",
|
|
53
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.d58ff9d0",
|
|
54
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.d58ff9d0",
|
|
55
|
+
"@aztec/p2p": "0.0.1-commit.d58ff9d0",
|
|
56
|
+
"@aztec/protocol-contracts": "0.0.1-commit.d58ff9d0",
|
|
57
|
+
"@aztec/prover-client": "0.0.1-commit.d58ff9d0",
|
|
58
|
+
"@aztec/prover-node": "0.0.1-commit.d58ff9d0",
|
|
59
|
+
"@aztec/pxe": "0.0.1-commit.d58ff9d0",
|
|
60
|
+
"@aztec/sequencer-client": "0.0.1-commit.d58ff9d0",
|
|
61
|
+
"@aztec/simulator": "0.0.1-commit.d58ff9d0",
|
|
62
|
+
"@aztec/slasher": "0.0.1-commit.d58ff9d0",
|
|
63
|
+
"@aztec/standard-contracts": "0.0.1-commit.d58ff9d0",
|
|
64
|
+
"@aztec/stdlib": "0.0.1-commit.d58ff9d0",
|
|
65
|
+
"@aztec/telemetry-client": "0.0.1-commit.d58ff9d0",
|
|
66
|
+
"@aztec/validator-client": "0.0.1-commit.d58ff9d0",
|
|
67
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.d58ff9d0",
|
|
68
|
+
"@aztec/wallet-sdk": "0.0.1-commit.d58ff9d0",
|
|
69
|
+
"@aztec/wallets": "0.0.1-commit.d58ff9d0",
|
|
70
|
+
"@aztec/world-state": "0.0.1-commit.d58ff9d0",
|
|
65
71
|
"@iarna/toml": "^2.2.5",
|
|
66
72
|
"@jest/globals": "^30.0.0",
|
|
67
73
|
"@noble/curves": "=1.0.0",
|
|
@@ -73,7 +79,6 @@
|
|
|
73
79
|
"@types/koa-static": "^4.0.2",
|
|
74
80
|
"@types/lodash.every": "^4.6.7",
|
|
75
81
|
"@types/node": "^22.15.17",
|
|
76
|
-
"@viem/anvil": "^0.0.9",
|
|
77
82
|
"buffer": "^6.0.3",
|
|
78
83
|
"crypto-browserify": "^3.12.1",
|
|
79
84
|
"fs-extra": "^11.2.0",
|
|
@@ -89,6 +94,7 @@
|
|
|
89
94
|
"lodash.every": "^4.6.0",
|
|
90
95
|
"lodash.omit": "^4.5.0",
|
|
91
96
|
"msgpackr": "^1.11.2",
|
|
97
|
+
"pg": "^8.17.1",
|
|
92
98
|
"process": "^0.11.10",
|
|
93
99
|
"snappy": "^7.2.2",
|
|
94
100
|
"stream-browserify": "^3.0.0",
|
|
@@ -99,7 +105,7 @@
|
|
|
99
105
|
"typescript": "^5.3.3",
|
|
100
106
|
"util": "^0.12.5",
|
|
101
107
|
"viem": "npm:@aztec/viem@2.38.2",
|
|
102
|
-
"zod": "^
|
|
108
|
+
"zod": "^4"
|
|
103
109
|
},
|
|
104
110
|
"devDependencies": {
|
|
105
111
|
"0x": "^5.7.0",
|
|
@@ -107,7 +113,8 @@
|
|
|
107
113
|
"@types/jest": "^30.0.0",
|
|
108
114
|
"@types/js-yaml": "^4.0.9",
|
|
109
115
|
"@types/lodash.chunk": "^4.2.9",
|
|
110
|
-
"@
|
|
116
|
+
"@types/pg": "^8",
|
|
117
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
111
118
|
"concurrently": "^7.6.0",
|
|
112
119
|
"jest": "^30.0.0",
|
|
113
120
|
"jest-extended": "^6.0.0",
|
|
@@ -156,12 +163,13 @@
|
|
|
156
163
|
"moduleNameMapper": {
|
|
157
164
|
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
|
|
158
165
|
},
|
|
166
|
+
"resolver": "<rootDir>/legacy-jest-resolver.cjs",
|
|
159
167
|
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
|
|
160
168
|
"rootDir": "./src",
|
|
161
169
|
"testTimeout": 120000,
|
|
162
170
|
"setupFiles": [
|
|
163
171
|
"../../foundation/src/jest/setup.mjs"
|
|
164
172
|
],
|
|
165
|
-
"testEnvironment": "
|
|
173
|
+
"testEnvironment": "./shared/timing_env.mjs"
|
|
166
174
|
}
|
|
167
175
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# `automine` e2e test category
|
|
2
|
+
|
|
3
|
+
Automine tests run a single Aztec node driving the deterministic `AutomineSequencer`: one block per
|
|
4
|
+
submitted transaction, synchronous L1 publish, no committee, no prover, and no validator client. The
|
|
5
|
+
node opts into this topology through the `AUTOMINE_E2E_OPTS` preset (`fixtures/fixtures.ts`), which the
|
|
6
|
+
base context applies by default. This is the fast, deterministic counterpart to the `single-node`
|
|
7
|
+
category, whose node runs the production sequencer with interval block production. A test belongs here
|
|
8
|
+
when it exercises contract or protocol behavior that does not depend on real block-building or consensus
|
|
9
|
+
(token transfers, nested calls, note discovery, tx semantics); it belongs in `single-node` when it
|
|
10
|
+
asserts on sequencer, proving, or reorg behavior.
|
|
11
|
+
|
|
12
|
+
## Base class
|
|
13
|
+
|
|
14
|
+
All tests use `AutomineTestContext` (`automine_test_context.ts`), which owns:
|
|
15
|
+
|
|
16
|
+
- The environment: an in-process anvil in automine mode plus the L1 contract deploy, wrapping
|
|
17
|
+
`fixtures/setup.ts:setup()` with `AUTOMINE_E2E_OPTS` and `fundSponsoredFPC` as defaults.
|
|
18
|
+
- The common handles: `context`, `wallet`, `aztecNode`, `aztecNodeAdmin`, `cheatCodes`, `sequencer`,
|
|
19
|
+
`accounts`, `defaultAccountAddress`, `logger`.
|
|
20
|
+
- `markProvenAndWarp(seconds)`: marks pending checkpoints proven before warping the L2 clock, so a long
|
|
21
|
+
warp does not trip the rollup's pruning window (see the method's doc comment).
|
|
22
|
+
- `registerContract(...)`: computes and registers a contract instance without an on-chain deploy.
|
|
23
|
+
- `applyManualParentChild()`: deploys a Parent and Child contract for the nested-call tests.
|
|
24
|
+
|
|
25
|
+
Tests call the static `AutomineTestContext.setup({ numberOfAccounts })` factory (or `new` plus `setup()`
|
|
26
|
+
for the harness subclasses), passing `numberOfAccounts` rather than spreading `AUTOMINE_E2E_OPTS`.
|
|
27
|
+
|
|
28
|
+
## Harnesses
|
|
29
|
+
|
|
30
|
+
Two domain harnesses extend `AutomineTestContext` and run their domain setup after `super.setup()`:
|
|
31
|
+
|
|
32
|
+
- `token/token_contract_test.ts` — a `TokenSimulator` plus opt-in base/mint snapshots for the Token
|
|
33
|
+
contract tests.
|
|
34
|
+
- `token/blacklist_token_contract_test.ts` — a `TokenSimulator`, the `Role` helper, and the
|
|
35
|
+
role-change-delay warp (via `markProvenAndWarp`) for the TokenBlacklist tests.
|
|
36
|
+
|
|
37
|
+
## Organizing principle
|
|
38
|
+
|
|
39
|
+
The top level groups tests by node topology (automine); the second level names the primary behavior
|
|
40
|
+
under test rather than the shared setup. Each file has a single top-level `describe` named to match its
|
|
41
|
+
path. A `.parallel` suffix marks files with more than one top-level `it`; CI splits each `it` into its
|
|
42
|
+
own job.
|
|
43
|
+
|
|
44
|
+
## Subfolders
|
|
45
|
+
|
|
46
|
+
A second-level folder is created only when it earns its keep: a shared harness, an existing sub-hierarchy,
|
|
47
|
+
or a coherent domain of several files. The remaining miscellaneous protocol/execution behaviors live as flat
|
|
48
|
+
files directly under `automine/` — smoke, tx ordering/double-spend/phase checks, mempool limits, the app demos
|
|
49
|
+
(card game, private voting), and the timestamp/PXE tests.
|
|
50
|
+
|
|
51
|
+
| Path | Contents |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `token/` | Token-economics tests on the two token harnesses plus the `TokenSimulator`/`LendingSimulator`-adjacent DeFi tests: token transfers/minting/burning/access-control, the blacklist token suite, AMM, lending, NFT, orderbook, crowdfunding, and escrow. |
|
|
54
|
+
| `contracts/` | Contract lifecycle and cross-contract behavior. `deploy/` (class registration, deploy method, legacy deploy, private initialization), `nested/` (importer and the manual private/public nested-call patterns), plus contract updates, storage proofs, static calls, nested utility calls, and the ABI/storage-surface tests (ABI types, option params, state variables). |
|
|
55
|
+
| `accounts/` | Account and key behavior: account contracts, keys, multiple accounts sharing an encryption key, two-PXE interop, authwit, and scope isolation. |
|
|
56
|
+
| `effects/` | Note discovery, events, and offchain effects: note getters, pending note hashes, partial notes, event logs, event-only notes, offchain effects and payments, large public events, custom messages, the tx-effect oracle, and note rediscovery after pruned blocks. |
|
|
57
|
+
| `simulation/` | Circuit simulation surface: the AVM simulator, kernelless simulation, and the circuit recorder. |
|
|
58
|
+
|
|
59
|
+
The `simulation/avm_simulator` file is a genuine outlier: it dumps AVM circuit inputs for the downstream
|
|
60
|
+
`avm_check_circuit` CI job, so it has a bespoke CI line and is excluded from the generic `simulation/` glob.
|