@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
|
@@ -4,6 +4,8 @@ import { Fr } from '@aztec/aztec.js/fields';
|
|
|
4
4
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
5
5
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
6
6
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
7
|
+
import { testSpan } from '../fixtures/timing.js';
|
|
8
|
+
import { waitForL1ToL2MessageSeen } from './wait_for_l1_to_l2_message.js';
|
|
7
9
|
export class FeeJuicePortalTestingHarnessFactory {
|
|
8
10
|
config;
|
|
9
11
|
constructor(config){
|
|
@@ -72,12 +74,12 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
72
74
|
const { claimAmount, claimSecret, messageLeafIndex } = claim;
|
|
73
75
|
await this.feeJuice.methods.claim(owner, claimAmount, claimSecret, messageLeafIndex).send({
|
|
74
76
|
from: claimer
|
|
75
|
-
})
|
|
77
|
+
});
|
|
76
78
|
}
|
|
77
79
|
async getL2PublicBalanceOf(owner) {
|
|
78
|
-
return await this.feeJuice.methods.balance_of_public(owner).simulate({
|
|
80
|
+
return (await this.feeJuice.methods.balance_of_public(owner).simulate({
|
|
79
81
|
from: owner
|
|
80
|
-
});
|
|
82
|
+
})).result;
|
|
81
83
|
}
|
|
82
84
|
async expectPublicBalanceOnL2(owner, expectedBalance) {
|
|
83
85
|
const balance = await this.getL2PublicBalanceOf(owner);
|
|
@@ -87,20 +89,27 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
87
89
|
const bridgeAmount = await this.l1TokenManager.getMintAmount();
|
|
88
90
|
await this.mintTokensOnL1();
|
|
89
91
|
const claim = await this.sendTokensToPortalPublic(bridgeAmount, owner);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
await waitForL1ToL2MessageSeen(this.aztecNode, Fr.fromHexString(claim.messageHash), {
|
|
93
|
+
timeoutSeconds: 24
|
|
94
|
+
});
|
|
92
95
|
// Progress by 2 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
93
96
|
await this.advanceL2Block();
|
|
94
97
|
await this.advanceL2Block();
|
|
95
98
|
return claim;
|
|
96
99
|
}
|
|
97
100
|
async bridgeFromL1ToL2(owner, claimer) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
await testSpan('setup:bridge', async ()=>{
|
|
102
|
+
// Prepare the tokens on the L1 side
|
|
103
|
+
const claim = await this.prepareTokensOnL1(owner);
|
|
104
|
+
// Consume L1 -> L2 message and claim tokens privately on L2
|
|
105
|
+
await this.consumeMessageOnAztecAndClaimPrivately(owner, claimer, claim);
|
|
106
|
+
});
|
|
102
107
|
}
|
|
103
108
|
async advanceL2Block() {
|
|
109
|
+
if (this.aztecNode.mineBlock) {
|
|
110
|
+
await this.aztecNode.mineBlock();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
104
113
|
const initialBlockNumber = await this.aztecNode.getBlockNumber();
|
|
105
114
|
let minTxsPerBlock = undefined;
|
|
106
115
|
if (this.aztecNodeAdmin) {
|
|
@@ -109,11 +118,14 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
109
118
|
minTxsPerBlock: 0
|
|
110
119
|
}); // Set to 0 to ensure we can advance the block
|
|
111
120
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
try {
|
|
122
|
+
await retryUntil(async ()=>await this.aztecNode.getBlockNumber() >= initialBlockNumber + 1, 'gas portal block advance', 0, 0.25);
|
|
123
|
+
} finally{
|
|
124
|
+
if (this.aztecNodeAdmin && minTxsPerBlock !== undefined) {
|
|
125
|
+
await this.aztecNodeAdmin.setConfig({
|
|
126
|
+
minTxsPerBlock
|
|
127
|
+
});
|
|
128
|
+
}
|
|
117
129
|
}
|
|
118
130
|
}
|
|
119
|
-
}
|
|
131
|
+
}
|
package/dest/shared/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { uniswapL1L2TestSuite } from './uniswap_l1_l2.js';
|
|
2
|
-
|
|
2
|
+
export { MockStateView, diffInBps } from './mock_state_view.js';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zaGFyZWQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDMUQsT0FBTyxFQUFFLGFBQWEsRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dest/shared/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
|
-
import { beforeEach, expect } from '@jest/globals';
|
|
2
|
+
import { afterAll, afterEach, beforeEach, expect } from '@jest/globals';
|
|
3
|
+
import { readlinkSync } from 'fs';
|
|
3
4
|
import { basename } from 'path';
|
|
5
|
+
import { EluMonitor } from '../fixtures/elu_monitor.js';
|
|
6
|
+
const eluMonitor = process.env.ELU_MONITOR_FILE ? new EluMonitor(process.env.ELU_MONITOR_FILE, Number(process.env.ELU_MONITOR_INTERVAL_MS) || undefined) : undefined;
|
|
7
|
+
if (eluMonitor) {
|
|
8
|
+
process.on('exit', ()=>eluMonitor.stop());
|
|
9
|
+
}
|
|
4
10
|
beforeEach(()=>{
|
|
5
11
|
const { testPath, currentTestName } = expect.getState();
|
|
6
12
|
if (!testPath || !currentTestName) {
|
|
@@ -8,4 +14,38 @@ beforeEach(()=>{
|
|
|
8
14
|
}
|
|
9
15
|
const logger = createLogger(`e2e:${basename(testPath).replace('.test.ts', '')}`);
|
|
10
16
|
logger.info(`Running test: ${currentTestName}`);
|
|
17
|
+
eluMonitor?.startTest(currentTestName);
|
|
18
|
+
});
|
|
19
|
+
afterEach(()=>{
|
|
20
|
+
eluMonitor?.stopTest();
|
|
21
|
+
});
|
|
22
|
+
// Log leaked handles after all tests complete. This runs after test-level afterAll hooks,
|
|
23
|
+
// so any handles still alive at this point were not properly cleaned up during teardown.
|
|
24
|
+
// This diagnostic helps identify the source of exit hangs without masking them.
|
|
25
|
+
afterAll(()=>{
|
|
26
|
+
const handles = process._getActiveHandles();
|
|
27
|
+
if (handles.length > 0) {
|
|
28
|
+
const details = handles.map((h)=>{
|
|
29
|
+
const type = h?.constructor?.name ?? typeof h;
|
|
30
|
+
const fd = h?.fd ?? h?._handle?.fd ?? '?';
|
|
31
|
+
const destroyed = h?.destroyed ?? '?';
|
|
32
|
+
const hasRef = typeof h?.hasRef === 'function' ? h.hasRef() : '?';
|
|
33
|
+
const localAddr = h?.localAddress ?? '';
|
|
34
|
+
const remoteAddr = h?.remoteAddress ?? '';
|
|
35
|
+
const localPort = h?.localPort ?? '';
|
|
36
|
+
const remotePort = h?.remotePort ?? '';
|
|
37
|
+
const proto = Object.getPrototypeOf(h)?.constructor?.name ?? '?';
|
|
38
|
+
const keys = Object.keys(h).slice(0, 10).join(',');
|
|
39
|
+
let fdTarget = '';
|
|
40
|
+
if (typeof fd === 'number') {
|
|
41
|
+
try {
|
|
42
|
+
fdTarget = ` -> ${readlinkSync(`/proc/self/fd/${fd}`)}`;
|
|
43
|
+
} catch {
|
|
44
|
+
// ignore
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return ` ${type}(fd=${fd}, destroyed=${destroyed}, hasRef=${hasRef}${fdTarget}) proto=${proto} addr=${localAddr}:${localPort}->${remoteAddr}:${remotePort} keys=[${keys}]`;
|
|
48
|
+
});
|
|
49
|
+
process.stderr.write(`\n[jest_setup] WARNING: ${handles.length} handle(s) still active after teardown:\n${details.join('\n')}\n` + `These may prevent Jest from exiting. Investigate and fix the leak.\n\n`);
|
|
50
|
+
}
|
|
11
51
|
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import type { EthCheatCodes } from '@aztec/aztec/testing';
|
|
3
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
4
|
+
/**
|
|
5
|
+
* Mock StateView contract for testing the Uniswap price oracle.
|
|
6
|
+
*
|
|
7
|
+
* Wraps a compiled Solidity contract that mimics the Uniswap V4 StateView's getSlot0 function.
|
|
8
|
+
* The mock allows setting return values dynamically for testing different price scenarios.
|
|
9
|
+
*
|
|
10
|
+
* Solidity source:
|
|
11
|
+
* ```solidity
|
|
12
|
+
* // SPDX-License-Identifier: Apache-2.0
|
|
13
|
+
* pragma solidity >=0.8.27;
|
|
14
|
+
*
|
|
15
|
+
* contract MockStateView {
|
|
16
|
+
* uint160 public sqrtPriceX96;
|
|
17
|
+
* int24 public tick;
|
|
18
|
+
* uint24 public protocolFee;
|
|
19
|
+
* uint24 public lpFee;
|
|
20
|
+
*
|
|
21
|
+
* function setReturnValues(
|
|
22
|
+
* uint160 _sqrtPriceX96,
|
|
23
|
+
* int24 _tick,
|
|
24
|
+
* uint24 _protocolFee,
|
|
25
|
+
* uint24 _lpFee
|
|
26
|
+
* ) external {
|
|
27
|
+
* sqrtPriceX96 = _sqrtPriceX96;
|
|
28
|
+
* tick = _tick;
|
|
29
|
+
* protocolFee = _protocolFee;
|
|
30
|
+
* lpFee = _lpFee;
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* function getSlot0(bytes32 poolId) external view returns (uint160, int24, uint24, uint24) {
|
|
34
|
+
* return (sqrtPriceX96, tick, protocolFee, lpFee);
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class MockStateView {
|
|
40
|
+
private readonly address;
|
|
41
|
+
private readonly walletClient;
|
|
42
|
+
private readonly log;
|
|
43
|
+
private static readonly BYTECODE;
|
|
44
|
+
private static readonly ABI;
|
|
45
|
+
private constructor();
|
|
46
|
+
/**
|
|
47
|
+
* Deploys the mock StateView contract at the specified address using etch.
|
|
48
|
+
* @param ethCheatCodes - Cheat codes for etching bytecode
|
|
49
|
+
* @param walletClient - Wallet client for sending transactions
|
|
50
|
+
* @param address - Address to deploy the mock at (typically the real StateView address)
|
|
51
|
+
*/
|
|
52
|
+
static deploy(ethCheatCodes: EthCheatCodes, walletClient: ExtendedViemWalletClient, address: EthAddress): Promise<MockStateView>;
|
|
53
|
+
/**
|
|
54
|
+
* Sets the price using the ethPerFeeAssetE12 format (same as rollup contract).
|
|
55
|
+
* Computes the corresponding sqrtPriceX96 internally.
|
|
56
|
+
*
|
|
57
|
+
* Math (from fee_asset_price_oracle.ts):
|
|
58
|
+
* ethPerFeeAssetE12 = 1e12 * 2^192 / sqrtPriceX96^2
|
|
59
|
+
*
|
|
60
|
+
* Inverted:
|
|
61
|
+
* sqrtPriceX96^2 = 1e12 * 2^192 / ethPerFeeAssetE12
|
|
62
|
+
* sqrtPriceX96 = sqrt(1e12 * 2^192 / ethPerFeeAssetE12)
|
|
63
|
+
*
|
|
64
|
+
* @param ethPerFeeAssetE12 - The price in ETH per fee asset, scaled by 1e12
|
|
65
|
+
*/
|
|
66
|
+
setEthPerFeeAsset(ethPerFeeAssetE12: bigint): Promise<import("viem").TransactionReceipt>;
|
|
67
|
+
/**
|
|
68
|
+
* Sets the sqrtPriceX96 value directly (Uniswap's price encoding).
|
|
69
|
+
* @param sqrtPriceX96 - The sqrtPriceX96 value
|
|
70
|
+
* @param tick - The tick value (default 10)
|
|
71
|
+
* @param protocolFee - The protocol fee (default 0)
|
|
72
|
+
* @param lpFee - The LP fee (default 500)
|
|
73
|
+
*/
|
|
74
|
+
setSqrtPriceX96(sqrtPriceX96: bigint, tick?: number, protocolFee?: number, lpFee?: number): Promise<import("viem").TransactionReceipt>;
|
|
75
|
+
/**
|
|
76
|
+
* Converts ethPerFeeAssetE12 to sqrtPriceX96 (inverse of sqrtPriceX96ToEthPerFeeAssetE12).
|
|
77
|
+
*
|
|
78
|
+
* Math:
|
|
79
|
+
* sqrtPriceX96 = sqrt(1e12 * 2^192 / ethPerFeeAssetE12)
|
|
80
|
+
*/
|
|
81
|
+
ethPerFeeAssetE12ToSqrtPriceX96(ethPerFeeAssetE12: bigint): bigint;
|
|
82
|
+
/** Integer square root using Newton's method */
|
|
83
|
+
bigintSqrt(n: bigint): bigint;
|
|
84
|
+
}
|
|
85
|
+
export declare function diffInBps(a: bigint, b: bigint): bigint;
|
|
86
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9ja19zdGF0ZV92aWV3LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2hhcmVkL21vY2tfc3RhdGVfdmlldy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFdkQsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDMUQsT0FBTyxLQUFLLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUl0RTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQWtDRztBQUNILHFCQUFhLGFBQWE7SUFxRHRCLE9BQU8sQ0FBQyxRQUFRLENBQUMsT0FBTztJQUN4QixPQUFPLENBQUMsUUFBUSxDQUFDLFlBQVk7SUFDN0IsT0FBTyxDQUFDLFFBQVEsQ0FBQyxHQUFHO0lBdER0QixPQUFPLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxRQUFRLENBQ20rRTtJQUNuZ0YsT0FBTyxDQUFDLE1BQU0sQ0FBQyxRQUFRLENBQUMsR0FBRyxDQStDaEI7SUFFWCxPQUFPLGVBSUg7SUFFSjs7Ozs7T0FLRztJQUNILE9BQWEsTUFBTSxDQUNqQixhQUFhLEVBQUUsYUFBYSxFQUM1QixZQUFZLEVBQUUsd0JBQXdCLEVBQ3RDLE9BQU8sRUFBRSxVQUFVLEdBQ2xCLE9BQU8sQ0FBQyxhQUFhLENBQUMsQ0FHeEI7SUFFRDs7Ozs7Ozs7Ozs7O09BWUc7SUFDRyxpQkFBaUIsQ0FBQyxpQkFBaUIsRUFBRSxNQUFNLDhDQUdoRDtJQUVEOzs7Ozs7T0FNRztJQUNHLGVBQWUsQ0FBQyxZQUFZLEVBQUUsTUFBTSxFQUFFLElBQUksR0FBRSxNQUFXLEVBQUUsV0FBVyxHQUFFLE1BQVUsRUFBRSxLQUFLLEdBQUUsTUFBWSw4Q0FVMUc7SUFFRDs7Ozs7T0FLRztJQUNILCtCQUErQixDQUFDLGlCQUFpQixFQUFFLE1BQU0sR0FBRyxNQUFNLENBT2pFO0lBRUQsZ0RBQWdEO0lBQ2hELFVBQVUsQ0FBQyxDQUFDLEVBQUUsTUFBTSxHQUFHLE1BQU0sQ0FjNUI7Q0FDRjtBQUVELHdCQUFnQixTQUFTLENBQUMsQ0FBQyxFQUFFLE1BQU0sRUFBRSxDQUFDLEVBQUUsTUFBTSxHQUFHLE1BQU0sQ0FFdEQifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock_state_view.d.ts","sourceRoot":"","sources":["../../src/shared/mock_state_view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAItE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,aAAa;IAqDtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG;IAtDtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CACm+E;IACngF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CA+ChB;IAEX,OAAO,eAIH;IAEJ;;;;;OAKG;IACH,OAAa,MAAM,CACjB,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,wBAAwB,EACtC,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,aAAa,CAAC,CAGxB;IAED;;;;;;;;;;;;OAYG;IACG,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,8CAGhD;IAED;;;;;;OAMG;IACG,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,EAAE,WAAW,GAAE,MAAU,EAAE,KAAK,GAAE,MAAY,8CAU1G;IAED;;;;;OAKG;IACH,+BAA+B,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAOjE;IAED,gDAAgD;IAChD,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAc5B;CACF;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
/**
|
|
4
|
+
* Mock StateView contract for testing the Uniswap price oracle.
|
|
5
|
+
*
|
|
6
|
+
* Wraps a compiled Solidity contract that mimics the Uniswap V4 StateView's getSlot0 function.
|
|
7
|
+
* The mock allows setting return values dynamically for testing different price scenarios.
|
|
8
|
+
*
|
|
9
|
+
* Solidity source:
|
|
10
|
+
* ```solidity
|
|
11
|
+
* // SPDX-License-Identifier: Apache-2.0
|
|
12
|
+
* pragma solidity >=0.8.27;
|
|
13
|
+
*
|
|
14
|
+
* contract MockStateView {
|
|
15
|
+
* uint160 public sqrtPriceX96;
|
|
16
|
+
* int24 public tick;
|
|
17
|
+
* uint24 public protocolFee;
|
|
18
|
+
* uint24 public lpFee;
|
|
19
|
+
*
|
|
20
|
+
* function setReturnValues(
|
|
21
|
+
* uint160 _sqrtPriceX96,
|
|
22
|
+
* int24 _tick,
|
|
23
|
+
* uint24 _protocolFee,
|
|
24
|
+
* uint24 _lpFee
|
|
25
|
+
* ) external {
|
|
26
|
+
* sqrtPriceX96 = _sqrtPriceX96;
|
|
27
|
+
* tick = _tick;
|
|
28
|
+
* protocolFee = _protocolFee;
|
|
29
|
+
* lpFee = _lpFee;
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* function getSlot0(bytes32 poolId) external view returns (uint160, int24, uint24, uint24) {
|
|
33
|
+
* return (sqrtPriceX96, tick, protocolFee, lpFee);
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/ export class MockStateView {
|
|
38
|
+
address;
|
|
39
|
+
walletClient;
|
|
40
|
+
log;
|
|
41
|
+
static BYTECODE = '0x608060405234801561000f575f5ffd5b5060043610610060575f3560e01c80633eaf5d9f14610064578063704ce43e146100825780638db791d2146100a0578063b0e21e8a146100be578063b52e4bdd146100dc578063c815641c146100f8575b5f5ffd5b61006c61012b565b60405161007991906102ab565b60405180910390f35b61008a61013d565b60405161009791906102e1565b60405180910390f35b6100a8610151565b6040516100b59190610328565b60405180910390f35b6100c6610175565b6040516100d391906102e1565b60405180910390f35b6100f660048036038101906100f191906103c3565b610189565b005b610112600480360381019061010d919061045a565b61022b565b6040516101229493929190610485565b60405180910390f35b5f60149054906101000a900460020b81565b5f601a9054906101000a900462ffffff1681565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60179054906101000a900462ffffff1681565b835f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825f60146101000a81548162ffffff021916908360020b62ffffff160217905550815f60176101000a81548162ffffff021916908362ffffff160217905550805f601a6101000a81548162ffffff021916908362ffffff16021790555050505050565b5f5f5f5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff165f60149054906101000a900460020b5f60179054906101000a900462ffffff165f601a9054906101000a900462ffffff1693509350935093509193509193565b5f8160020b9050919050565b6102a581610290565b82525050565b5f6020820190506102be5f83018461029c565b92915050565b5f62ffffff82169050919050565b6102db816102c4565b82525050565b5f6020820190506102f45f8301846102d2565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b610322816102fa565b82525050565b5f60208201905061033b5f830184610319565b92915050565b5f5ffd5b61034e816102fa565b8114610358575f5ffd5b50565b5f8135905061036981610345565b92915050565b61037881610290565b8114610382575f5ffd5b50565b5f813590506103938161036f565b92915050565b6103a2816102c4565b81146103ac575f5ffd5b50565b5f813590506103bd81610399565b92915050565b5f5f5f5f608085870312156103db576103da610341565b5b5f6103e88782880161035b565b94505060206103f987828801610385565b935050604061040a878288016103af565b925050606061041b878288016103af565b91505092959194509250565b5f819050919050565b61043981610427565b8114610443575f5ffd5b50565b5f8135905061045481610430565b92915050565b5f6020828403121561046f5761046e610341565b5b5f61047c84828501610446565b91505092915050565b5f6080820190506104985f830187610319565b6104a5602083018661029c565b6104b260408301856102d2565b6104bf60608301846102d2565b9594505050505056fea2646970667358221220f8b1bfff284535bc078368ed34bd5e78981644845f3c9c1f5a4b8448c976805464736f6c634300081f0033';
|
|
42
|
+
static ABI = [
|
|
43
|
+
{
|
|
44
|
+
type: 'function',
|
|
45
|
+
name: 'setReturnValues',
|
|
46
|
+
inputs: [
|
|
47
|
+
{
|
|
48
|
+
name: '_sqrtPriceX96',
|
|
49
|
+
type: 'uint160'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: '_tick',
|
|
53
|
+
type: 'int24'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: '_protocolFee',
|
|
57
|
+
type: 'uint24'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: '_lpFee',
|
|
61
|
+
type: 'uint24'
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
outputs: [],
|
|
65
|
+
stateMutability: 'nonpayable'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
inputs: [
|
|
69
|
+
{
|
|
70
|
+
internalType: 'bytes32',
|
|
71
|
+
name: 'poolId',
|
|
72
|
+
type: 'bytes32'
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
name: 'getSlot0',
|
|
76
|
+
outputs: [
|
|
77
|
+
{
|
|
78
|
+
internalType: 'uint160',
|
|
79
|
+
name: '',
|
|
80
|
+
type: 'uint160'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
internalType: 'int24',
|
|
84
|
+
name: '',
|
|
85
|
+
type: 'int24'
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
internalType: 'uint24',
|
|
89
|
+
name: '',
|
|
90
|
+
type: 'uint24'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
internalType: 'uint24',
|
|
94
|
+
name: '',
|
|
95
|
+
type: 'uint24'
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
stateMutability: 'view',
|
|
99
|
+
type: 'function'
|
|
100
|
+
}
|
|
101
|
+
];
|
|
102
|
+
constructor(address, walletClient, log = createLogger('mock-state-view')){
|
|
103
|
+
this.address = address;
|
|
104
|
+
this.walletClient = walletClient;
|
|
105
|
+
this.log = log;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Deploys the mock StateView contract at the specified address using etch.
|
|
109
|
+
* @param ethCheatCodes - Cheat codes for etching bytecode
|
|
110
|
+
* @param walletClient - Wallet client for sending transactions
|
|
111
|
+
* @param address - Address to deploy the mock at (typically the real StateView address)
|
|
112
|
+
*/ static async deploy(ethCheatCodes, walletClient, address) {
|
|
113
|
+
await ethCheatCodes.etch(address, MockStateView.BYTECODE);
|
|
114
|
+
return new MockStateView(address, walletClient);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Sets the price using the ethPerFeeAssetE12 format (same as rollup contract).
|
|
118
|
+
* Computes the corresponding sqrtPriceX96 internally.
|
|
119
|
+
*
|
|
120
|
+
* Math (from fee_asset_price_oracle.ts):
|
|
121
|
+
* ethPerFeeAssetE12 = 1e12 * 2^192 / sqrtPriceX96^2
|
|
122
|
+
*
|
|
123
|
+
* Inverted:
|
|
124
|
+
* sqrtPriceX96^2 = 1e12 * 2^192 / ethPerFeeAssetE12
|
|
125
|
+
* sqrtPriceX96 = sqrt(1e12 * 2^192 / ethPerFeeAssetE12)
|
|
126
|
+
*
|
|
127
|
+
* @param ethPerFeeAssetE12 - The price in ETH per fee asset, scaled by 1e12
|
|
128
|
+
*/ async setEthPerFeeAsset(ethPerFeeAssetE12) {
|
|
129
|
+
const sqrtPriceX96 = this.ethPerFeeAssetE12ToSqrtPriceX96(ethPerFeeAssetE12);
|
|
130
|
+
return await this.setSqrtPriceX96(sqrtPriceX96);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Sets the sqrtPriceX96 value directly (Uniswap's price encoding).
|
|
134
|
+
* @param sqrtPriceX96 - The sqrtPriceX96 value
|
|
135
|
+
* @param tick - The tick value (default 10)
|
|
136
|
+
* @param protocolFee - The protocol fee (default 0)
|
|
137
|
+
* @param lpFee - The LP fee (default 500)
|
|
138
|
+
*/ async setSqrtPriceX96(sqrtPriceX96, tick = 10, protocolFee = 0, lpFee = 500) {
|
|
139
|
+
const contract = getContract({
|
|
140
|
+
address: this.address.toString(),
|
|
141
|
+
abi: MockStateView.ABI,
|
|
142
|
+
client: this.walletClient
|
|
143
|
+
});
|
|
144
|
+
const hash = await contract.write.setReturnValues([
|
|
145
|
+
sqrtPriceX96,
|
|
146
|
+
tick,
|
|
147
|
+
protocolFee,
|
|
148
|
+
lpFee
|
|
149
|
+
]);
|
|
150
|
+
this.log.info(`Set sqrtPriceX96 to ${sqrtPriceX96}`);
|
|
151
|
+
return await this.walletClient.waitForTransactionReceipt({
|
|
152
|
+
hash
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Converts ethPerFeeAssetE12 to sqrtPriceX96 (inverse of sqrtPriceX96ToEthPerFeeAssetE12).
|
|
157
|
+
*
|
|
158
|
+
* Math:
|
|
159
|
+
* sqrtPriceX96 = sqrt(1e12 * 2^192 / ethPerFeeAssetE12)
|
|
160
|
+
*/ ethPerFeeAssetE12ToSqrtPriceX96(ethPerFeeAssetE12) {
|
|
161
|
+
if (ethPerFeeAssetE12 === 0n) {
|
|
162
|
+
throw new Error('Cannot convert zero ethPerFeeAssetE12');
|
|
163
|
+
}
|
|
164
|
+
const Q192 = 2n ** 192n;
|
|
165
|
+
const sqrtPriceSquared = 10n ** 12n * Q192 / ethPerFeeAssetE12;
|
|
166
|
+
return this.bigintSqrt(sqrtPriceSquared);
|
|
167
|
+
}
|
|
168
|
+
/** Integer square root using Newton's method */ bigintSqrt(n) {
|
|
169
|
+
if (n < 0n) {
|
|
170
|
+
throw new Error('Cannot compute sqrt of negative number');
|
|
171
|
+
}
|
|
172
|
+
if (n === 0n) {
|
|
173
|
+
return 0n;
|
|
174
|
+
}
|
|
175
|
+
let x = n;
|
|
176
|
+
let y = (x + 1n) / 2n;
|
|
177
|
+
while(y < x){
|
|
178
|
+
x = y;
|
|
179
|
+
y = (x + n / x) / 2n;
|
|
180
|
+
}
|
|
181
|
+
return x;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
export function diffInBps(a, b) {
|
|
185
|
+
return (a - b) * 10000n / b;
|
|
186
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import type { SentTx } from '@aztec/aztec.js/contracts';
|
|
3
2
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { TxHash } from '@aztec/aztec.js/tx';
|
|
4
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
5
|
+
export declare const submitTxsTo: (wallet: TestWallet, submitter: AztecAddress, numTxs: number, logger: Logger) => Promise<TxHash[]>;
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3VibWl0LXRyYW5zYWN0aW9ucy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NoYXJlZC9zdWJtaXQtdHJhbnNhY3Rpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUd6RCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNsRCxPQUFPLEVBQUUsTUFBTSxFQUE0QixNQUFNLG9CQUFvQixDQUFDO0FBSXRFLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBR2hFLGVBQU8sTUFBTSxXQUFXLG9HQTRCdkIsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAA4B,MAAM,oBAAoB,CAAC;AAItE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,eAAO,MAAM,WAAW,oGA4BvB,CAAC"}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NO_WAIT, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
2
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
2
3
|
import { TxStatus } from '@aztec/aztec.js/tx';
|
|
3
4
|
import { times } from '@aztec/foundation/collection';
|
|
5
|
+
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
4
6
|
// submits a set of transactions to the provided Wallet
|
|
5
7
|
export const submitTxsTo = async (wallet, submitter, numTxs, logger)=>{
|
|
6
|
-
|
|
8
|
+
// Register (without deploying) a single TestContract instance to source cheap throwaway txs from.
|
|
9
|
+
// emit_nullifier is #[noinitcheck], so it runs on a register-only instance — this avoids a full
|
|
10
|
+
// account-contract deployment per tx, which is all these callers were paying for a mined/gossiped tx.
|
|
11
|
+
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
|
|
12
|
+
salt: Fr.random()
|
|
13
|
+
});
|
|
14
|
+
await wallet.registerContract(testContractInstance, TestContractArtifact);
|
|
15
|
+
const contract = TestContract.at(testContractInstance.address, wallet);
|
|
16
|
+
const txHashes = [];
|
|
7
17
|
await Promise.all(times(numTxs, async ()=>{
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from: submitter
|
|
18
|
+
const { txHash } = await contract.methods.emit_nullifier(Fr.random()).send({
|
|
19
|
+
from: submitter,
|
|
20
|
+
wait: NO_WAIT
|
|
12
21
|
});
|
|
13
|
-
const txHash = await tx.getTxHash();
|
|
14
22
|
logger.info(`Tx sent with hash ${txHash}`);
|
|
15
|
-
const receipt = await
|
|
16
|
-
expect(receipt).
|
|
17
|
-
status: TxStatus.PENDING,
|
|
18
|
-
error: ''
|
|
19
|
-
}));
|
|
23
|
+
const receipt = await wallet.getTxReceipt(txHash);
|
|
24
|
+
expect(receipt.status).toBe(TxStatus.PENDING);
|
|
20
25
|
logger.info(`Receipt received for ${txHash}`);
|
|
21
|
-
|
|
26
|
+
txHashes.push(txHash);
|
|
22
27
|
}));
|
|
23
|
-
return
|
|
28
|
+
return txHashes;
|
|
24
29
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** A single recorded span occurrence on the shared `performance.now()` clock. */ /**
|
|
2
|
+
* Groups `spans` by owner then tag, attaches a `spans` aggregate map to the matching record (or
|
|
3
|
+
* `suiteRecord` for `null`-owner spans), derives back-compat `setupFnMs` / `teardownFnMs`, drops spans
|
|
4
|
+
* whose owner matches no record, and returns the raw per-occurrence list (empty unless `emitSpanLines`).
|
|
5
|
+
*/ export { };
|