@aztec/end-to-end 0.0.1-commit.d3ec352c → 0.0.1-commit.d58ff9d0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -14
- package/dest/automine/automine_test_context.d.ts +85 -0
- package/dest/automine/automine_test_context.d.ts.map +1 -0
- package/dest/automine/automine_test_context.js +98 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.js +120 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts +48 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts +19 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +141 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
- package/dest/automine/token/blacklist_token_contract_test.js +166 -0
- package/dest/automine/token/token_contract_test.d.ts +40 -0
- package/dest/automine/token/token_contract_test.d.ts.map +1 -0
- package/dest/automine/token/token_contract_test.js +119 -0
- package/dest/automine/token/token_test_helpers.d.ts +73 -0
- package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
- package/dest/automine/token/token_test_helpers.js +97 -0
- package/dest/bench/client_flows/benchmark.d.ts +17 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +40 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +19 -20
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +155 -159
- package/dest/bench/client_flows/config.d.ts +2 -2
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +18 -0
- package/dest/bench/client_flows/data_extractor.js +4 -1
- package/dest/bench/utils.d.ts +11 -10
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +126 -23
- package/dest/composed/ha/ha_full_setup.d.ts +77 -0
- package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
- package/dest/composed/ha/ha_full_setup.js +383 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
- package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +1 -1
- package/dest/fixtures/authwit_proxy.d.ts +15 -0
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.js +34 -0
- package/dest/fixtures/e2e_prover_test.d.ts +25 -29
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +147 -151
- package/dest/fixtures/elu_monitor.d.ts +21 -0
- package/dest/fixtures/elu_monitor.d.ts.map +1 -0
- package/dest/fixtures/elu_monitor.js +102 -0
- package/dest/fixtures/fixtures.d.ts +84 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +87 -2
- package/dest/fixtures/get_acvm_config.js +1 -1
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/ha_setup.d.ts +71 -0
- package/dest/fixtures/ha_setup.d.ts.map +1 -0
- package/dest/fixtures/ha_setup.js +119 -0
- package/dest/fixtures/index.d.ts +3 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +2 -0
- package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +2 -2
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
- package/dest/fixtures/setup.d.ts +269 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +688 -0
- package/dest/fixtures/setup_p2p_test.d.ts +22 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +49 -38
- package/dest/fixtures/timing.d.ts +42 -0
- package/dest/fixtures/timing.d.ts.map +1 -0
- package/dest/fixtures/timing.js +72 -0
- package/dest/fixtures/token_utils.d.ts +22 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +28 -7
- package/dest/fixtures/utils.d.ts +5 -638
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -647
- package/dest/fixtures/wait_helpers.d.ts +135 -0
- package/dest/fixtures/wait_helpers.d.ts.map +1 -0
- package/dest/fixtures/wait_helpers.js +154 -0
- package/dest/fixtures/web3signer.js +1 -1
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/install_legacy_contracts.d.cts +10 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/multi-node/block-production/setup.d.ts +97 -0
- package/dest/multi-node/block-production/setup.d.ts.map +1 -0
- package/dest/multi-node/block-production/setup.js +158 -0
- package/dest/multi-node/governance/setup.d.ts +67 -0
- package/dest/multi-node/governance/setup.d.ts.map +1 -0
- package/dest/multi-node/governance/setup.js +126 -0
- package/dest/multi-node/multi_node_test_context.d.ts +212 -0
- package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
- package/dest/multi-node/multi_node_test_context.js +347 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/inactivity_setup.js +111 -0
- package/dest/multi-node/slashing/setup.d.ts +167 -0
- package/dest/multi-node/slashing/setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/setup.js +275 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +33 -21
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/p2p/p2p_network.js +389 -0
- package/dest/p2p/reqresp/utils.d.ts +19 -0
- package/dest/p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/p2p/reqresp/utils.js +193 -0
- package/dest/p2p/shared.d.ts +72 -0
- package/dest/p2p/shared.d.ts.map +1 -0
- package/dest/p2p/shared.js +212 -0
- package/dest/quality_of_service/grafana_client.d.ts +41 -0
- package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
- package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
- package/dest/quality_of_service/prometheus_client.d.ts +38 -0
- package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
- package/dest/quality_of_service/prometheus_client.js +67 -0
- package/dest/shared/cross_chain_test_harness.d.ts +22 -9
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +45 -40
- package/dest/shared/gas_portal_test_harness.d.ts +19 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +27 -15
- package/dest/shared/index.d.ts +3 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/index.js +1 -0
- package/dest/shared/jest_setup.js +41 -1
- package/dest/shared/mock_state_view.d.ts +86 -0
- package/dest/shared/mock_state_view.d.ts.map +1 -0
- package/dest/shared/mock_state_view.js +186 -0
- package/dest/shared/submit-transactions.d.ts +4 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +19 -14
- package/dest/shared/timing_env.d.js +5 -0
- package/dest/shared/timing_env.js +365 -0
- package/dest/shared/uniswap_l1_l2.d.ts +3 -27
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +86 -54
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +15 -4
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +29 -17
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +3 -24
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
- package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
- package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +21 -10
- package/dest/single-node/fees/fees_test.d.ts +93 -0
- package/dest/single-node/fees/fees_test.d.ts.map +1 -0
- package/dest/single-node/fees/fees_test.js +274 -0
- package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
- package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
- package/dest/single-node/l1-reorgs/setup.js +57 -0
- package/dest/single-node/partial-proofs/setup.d.ts +5 -0
- package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
- package/dest/single-node/partial-proofs/setup.js +5 -0
- package/dest/single-node/proving/setup.d.ts +5 -0
- package/dest/single-node/proving/setup.d.ts.map +1 -0
- package/dest/single-node/proving/setup.js +5 -0
- package/dest/single-node/recovery/setup.d.ts +5 -0
- package/dest/single-node/recovery/setup.d.ts.map +1 -0
- package/dest/single-node/recovery/setup.js +5 -0
- package/dest/single-node/setup.d.ts +49 -0
- package/dest/single-node/setup.d.ts.map +1 -0
- package/dest/single-node/setup.js +56 -0
- package/dest/single-node/single_node_test_context.d.ts +360 -0
- package/dest/single-node/single_node_test_context.d.ts.map +1 -0
- package/dest/single-node/single_node_test_context.js +833 -0
- package/dest/spartan/setup_test_wallets.d.ts +15 -5
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +155 -50
- package/dest/spartan/tx_metrics.d.ts +111 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +507 -0
- package/dest/spartan/utils/bot.d.ts +28 -0
- package/dest/spartan/utils/bot.d.ts.map +1 -0
- package/dest/spartan/utils/bot.js +142 -0
- package/dest/spartan/utils/chaos.d.ts +79 -0
- package/dest/spartan/utils/chaos.d.ts.map +1 -0
- package/dest/spartan/utils/chaos.js +142 -0
- package/dest/spartan/utils/clients.d.ts +39 -0
- package/dest/spartan/utils/clients.d.ts.map +1 -0
- package/dest/spartan/utils/clients.js +90 -0
- package/dest/spartan/utils/config.d.ts +19 -0
- package/dest/spartan/utils/config.d.ts.map +1 -0
- package/dest/spartan/utils/config.js +23 -0
- package/dest/spartan/utils/health.d.ts +63 -0
- package/dest/spartan/utils/health.d.ts.map +1 -0
- package/dest/spartan/utils/health.js +202 -0
- package/dest/spartan/utils/helm.d.ts +15 -0
- package/dest/spartan/utils/helm.d.ts.map +1 -0
- package/dest/spartan/utils/helm.js +47 -0
- package/dest/spartan/utils/index.d.ts +11 -0
- package/dest/spartan/utils/index.d.ts.map +1 -0
- package/dest/spartan/utils/index.js +22 -0
- package/dest/spartan/utils/k8s.d.ts +128 -0
- package/dest/spartan/utils/k8s.d.ts.map +1 -0
- package/dest/spartan/utils/k8s.js +381 -0
- package/dest/spartan/utils/nodes.d.ts +40 -0
- package/dest/spartan/utils/nodes.d.ts.map +1 -0
- package/dest/spartan/utils/nodes.js +461 -0
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -0
- package/dest/spartan/utils/scripts.d.ts +30 -0
- package/dest/spartan/utils/scripts.d.ts.map +1 -0
- package/dest/spartan/utils/scripts.js +81 -0
- package/dest/spartan/utils.d.ts +2 -221
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -782
- package/dest/test-wallet/test_wallet.d.ts +105 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +320 -0
- package/dest/test-wallet/utils.d.ts +76 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +126 -0
- package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
- package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
- package/dest/test-wallet/wallet_worker_script.js +56 -0
- package/dest/test-wallet/worker_wallet.d.ts +53 -0
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet.js +157 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts +4 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet_schema.js +23 -0
- package/package.json +54 -46
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -0
- package/src/automine/contracts/fixtures/storage_proof.json +915 -0
- package/src/automine/contracts/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/automine/contracts/fixtures/storage_proof_fixture.ts +173 -0
- package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +213 -0
- package/src/automine/token/blacklist_token_contract_test.ts +208 -0
- package/src/automine/token/token_contract_test.ts +146 -0
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +45 -2
- package/src/bench/client_flows/client_flows_benchmark.ts +222 -251
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +2 -1
- package/src/bench/utils.ts +144 -25
- package/src/composed/ha/ha_full_setup.ts +466 -0
- package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +1 -1
- package/src/fixtures/authwit_proxy.ts +54 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +172 -205
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +111 -3
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +192 -0
- package/src/fixtures/index.ts +2 -0
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +987 -0
- package/src/fixtures/setup_p2p_test.ts +57 -57
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +46 -10
- package/src/fixtures/utils.ts +26 -966
- package/src/fixtures/wait_helpers.ts +333 -0
- package/src/fixtures/web3signer.ts +1 -1
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +106 -0
- package/src/guides/up_quick_start.sh +7 -4
- package/src/infra/README.md +12 -0
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/multi-node/README.md +95 -0
- package/src/multi-node/block-production/setup.ts +272 -0
- package/src/multi-node/governance/setup.ts +172 -0
- package/src/multi-node/multi_node_test_context.ts +447 -0
- package/src/multi-node/slashing/inactivity_setup.ts +139 -0
- package/src/multi-node/slashing/setup.ts +433 -0
- package/src/p2p/README.md +78 -0
- package/src/p2p/p2p_network.ts +542 -0
- package/src/p2p/reqresp/utils.ts +263 -0
- package/src/p2p/shared.ts +329 -0
- package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
- package/src/quality_of_service/prometheus_client.ts +113 -0
- package/src/shared/cross_chain_test_harness.ts +51 -44
- package/src/shared/gas_portal_test_harness.ts +35 -17
- package/src/shared/index.ts +2 -1
- package/src/shared/jest_setup.ts +51 -1
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +22 -19
- package/src/shared/timing_env.d.mts +39 -0
- package/src/shared/timing_env.mjs +363 -0
- package/src/shared/uniswap_l1_l2.ts +136 -115
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +36 -18
- package/src/simulators/token_simulator.ts +6 -30
- package/src/single-node/README.md +60 -0
- package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
- package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
- package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +23 -15
- package/src/single-node/fees/fees_test.ts +368 -0
- package/src/single-node/l1-reorgs/setup.ts +93 -0
- package/src/single-node/partial-proofs/setup.ts +8 -0
- package/src/single-node/proving/setup.ts +15 -0
- package/src/single-node/recovery/setup.ts +8 -0
- package/src/single-node/setup.ts +63 -0
- package/src/single-node/single_node_test_context.ts +1041 -0
- package/src/spartan/setup_test_wallets.ts +217 -36
- package/src/spartan/tx_metrics.ts +460 -0
- package/src/spartan/utils/bot.ts +188 -0
- package/src/spartan/utils/chaos.ts +253 -0
- package/src/spartan/utils/clients.ts +100 -0
- package/src/spartan/utils/config.ts +29 -0
- package/src/spartan/utils/health.ts +255 -0
- package/src/spartan/utils/helm.ts +84 -0
- package/src/spartan/utils/index.ts +71 -0
- package/src/spartan/utils/k8s.ts +535 -0
- package/src/spartan/utils/nodes.ts +543 -0
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/spartan/utils/scripts.ts +99 -0
- package/src/spartan/utils.ts +1 -983
- package/src/test-wallet/test_wallet.ts +426 -0
- package/src/test-wallet/utils.ts +205 -0
- package/src/test-wallet/wallet_worker_script.ts +66 -0
- package/src/test-wallet/worker_wallet.ts +216 -0
- package/src/test-wallet/worker_wallet_schema.ts +14 -0
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -54
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +0 -185
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -41
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -108
- package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -36
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
- package/dest/e2e_deploy_contract/deploy_test.js +0 -45
- package/dest/e2e_epochs/epochs_test.d.ts +0 -93
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -337
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -85
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.js +0 -263
- package/dest/e2e_l1_publisher/write_json.d.ts +0 -10
- package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.js +0 -58
- package/dest/e2e_multi_validator/utils.d.ts +0 -12
- package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -29
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +0 -64
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +0 -139
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/p2p_network.js +0 -320
- package/dest/e2e_p2p/shared.d.ts +0 -46
- package/dest/e2e_p2p/shared.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.js +0 -184
- package/dest/e2e_token_contract/token_contract_test.d.ts +0 -35
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
- package/dest/e2e_token_contract/token_contract_test.js +0 -126
- package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
- package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
- package/dest/fixtures/setup_l1_contracts.js +0 -17
- package/dest/fixtures/snapshot_manager.d.ts +0 -95
- package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
- package/dest/fixtures/snapshot_manager.js +0 -505
- package/dest/quality_of_service/alert_checker.d.ts +0 -41
- package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +0 -256
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -179
- package/src/e2e_deploy_contract/deploy_test.ts +0 -78
- package/src/e2e_epochs/epochs_test.ts +0 -438
- package/src/e2e_fees/fees_test.ts +0 -382
- package/src/e2e_l1_publisher/write_json.ts +0 -77
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -96
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -182
- package/src/e2e_p2p/p2p_network.ts +0 -476
- package/src/e2e_p2p/shared.ts +0 -285
- package/src/e2e_token_contract/token_contract_test.ts +0 -167
- package/src/fixtures/setup_l1_contracts.ts +0 -26
- package/src/fixtures/snapshot_manager.ts +0 -665
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
2
|
import { L1TokenPortalManager } from '@aztec/aztec.js/ethereum';
|
|
3
3
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { OutboxContract } from '@aztec/ethereum/contracts';
|
|
5
|
+
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
6
6
|
import { TestERC20Abi, TokenPortalAbi, TokenPortalBytecode } from '@aztec/l1-artifacts';
|
|
7
7
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
8
8
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
9
9
|
import { getContract } from 'viem';
|
|
10
|
+
import { testSpan } from '../fixtures/timing.js';
|
|
10
11
|
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
12
|
+
import { waitForL1ToL2MessageSeen } from './wait_for_l1_to_l2_message.js';
|
|
11
13
|
/**
|
|
12
14
|
* Deploy L1 token and portal, initialize portal, deploy a non native l2 token contract, its L2 bridge contract and attach is to the portal.
|
|
13
15
|
* @param wallet - the wallet instance
|
|
@@ -17,39 +19,39 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
17
19
|
* @param owner - owner of the L2 contract
|
|
18
20
|
* @param underlyingERC20Address - address of the underlying ERC20 contract to use (if none supplied, it deploys one)
|
|
19
21
|
* @returns l2 contract instance, bridge contract instance, token portal instance, token portal address and the underlying ERC20 instance
|
|
20
|
-
*/ export async function deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, rollupRegistryAddress, owner, underlyingERC20Address) {
|
|
21
|
-
//
|
|
22
|
-
const
|
|
22
|
+
*/ export async function deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, rollupRegistryAddress, owner, underlyingERC20Address, predeployedTokenPortalAddress) {
|
|
23
|
+
// Deploy the token portal, unless it was already deployed before the node started (under automine).
|
|
24
|
+
const tokenPortalAddress = predeployedTokenPortalAddress ?? (await deployL1Contract(l1Client, TokenPortalAbi, TokenPortalBytecode)).address;
|
|
23
25
|
const tokenPortal = getContract({
|
|
24
26
|
address: tokenPortalAddress.toString(),
|
|
25
27
|
abi: TokenPortalAbi,
|
|
26
28
|
client: l1Client
|
|
27
29
|
});
|
|
28
30
|
// deploy l2 token
|
|
29
|
-
const token = await TokenContract.deploy(wallet, owner, 'TokenName', 'TokenSymbol', 18).send({
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const { contract: token } = await testSpan('deploy:token', ()=>TokenContract.deploy(wallet, owner, 'TokenName', 'TokenSymbol', 18).send({
|
|
32
|
+
from: owner
|
|
33
|
+
}));
|
|
32
34
|
// deploy l2 token bridge and attach to the portal
|
|
33
|
-
const bridge = await TokenBridgeContract.deploy(wallet, token.address, tokenPortalAddress).send({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (await token.methods.get_admin().simulate({
|
|
35
|
+
const { contract: bridge } = await testSpan('deploy:bridge', ()=>TokenBridgeContract.deploy(wallet, token.address, tokenPortalAddress).send({
|
|
36
|
+
from: owner
|
|
37
|
+
}));
|
|
38
|
+
if ((await token.methods.get_admin().simulate({
|
|
37
39
|
from: owner
|
|
38
|
-
}) !== owner.toBigInt()) {
|
|
40
|
+
})).result !== owner.toBigInt()) {
|
|
39
41
|
throw new Error(`Token admin is not ${owner}`);
|
|
40
42
|
}
|
|
41
43
|
if (!(await bridge.methods.get_config().simulate({
|
|
42
44
|
from: owner
|
|
43
|
-
})).token.equals(token.address)) {
|
|
45
|
+
})).result.token.equals(token.address)) {
|
|
44
46
|
throw new Error(`Bridge token is not ${token.address}`);
|
|
45
47
|
}
|
|
46
48
|
// make the bridge a minter on the token:
|
|
47
49
|
await token.methods.set_minter(bridge.address, true).send({
|
|
48
50
|
from: owner
|
|
49
|
-
})
|
|
50
|
-
if (await token.methods.is_minter(bridge.address).simulate({
|
|
51
|
+
});
|
|
52
|
+
if ((await token.methods.is_minter(bridge.address).simulate({
|
|
51
53
|
from: owner
|
|
52
|
-
}) === 1n) {
|
|
54
|
+
})).result === 1n) {
|
|
53
55
|
throw new Error(`Bridge is not a minter`);
|
|
54
56
|
}
|
|
55
57
|
// initialize portal
|
|
@@ -86,17 +88,18 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
86
88
|
l1ContractAddresses;
|
|
87
89
|
wallet;
|
|
88
90
|
ownerAddress;
|
|
89
|
-
static async new(aztecNode, l1Client, wallet, ownerAddress, logger, underlyingERC20Address) {
|
|
91
|
+
static async new(aztecNode, l1Client, wallet, ownerAddress, logger, underlyingERC20Address, predeployedTokenPortalAddress) {
|
|
90
92
|
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
91
93
|
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
92
94
|
// Deploy and initialize all required contracts
|
|
93
95
|
logger.info('Deploying and initializing token, portal and its bridge...');
|
|
94
|
-
const { token, bridge, tokenPortalAddress, underlyingERC20 } = await deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, l1ContractAddresses.registryAddress, ownerAddress, underlyingERC20Address);
|
|
96
|
+
const { token, bridge, tokenPortalAddress, underlyingERC20 } = await deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, l1ContractAddresses.registryAddress, ownerAddress, underlyingERC20Address, predeployedTokenPortalAddress);
|
|
95
97
|
logger.info('Deployed and initialized token, portal and its bridge.');
|
|
96
98
|
return new CrossChainTestHarness(aztecNode, logger, token, bridge, ethAccount, tokenPortalAddress, underlyingERC20.address, l1Client, l1ContractAddresses, wallet, ownerAddress);
|
|
97
99
|
}
|
|
98
100
|
l1TokenManager;
|
|
99
101
|
l1TokenPortalManager;
|
|
102
|
+
outboxContract;
|
|
100
103
|
constructor(/** Aztec node instance. */ aztecNode, /** Logger. */ logger, /** L2 Token contract. */ l2Token, /** L2 Token bridge contract. */ l2Bridge, /** Eth account to interact with. */ ethAccount, /** Portal address. */ tokenPortalAddress, /** Underlying token for portal tests. */ underlyingERC20Address, /** Viem Extended client instance. */ l1Client, /** Deployment addresses for all L1 contracts */ l1ContractAddresses, /** Wallet to simulate and send txs from. */ wallet, /** Owner of the l2 token and bridge */ ownerAddress){
|
|
101
104
|
this.aztecNode = aztecNode;
|
|
102
105
|
this.logger = logger;
|
|
@@ -111,6 +114,7 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
111
114
|
this.ownerAddress = ownerAddress;
|
|
112
115
|
this.l1TokenPortalManager = new L1TokenPortalManager(this.tokenPortalAddress, this.underlyingERC20Address, this.l1ContractAddresses.feeAssetHandlerAddress, this.l1ContractAddresses.outboxAddress, this.l1Client, this.logger);
|
|
113
116
|
this.l1TokenManager = this.l1TokenPortalManager.getTokenManager();
|
|
117
|
+
this.outboxContract = new OutboxContract(this.l1Client, this.l1ContractAddresses.outboxAddress);
|
|
114
118
|
}
|
|
115
119
|
async mintTokensOnL1(amount) {
|
|
116
120
|
const contract = getContract({
|
|
@@ -139,52 +143,52 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
139
143
|
}
|
|
140
144
|
async mintTokensPublicOnL2(amount) {
|
|
141
145
|
this.logger.info('Minting tokens on L2 publicly');
|
|
142
|
-
await this.l2Token.methods.mint_to_public(this.ownerAddress, amount).send({
|
|
143
|
-
|
|
144
|
-
|
|
146
|
+
await testSpan('tx:mint', ()=>this.l2Token.methods.mint_to_public(this.ownerAddress, amount).send({
|
|
147
|
+
from: this.ownerAddress
|
|
148
|
+
}));
|
|
145
149
|
}
|
|
146
150
|
async mintTokensPrivateOnL2(amount) {
|
|
147
|
-
await mintTokensToPrivate(this.l2Token, this.ownerAddress, this.ownerAddress, amount);
|
|
151
|
+
await testSpan('tx:mint', ()=>mintTokensToPrivate(this.l2Token, this.ownerAddress, this.ownerAddress, amount));
|
|
148
152
|
}
|
|
149
153
|
async sendL2PublicTransfer(transferAmount, receiverAddress) {
|
|
150
154
|
// send a transfer tx to force through rollup with the message included
|
|
151
155
|
await this.l2Token.methods.transfer_in_public(this.ownerAddress, receiverAddress, transferAmount, 0).send({
|
|
152
156
|
from: this.ownerAddress
|
|
153
|
-
})
|
|
157
|
+
});
|
|
154
158
|
}
|
|
155
159
|
async consumeMessageOnAztecAndMintPrivately(claim) {
|
|
156
160
|
this.logger.info('Consuming messages on L2 privately');
|
|
157
161
|
const { recipient, claimAmount, claimSecret: secretForL2MessageConsumption, messageLeafIndex } = claim;
|
|
158
162
|
await this.l2Bridge.methods.claim_private(recipient, claimAmount, secretForL2MessageConsumption, messageLeafIndex).send({
|
|
159
163
|
from: this.ownerAddress
|
|
160
|
-
})
|
|
164
|
+
});
|
|
161
165
|
}
|
|
162
166
|
async consumeMessageOnAztecAndMintPublicly(claim) {
|
|
163
167
|
this.logger.info('Consuming messages on L2 Publicly');
|
|
164
168
|
const { claimAmount, claimSecret, messageLeafIndex } = claim;
|
|
165
169
|
await this.l2Bridge.methods.claim_public(this.ownerAddress, claimAmount, claimSecret, messageLeafIndex).send({
|
|
166
170
|
from: this.ownerAddress
|
|
167
|
-
})
|
|
171
|
+
});
|
|
168
172
|
}
|
|
169
173
|
async withdrawPrivateFromAztecToL1(withdrawAmount, authwitNonce = Fr.ZERO, authWitness) {
|
|
170
|
-
const withdrawReceipt = await this.l2Bridge.methods.exit_to_l1_private(this.l2Token.address, this.ethAccount, withdrawAmount, EthAddress.ZERO, authwitNonce).send({
|
|
174
|
+
const { receipt: withdrawReceipt } = await this.l2Bridge.methods.exit_to_l1_private(this.l2Token.address, this.ethAccount, withdrawAmount, EthAddress.ZERO, authwitNonce).send({
|
|
171
175
|
authWitnesses: [
|
|
172
176
|
authWitness
|
|
173
177
|
],
|
|
174
178
|
from: this.ownerAddress
|
|
175
|
-
})
|
|
179
|
+
});
|
|
176
180
|
return withdrawReceipt;
|
|
177
181
|
}
|
|
178
182
|
async withdrawPublicFromAztecToL1(withdrawAmount, authwitNonce = Fr.ZERO) {
|
|
179
|
-
const withdrawReceipt = await this.l2Bridge.methods.exit_to_l1_public(this.ethAccount, withdrawAmount, EthAddress.ZERO, authwitNonce).send({
|
|
183
|
+
const { receipt: withdrawReceipt } = await this.l2Bridge.methods.exit_to_l1_public(this.ethAccount, withdrawAmount, EthAddress.ZERO, authwitNonce).send({
|
|
180
184
|
from: this.ownerAddress
|
|
181
|
-
})
|
|
185
|
+
});
|
|
182
186
|
return withdrawReceipt;
|
|
183
187
|
}
|
|
184
188
|
async getL2PrivateBalanceOf(owner) {
|
|
185
|
-
return await this.l2Token.methods.balance_of_private(owner).simulate({
|
|
189
|
+
return (await this.l2Token.methods.balance_of_private(owner).simulate({
|
|
186
190
|
from: owner
|
|
187
|
-
});
|
|
191
|
+
})).result;
|
|
188
192
|
}
|
|
189
193
|
async expectPrivateBalanceOnL2(owner, expectedBalance) {
|
|
190
194
|
const balance = await this.getL2PrivateBalanceOf(owner);
|
|
@@ -192,9 +196,9 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
192
196
|
expect(balance).toBe(expectedBalance);
|
|
193
197
|
}
|
|
194
198
|
async getL2PublicBalanceOf(owner) {
|
|
195
|
-
return await this.l2Token.methods.balance_of_public(owner).simulate({
|
|
199
|
+
return (await this.l2Token.methods.balance_of_public(owner).simulate({
|
|
196
200
|
from: this.ownerAddress
|
|
197
|
-
});
|
|
201
|
+
})).result;
|
|
198
202
|
}
|
|
199
203
|
async expectPublicBalanceOnL2(owner, expectedBalance) {
|
|
200
204
|
const balance = await this.getL2PublicBalanceOf(owner);
|
|
@@ -203,20 +207,20 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
203
207
|
async getL2ToL1MessageLeaf(withdrawAmount, callerOnL1 = EthAddress.ZERO) {
|
|
204
208
|
return await this.l1TokenPortalManager.getL2ToL1MessageLeaf(withdrawAmount, this.ethAccount, this.l2Bridge.address, callerOnL1);
|
|
205
209
|
}
|
|
206
|
-
withdrawFundsFromBridgeOnL1(amount,
|
|
207
|
-
return this.l1TokenPortalManager.withdrawFunds(amount, this.ethAccount,
|
|
210
|
+
withdrawFundsFromBridgeOnL1(amount, epochNumber, numCheckpointsInEpoch, messageIndex, siblingPath) {
|
|
211
|
+
return this.l1TokenPortalManager.withdrawFunds(amount, this.ethAccount, epochNumber, numCheckpointsInEpoch, messageIndex, siblingPath);
|
|
208
212
|
}
|
|
209
213
|
async transferToPrivateOnL2(shieldAmount) {
|
|
210
214
|
this.logger.info('Transferring to private on L2');
|
|
211
215
|
await this.l2Token.methods.transfer_to_private(this.ownerAddress, shieldAmount).send({
|
|
212
216
|
from: this.ownerAddress
|
|
213
|
-
})
|
|
217
|
+
});
|
|
214
218
|
}
|
|
215
219
|
async transferToPublicOnL2(amount, authwitNonce = Fr.ZERO) {
|
|
216
220
|
this.logger.info('Transferring tokens to public');
|
|
217
221
|
await this.l2Token.methods.transfer_to_public(this.ownerAddress, this.ownerAddress, amount, authwitNonce).send({
|
|
218
222
|
from: this.ownerAddress
|
|
219
|
-
})
|
|
223
|
+
});
|
|
220
224
|
}
|
|
221
225
|
/**
|
|
222
226
|
* Makes message available for consumption.
|
|
@@ -226,8 +230,9 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
226
230
|
* it's included it becomes available for consumption in the next block because the l1 to l2 message tree.
|
|
227
231
|
*/ async makeMessageConsumable(msgHash) {
|
|
228
232
|
const frMsgHash = typeof msgHash === 'string' ? Fr.fromHexString(msgHash) : msgHash;
|
|
229
|
-
|
|
230
|
-
|
|
233
|
+
await waitForL1ToL2MessageSeen(this.aztecNode, frMsgHash, {
|
|
234
|
+
timeoutSeconds: 10
|
|
235
|
+
});
|
|
231
236
|
await this.mintTokensPublicOnL2(0n);
|
|
232
237
|
await this.mintTokensPublicOnL2(0n);
|
|
233
238
|
}
|
|
@@ -3,9 +3,11 @@ import { L1FeeJuicePortalManager, type L1TokenManager, type L2AmountClaim } from
|
|
|
3
3
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
4
4
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
5
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
6
|
-
import type { ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
6
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
7
7
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
8
|
-
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
8
|
+
import type { AztecNodeAdmin, AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
|
|
9
|
+
/** Aztec node that may expose the debug mining API in local e2e setups. */
|
|
10
|
+
type MiningAztecNode = AztecNode & Partial<AztecNodeDebug>;
|
|
9
11
|
export interface IGasBridgingTestHarness {
|
|
10
12
|
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
|
|
11
13
|
prepareTokensOnL1(owner: AztecAddress): Promise<L2AmountClaim>;
|
|
@@ -14,7 +16,7 @@ export interface IGasBridgingTestHarness {
|
|
|
14
16
|
l1FeeJuiceAddress: EthAddress;
|
|
15
17
|
}
|
|
16
18
|
export interface FeeJuicePortalTestingHarnessFactoryConfig {
|
|
17
|
-
aztecNode:
|
|
19
|
+
aztecNode: MiningAztecNode;
|
|
18
20
|
aztecNodeAdmin?: AztecNodeAdmin;
|
|
19
21
|
l1Client: ExtendedViemWalletClient;
|
|
20
22
|
wallet: Wallet;
|
|
@@ -32,21 +34,31 @@ export declare class FeeJuicePortalTestingHarnessFactory {
|
|
|
32
34
|
* shared between cross chain tests.
|
|
33
35
|
*/
|
|
34
36
|
export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
35
|
-
|
|
37
|
+
/** Aztec node */
|
|
38
|
+
aztecNode: MiningAztecNode;
|
|
39
|
+
/** Aztec node admin interface */
|
|
36
40
|
aztecNodeAdmin: AztecNodeAdmin | undefined;
|
|
41
|
+
/** Wallet. */
|
|
37
42
|
wallet: Wallet;
|
|
43
|
+
/** Logger. */
|
|
38
44
|
logger: Logger;
|
|
45
|
+
/** L2 Token/Bridge contract. */
|
|
39
46
|
feeJuice: FeeJuiceContract;
|
|
47
|
+
/** Eth account to interact with. */
|
|
40
48
|
ethAccount: EthAddress;
|
|
49
|
+
/** Portal address. */
|
|
41
50
|
feeJuicePortalAddress: EthAddress;
|
|
51
|
+
/** Underlying token for portal tests. */
|
|
42
52
|
l1FeeJuiceAddress: EthAddress;
|
|
53
|
+
/** Fee asset handler address. */
|
|
43
54
|
feeAssetHandlerAddress: EthAddress;
|
|
55
|
+
/** Viem Extended client instance. */
|
|
44
56
|
l1Client: ExtendedViemWalletClient;
|
|
45
57
|
readonly l1TokenManager: L1TokenManager;
|
|
46
58
|
readonly feeJuicePortalManager: L1FeeJuicePortalManager;
|
|
47
59
|
constructor(
|
|
48
60
|
/** Aztec node */
|
|
49
|
-
aztecNode:
|
|
61
|
+
aztecNode: MiningAztecNode,
|
|
50
62
|
/** Aztec node admin interface */
|
|
51
63
|
aztecNodeAdmin: AztecNodeAdmin | undefined,
|
|
52
64
|
/** Wallet. */
|
|
@@ -75,4 +87,5 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
75
87
|
bridgeFromL1ToL2(owner: AztecAddress, claimer: AztecAddress): Promise<void>;
|
|
76
88
|
private advanceL2Block;
|
|
77
89
|
}
|
|
78
|
-
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2FzX3BvcnRhbF90ZXN0X2hhcm5lc3MuZC50cyIsInNvdX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SxFQUFFLGVBQWUsRUFBRSxNQUFNLGlCQUd6RTtJQUVLLGlCQUFpQixDQUFDLEtBQUssRUFBRSxZQUFZLDBCQVkxQztJQUVLLGdCQUFnQixDQUFDLEtBQUssRUFBRSxZQUFZLEVBQUUsT0FBTyxFQUFFLFlBQVksaUJBUWhFO1lBRWEsY0FBYztDQTJCN0IifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas_portal_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/gas_portal_test_harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE5G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"gas_portal_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/gas_portal_test_harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE5G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAA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
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
|
-
export { uniswapL1L2TestSuite
|
|
2
|
-
|
|
1
|
+
export { uniswapL1L2TestSuite } from './uniswap_l1_l2.js';
|
|
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,
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9ja19zdGF0ZV92aWV3LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2hhcmVkL21vY2tfc3RhdGVfdmlldy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFdkQsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDMUQsT0FBTyxLQUFLLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUl0RTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQWtDRztBQUNILHFCQUFhLGFBQWE7SUFxRHRCLE9BQU8sQ0FBQyxRQUFRLENBQUMsT0FBTztJQUN4QixPQUFPLENBQUMsUUFBUSxDQUFDLFlB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