@aztec/end-to-end 0.0.1-commit.4d79d1f2d → 0.0.1-commit.4d9804df
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/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.d.ts +1 -1
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -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 +39 -52
- 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 +37 -52
- 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 +5 -5
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +62 -53
- package/dest/bench/client_flows/data_extractor.js +1 -0
- package/dest/bench/utils.d.ts +3 -3
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +102 -8
- 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 +17 -13
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +82 -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 +4 -4
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +8 -3
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -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 +99 -48
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +319 -262
- package/dest/fixtures/setup_p2p_test.d.ts +14 -7
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +21 -18
- 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 +26 -8
- 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 +21 -11
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.js +97 -37
- package/dest/p2p/reqresp/utils.d.ts +19 -0
- package/dest/p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/reqresp/utils.js +67 -27
- 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 +6 -4
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +36 -31
- 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 +26 -14
- 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 +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +12 -5
- 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 +55 -45
- 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 +27 -15
- 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 +2 -2
- 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 +17 -4
- 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 +89 -63
- 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 +11 -2
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +121 -46
- package/dest/spartan/tx_metrics.d.ts +27 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +106 -21
- package/dest/spartan/utils/bot.d.ts +3 -2
- package/dest/spartan/utils/bot.d.ts.map +1 -1
- package/dest/spartan/utils/bot.js +2 -1
- package/dest/spartan/utils/config.d.ts +10 -30
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/config.js +3 -1
- package/dest/spartan/utils/index.d.ts +4 -2
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +5 -1
- package/dest/spartan/utils/k8s.d.ts +3 -1
- package/dest/spartan/utils/k8s.d.ts.map +1 -1
- package/dest/spartan/utils/k8s.js +6 -0
- package/dest/spartan/utils/nodes.d.ts +4 -5
- package/dest/spartan/utils/nodes.d.ts.map +1 -1
- package/dest/spartan/utils/nodes.js +11 -11
- 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/test-wallet/test_wallet.d.ts +48 -25
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +197 -91
- package/dest/test-wallet/utils.d.ts +38 -3
- package/dest/test-wallet/utils.d.ts.map +1 -1
- package/dest/test-wallet/utils.js +65 -10
- 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 +50 -47
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -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 +44 -63
- package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +43 -58
- 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 +102 -64
- package/src/bench/client_flows/data_extractor.ts +1 -0
- package/src/bench/utils.ts +116 -7
- 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 +97 -93
- 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 +14 -6
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +406 -351
- package/src/fixtures/setup_p2p_test.ts +23 -27
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +42 -7
- 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 +5 -2
- 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 +116 -47
- package/src/{e2e_p2p → p2p}/reqresp/utils.ts +82 -26
- package/src/p2p/shared.ts +329 -0
- package/src/shared/cross_chain_test_harness.ts +42 -17
- package/src/shared/gas_portal_test_harness.ts +33 -15
- 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 +13 -5
- package/src/shared/timing_env.d.mts +39 -0
- package/src/shared/timing_env.mjs +363 -0
- package/src/shared/uniswap_l1_l2.ts +98 -54
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +33 -15
- package/src/simulators/token_simulator.ts +6 -2
- 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 +19 -5
- package/src/{e2e_fees → single-node/fees}/fees_test.ts +114 -70
- 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 +165 -41
- package/src/spartan/tx_metrics.ts +108 -24
- package/src/spartan/utils/bot.ts +4 -1
- package/src/spartan/utils/config.ts +2 -0
- package/src/spartan/utils/index.ts +7 -0
- package/src/spartan/utils/k8s.ts +8 -0
- package/src/spartan/utils/nodes.ts +17 -12
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/test-wallet/test_wallet.ts +228 -107
- package/src/test-wallet/utils.ts +104 -11
- 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 -55
- 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 -129
- 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 -100
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -367
- 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 -11
- package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.js +0 -56
- 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/reqresp/utils.d.ts +0 -22
- package/dest/e2e_p2p/reqresp/utils.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 -181
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +0 -2
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +0 -1
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +0 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +0 -44
- 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 -193
- package/src/e2e_deploy_contract/deploy_test.ts +0 -85
- package/src/e2e_epochs/epochs_test.ts +0 -487
- package/src/e2e_l1_publisher/write_json.ts +0 -77
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -73
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -179
- package/src/e2e_p2p/shared.ts +0 -290
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.js +0 -0
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.js +0 -0
- /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof.json +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.ts +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.ts +0 -0
- /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
|
@@ -71,7 +71,7 @@ export async function waitForProvenToAdvance(
|
|
|
71
71
|
// Get current proven block number
|
|
72
72
|
let initialProvenBlock: number;
|
|
73
73
|
try {
|
|
74
|
-
const tips = await node.
|
|
74
|
+
const tips = await node.getChainTips();
|
|
75
75
|
initialProvenBlock = Number(tips.proven.block.number);
|
|
76
76
|
log.info(`Current proven block: ${initialProvenBlock}. Waiting for it to increase...`);
|
|
77
77
|
} catch (err) {
|
|
@@ -82,7 +82,7 @@ export async function waitForProvenToAdvance(
|
|
|
82
82
|
await retryUntil(
|
|
83
83
|
async () => {
|
|
84
84
|
try {
|
|
85
|
-
const tips = await node.
|
|
85
|
+
const tips = await node.getChainTips();
|
|
86
86
|
const currentProvenBlock = Number(tips.proven.block.number);
|
|
87
87
|
const proposedBlock = Number(tips.proposed.number);
|
|
88
88
|
|
|
@@ -173,7 +173,7 @@ export async function withSequencersAdmin<T>(env: TestConfig, fn: (node: AztecNo
|
|
|
173
173
|
if (statusRes.status !== 200) {
|
|
174
174
|
throw new Error(`Admin endpoint returned status ${statusRes.status}`);
|
|
175
175
|
}
|
|
176
|
-
const client = createAztecNodeAdminClient(url);
|
|
176
|
+
const client = createAztecNodeAdminClient(url, {}, undefined, env.AZTEC_ADMIN_API_KEY);
|
|
177
177
|
return { result: await fn(client), process };
|
|
178
178
|
} catch (err) {
|
|
179
179
|
// Kill the port-forward before retrying
|
|
@@ -255,21 +255,18 @@ export async function initHADb(namespace: string): Promise<void> {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
/**
|
|
258
|
-
*
|
|
259
|
-
* Wired to env
|
|
258
|
+
* Sets probabilistic transaction dropping on validators and waits for rollout.
|
|
259
|
+
* Use probability=0 to disable. Wired to env var P2P_DROP_TX_CHANCE via Helm values.
|
|
260
260
|
*/
|
|
261
261
|
export async function setValidatorTxDrop({
|
|
262
262
|
namespace,
|
|
263
|
-
enabled,
|
|
264
263
|
probability,
|
|
265
264
|
logger: log,
|
|
266
265
|
}: {
|
|
267
266
|
namespace: string;
|
|
268
|
-
enabled: boolean;
|
|
269
267
|
probability: number;
|
|
270
268
|
logger: Logger;
|
|
271
269
|
}) {
|
|
272
|
-
const drop = enabled ? 'true' : 'false';
|
|
273
270
|
const prob = String(probability);
|
|
274
271
|
|
|
275
272
|
const selectors = ['app.kubernetes.io/name=validator', 'app.kubernetes.io/component=validator', 'app=validator'];
|
|
@@ -284,7 +281,7 @@ export async function setValidatorTxDrop({
|
|
|
284
281
|
if (names.length === 0) {
|
|
285
282
|
continue;
|
|
286
283
|
}
|
|
287
|
-
const cmd = `kubectl set env statefulset -l ${selector} -n ${namespace}
|
|
284
|
+
const cmd = `kubectl set env statefulset -l ${selector} -n ${namespace} P2P_DROP_TX_CHANCE=${prob}`;
|
|
288
285
|
log.info(`command: ${cmd}`);
|
|
289
286
|
await execAsync(cmd);
|
|
290
287
|
updated = true;
|
|
@@ -366,16 +363,24 @@ export async function enableValidatorDynamicBootNode(
|
|
|
366
363
|
*/
|
|
367
364
|
export async function rollAztecPods(namespace: string, clearState: boolean = false) {
|
|
368
365
|
// Pod components use 'validator', but StatefulSets and PVCs use 'sequencer-node' for validators
|
|
366
|
+
// RPC nodes have nodeType='rpc-node' in Helm values, so their component label is 'rpc-node' (not 'rpc')
|
|
369
367
|
const podComponents = [
|
|
370
368
|
'p2p-bootstrap',
|
|
371
369
|
'prover-node',
|
|
372
370
|
'prover-broker',
|
|
373
371
|
'prover-agent',
|
|
374
372
|
'sequencer-node',
|
|
375
|
-
'rpc',
|
|
373
|
+
'rpc-node',
|
|
374
|
+
'validator-ha-db',
|
|
375
|
+
];
|
|
376
|
+
const pvcComponents = [
|
|
377
|
+
'p2p-bootstrap',
|
|
378
|
+
'prover-node',
|
|
379
|
+
'prover-broker',
|
|
380
|
+
'sequencer-node',
|
|
381
|
+
'rpc-node',
|
|
376
382
|
'validator-ha-db',
|
|
377
383
|
];
|
|
378
|
-
const pvcComponents = ['p2p-bootstrap', 'prover-node', 'prover-broker', 'sequencer-node', 'rpc', 'validator-ha-db'];
|
|
379
384
|
// StatefulSet components that need to be scaled down before PVC deletion
|
|
380
385
|
// Note: validators use 'sequencer-node' as component label, not 'validator'
|
|
381
386
|
const statefulSetComponents = [
|
|
@@ -383,7 +388,7 @@ export async function rollAztecPods(namespace: string, clearState: boolean = fal
|
|
|
383
388
|
'prover-node',
|
|
384
389
|
'prover-broker',
|
|
385
390
|
'sequencer-node',
|
|
386
|
-
'rpc',
|
|
391
|
+
'rpc-node',
|
|
387
392
|
'validator-ha-db',
|
|
388
393
|
];
|
|
389
394
|
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { Logger } from '@aztec/foundation/log';
|
|
2
|
+
|
|
3
|
+
import { exec } from 'child_process';
|
|
4
|
+
import { promisify } from 'util';
|
|
5
|
+
|
|
6
|
+
import { getSequencers } from './nodes.js';
|
|
7
|
+
|
|
8
|
+
const execAsync = promisify(exec);
|
|
9
|
+
|
|
10
|
+
/** Parsed l2-block-built stats from a sequencer pod log line. */
|
|
11
|
+
export type BlockBuiltLogEntry = {
|
|
12
|
+
blockNumber: number;
|
|
13
|
+
txCount: number;
|
|
14
|
+
duration: number;
|
|
15
|
+
publicProcessDuration: number;
|
|
16
|
+
manaPerSec: number;
|
|
17
|
+
privateLogCount: number;
|
|
18
|
+
publicLogCount: number;
|
|
19
|
+
contractClassLogCount: number;
|
|
20
|
+
contractClassLogSize: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const FIELDS: (keyof BlockBuiltLogEntry)[] = [
|
|
24
|
+
'blockNumber',
|
|
25
|
+
'txCount',
|
|
26
|
+
'duration',
|
|
27
|
+
'publicProcessDuration',
|
|
28
|
+
'manaPerSec',
|
|
29
|
+
'privateLogCount',
|
|
30
|
+
'publicLogCount',
|
|
31
|
+
'contractClassLogCount',
|
|
32
|
+
'contractClassLogSize',
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Fetches l2-block-built log entries from sequencer pods for given block numbers.
|
|
37
|
+
* Queries all validator pods (only the proposer will have the log for a given block).
|
|
38
|
+
*
|
|
39
|
+
* @param namespace - Kubernetes namespace
|
|
40
|
+
* @param sinceTime - ISO 8601 timestamp to limit log search (e.g., from before block building was re-enabled)
|
|
41
|
+
* @param blockNumbers - Set of block numbers to filter for
|
|
42
|
+
* @param logger - Logger instance
|
|
43
|
+
* @returns Array of parsed BlockBuiltLogEntry, de-duplicated by blockNumber, sorted ascending
|
|
44
|
+
*/
|
|
45
|
+
export async function fetchBlockBuiltLogs(
|
|
46
|
+
namespace: string,
|
|
47
|
+
sinceTime: string,
|
|
48
|
+
blockNumbers: Set<number>,
|
|
49
|
+
logger: Logger,
|
|
50
|
+
): Promise<BlockBuiltLogEntry[]> {
|
|
51
|
+
const pods = await getSequencers(namespace);
|
|
52
|
+
const entriesByBlock = new Map<number, BlockBuiltLogEntry>();
|
|
53
|
+
|
|
54
|
+
// Subtract 60s from sinceTime to account for clock skew between test runner and k8s pods.
|
|
55
|
+
// Block number filtering ensures we only match the right blocks, so extra lines are harmless.
|
|
56
|
+
const sinceDate = new Date(new Date(sinceTime).getTime() - 60_000);
|
|
57
|
+
const sinceFlag = sinceDate.toISOString();
|
|
58
|
+
|
|
59
|
+
for (const pod of pods) {
|
|
60
|
+
try {
|
|
61
|
+
const cmd = `kubectl logs ${pod} -n ${namespace} -c aztec --since-time=${sinceFlag}`;
|
|
62
|
+
logger.info(`Fetching logs: ${cmd}`);
|
|
63
|
+
const { stdout } = await execAsync(cmd, { maxBuffer: 10 * 1024 * 1024 });
|
|
64
|
+
|
|
65
|
+
const lines = stdout.split('\n');
|
|
66
|
+
const matchingLines = lines.filter(l => l.includes('l2-block-built'));
|
|
67
|
+
logger.info(`Pod ${pod}: ${lines.length} log lines, ${matchingLines.length} contain l2-block-built`);
|
|
68
|
+
|
|
69
|
+
for (const line of matchingLines) {
|
|
70
|
+
try {
|
|
71
|
+
const parsed = JSON.parse(line);
|
|
72
|
+
if (parsed.eventName !== 'l2-block-built' || !blockNumbers.has(parsed.blockNumber)) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (entriesByBlock.has(parsed.blockNumber)) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const entry: BlockBuiltLogEntry = {} as BlockBuiltLogEntry;
|
|
79
|
+
for (const field of FIELDS) {
|
|
80
|
+
entry[field] = parsed[field] ?? 0;
|
|
81
|
+
}
|
|
82
|
+
entriesByBlock.set(entry.blockNumber, entry);
|
|
83
|
+
logger.verbose(`Parsed l2-block-built log for block ${entry.blockNumber}`, entry);
|
|
84
|
+
} catch {
|
|
85
|
+
// Not valid JSON, skip
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
} catch (err) {
|
|
89
|
+
logger.warn(`Failed to fetch logs from pod ${pod}: ${err}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (entriesByBlock.size < blockNumbers.size) {
|
|
94
|
+
const missing = [...blockNumbers].filter(bn => !entriesByBlock.has(bn));
|
|
95
|
+
logger.warn(`Missing l2-block-built logs for block(s): ${missing.join(', ')}`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return [...entriesByBlock.values()].sort((a, b) => a.blockNumber - b.blockNumber);
|
|
99
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { StubEcdsaAccountContractArtifact, createStubEcdsaAccount } from '@aztec/accounts/ecdsa/stub';
|
|
3
|
+
import { SchnorrAccountContract, SchnorrInitializerlessAccountContract } from '@aztec/accounts/schnorr';
|
|
4
|
+
import { StubSchnorrAccountContractArtifact, createStubSchnorrAccount } from '@aztec/accounts/schnorr/stub';
|
|
5
|
+
import { type Account, type AccountContract, NO_FROM } from '@aztec/aztec.js/account';
|
|
6
|
+
import type { CompleteAddress } from '@aztec/aztec.js/addresses';
|
|
5
7
|
import {
|
|
6
8
|
type CallIntent,
|
|
7
9
|
type ContractFunctionInteractionCallIntent,
|
|
@@ -11,22 +13,34 @@ import {
|
|
|
11
13
|
isContractFunctionInteractionCallIntent,
|
|
12
14
|
lookupValidity,
|
|
13
15
|
} from '@aztec/aztec.js/authorization';
|
|
16
|
+
import { ContractFunctionInteraction } from '@aztec/aztec.js/contracts';
|
|
14
17
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
15
18
|
import { AccountManager, type SendOptions } from '@aztec/aztec.js/wallet';
|
|
19
|
+
import { TxSimulationResultWithAppOffset } from '@aztec/aztec.js/wallet';
|
|
16
20
|
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
21
|
+
import { DefaultEntrypoint } from '@aztec/entrypoints/default';
|
|
17
22
|
import { Fq, Fr } from '@aztec/foundation/curves/bn254';
|
|
18
23
|
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
24
|
+
import type { NotesFilter } from '@aztec/pxe/client/lazy';
|
|
19
25
|
import { type PXEConfig, getPXEConfig } from '@aztec/pxe/config';
|
|
20
|
-
import { PXE, type PXECreationOptions, createPXE } from '@aztec/pxe/server';
|
|
26
|
+
import { PXE, type PXECreationOptions, type TaggingSecretSource, createPXE } from '@aztec/pxe/server';
|
|
21
27
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
22
28
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
|
|
29
|
+
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
30
|
+
import type { NoteDao } from '@aztec/stdlib/note';
|
|
31
|
+
import {
|
|
32
|
+
type BlockHeader,
|
|
33
|
+
type ContractOverrides,
|
|
34
|
+
SimulationOverrides,
|
|
35
|
+
type TxExecutionRequest,
|
|
36
|
+
type TxHash,
|
|
37
|
+
type TxReceipt,
|
|
38
|
+
} from '@aztec/stdlib/tx';
|
|
27
39
|
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
28
|
-
import { BaseWallet, type
|
|
40
|
+
import { BaseWallet, type SimulateViaEntrypointOptions } from '@aztec/wallet-sdk/base-wallet';
|
|
41
|
+
import type { AccountType } from '@aztec/wallets/embedded';
|
|
29
42
|
|
|
43
|
+
import { DEFAULT_MIN_FEE_PADDING } from '../fixtures/fixtures.js';
|
|
30
44
|
import { AztecNodeProxy, ProvenTx } from './utils.js';
|
|
31
45
|
|
|
32
46
|
/**
|
|
@@ -35,6 +49,7 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
|
|
|
35
49
|
export interface AccountData {
|
|
36
50
|
secret: Fr;
|
|
37
51
|
salt: Fr;
|
|
52
|
+
type?: AccountType;
|
|
38
53
|
contract: AccountContract;
|
|
39
54
|
}
|
|
40
55
|
|
|
@@ -43,12 +58,29 @@ export interface AccountData {
|
|
|
43
58
|
* utilities
|
|
44
59
|
* It is intended to be used in e2e tests.
|
|
45
60
|
*/
|
|
61
|
+
/**
|
|
62
|
+
* Poll interval (in seconds) for in-process TestWallet tx waits. In-process nodes reach CHECKPOINTED synchronously
|
|
63
|
+
* under automine and cheaply otherwise, so a sub-second cadence removes almost-pure dead time from every send().wait().
|
|
64
|
+
* Spartan tests run against remote JSON-RPC nodes and restore the 1s default via setDefaultWaitInterval.
|
|
65
|
+
*/
|
|
66
|
+
export const IN_PROCESS_WAIT_INTERVAL_SECONDS = 0.25;
|
|
67
|
+
|
|
46
68
|
export class TestWallet extends BaseWallet {
|
|
47
69
|
constructor(
|
|
48
70
|
pxe: PXE,
|
|
49
71
|
private readonly nodeRef: AztecNodeProxy,
|
|
50
72
|
) {
|
|
51
73
|
super(pxe, nodeRef);
|
|
74
|
+
this.minFeePadding = DEFAULT_MIN_FEE_PADDING;
|
|
75
|
+
this.defaultWaitInterval = IN_PROCESS_WAIT_INTERVAL_SECONDS;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Overrides the poll interval (in seconds) used when a send().wait() caller does not specify one. Pass `undefined`
|
|
80
|
+
* to fall back to the DefaultWaitOpts cadence. Spartan tests set this to 1 so they do not hammer remote nodes.
|
|
81
|
+
*/
|
|
82
|
+
setDefaultWaitInterval(interval?: number): void {
|
|
83
|
+
this.defaultWaitInterval = interval;
|
|
52
84
|
}
|
|
53
85
|
|
|
54
86
|
static async create(
|
|
@@ -62,7 +94,9 @@ export class TestWallet extends BaseWallet {
|
|
|
62
94
|
...overridePXEConfig,
|
|
63
95
|
});
|
|
64
96
|
const pxe = await createPXE(nodeRef, pxeConfig, options);
|
|
65
|
-
|
|
97
|
+
const wallet = new TestWallet(pxe, nodeRef);
|
|
98
|
+
await wallet.initStubClasses();
|
|
99
|
+
return wallet;
|
|
66
100
|
}
|
|
67
101
|
|
|
68
102
|
/**
|
|
@@ -73,110 +107,170 @@ export class TestWallet extends BaseWallet {
|
|
|
73
107
|
this.nodeRef.updateTargetNode(node);
|
|
74
108
|
}
|
|
75
109
|
|
|
76
|
-
createSchnorrAccount(secret: Fr, salt: Fr, signingKey
|
|
77
|
-
|
|
78
|
-
|
|
110
|
+
createSchnorrAccount(secret: Fr, salt: Fr, signingKey: Fq): Promise<AccountManager> {
|
|
111
|
+
return this.createAccount({ secret, salt, type: 'schnorr', contract: new SchnorrAccountContract(signingKey) });
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
createSchnorrInitializerlessAccount(secret: Fr, salt: Fr, signingKey: Fq): Promise<AccountManager> {
|
|
115
|
+
return this.createAccount({
|
|
79
116
|
secret,
|
|
80
117
|
salt,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
118
|
+
type: 'schnorr_initializerless',
|
|
119
|
+
contract: new SchnorrInitializerlessAccountContract(signingKey),
|
|
120
|
+
});
|
|
84
121
|
}
|
|
85
122
|
|
|
86
123
|
createECDSARAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager> {
|
|
87
|
-
|
|
124
|
+
return this.createAccount({
|
|
88
125
|
secret,
|
|
89
126
|
salt,
|
|
127
|
+
type: 'ecdsasecp256r1',
|
|
90
128
|
contract: new EcdsaRAccountContract(signingKey),
|
|
91
|
-
};
|
|
92
|
-
return this.createAccount(accountData);
|
|
129
|
+
});
|
|
93
130
|
}
|
|
94
131
|
|
|
95
132
|
createECDSAKAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager> {
|
|
96
|
-
|
|
133
|
+
return this.createAccount({
|
|
97
134
|
secret,
|
|
98
135
|
salt,
|
|
136
|
+
type: 'ecdsasecp256k1',
|
|
99
137
|
contract: new EcdsaKAccountContract(signingKey),
|
|
100
|
-
};
|
|
101
|
-
return this.createAccount(accountData);
|
|
138
|
+
});
|
|
102
139
|
}
|
|
103
140
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
141
|
+
// Stub class ids, populated on wallet startup
|
|
142
|
+
// to avoid redundant work per simulation
|
|
143
|
+
private stubClassIds = new Map<AccountType, Fr>();
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Hashes and registers the stub class for every supported account type with PXE, populating
|
|
147
|
+
* stubClassIds. Called on wallet initialization.
|
|
148
|
+
*/
|
|
149
|
+
private async initStubClasses(): Promise<void> {
|
|
150
|
+
const { id: schnorrClassId } = await getContractClassFromArtifact(StubSchnorrAccountContractArtifact);
|
|
151
|
+
await this.pxe.registerContractClass(StubSchnorrAccountContractArtifact);
|
|
152
|
+
|
|
153
|
+
// ecdsa stubs share the same class id
|
|
154
|
+
const { id: ecdsaClassId } = await getContractClassFromArtifact(StubEcdsaAccountContractArtifact);
|
|
155
|
+
await this.pxe.registerContractClass(StubEcdsaAccountContractArtifact);
|
|
156
|
+
|
|
157
|
+
this.stubClassIds.set('schnorr', schnorrClassId);
|
|
158
|
+
// Initializerless accounts share the schnorr stub class for kernelless simulation.
|
|
159
|
+
this.stubClassIds.set('schnorr_initializerless', schnorrClassId);
|
|
160
|
+
this.stubClassIds.set('ecdsasecp256k1', ecdsaClassId);
|
|
161
|
+
this.stubClassIds.set('ecdsasecp256r1', ecdsaClassId);
|
|
123
162
|
}
|
|
124
|
-
protected accounts: Map<string, Account> = new Map();
|
|
125
163
|
|
|
126
164
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* When this flag is true, simulateViaEntrypoint constructs a request using a fake account
|
|
130
|
-
* (and accepts contract overrides on the input) and the PXE emulates kernel effects without
|
|
131
|
-
* generating kernel witnesses. When false, simulateViaEntrypoint defers to the standard
|
|
132
|
-
* simulation path via the real account entrypoint.
|
|
165
|
+
* Builds contract overrides for all provided addresses by replacing their account contracts with stub implementations.
|
|
133
166
|
*/
|
|
134
|
-
|
|
167
|
+
protected async buildAccountOverrides(addresses: AztecAddress[]): Promise<ContractOverrides> {
|
|
168
|
+
const accounts = await this.getAccounts();
|
|
169
|
+
const contracts: ContractOverrides = {};
|
|
170
|
+
|
|
171
|
+
const filtered = accounts.filter(acc => addresses.some(addr => addr.equals(acc.item)));
|
|
172
|
+
|
|
173
|
+
for (const account of filtered) {
|
|
174
|
+
const address = account.item;
|
|
175
|
+
const originalAccount = await this.getAccountFromAddress(address);
|
|
176
|
+
const completeAddress = originalAccount.getCompleteAddress();
|
|
177
|
+
const contractInstance = await this.pxe.getContractInstance(completeAddress.address);
|
|
178
|
+
if (!contractInstance) {
|
|
179
|
+
throw new Error(
|
|
180
|
+
`No contract instance found for address: ${completeAddress.address} during account override building. This is a bug!`,
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const type = this.getTypeFor(address);
|
|
185
|
+
const stubClassId = this.stubClassIds.get(type);
|
|
186
|
+
if (!stubClassId) {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`Stub class for account type '${type}' was not registered at wallet init. This is a bug — initStubClasses should cover every supported AccountType.`,
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
contracts[address.toString()] = {
|
|
193
|
+
instance: { ...contractInstance, currentContractClassId: stubClassId },
|
|
194
|
+
};
|
|
195
|
+
}
|
|
135
196
|
|
|
136
|
-
|
|
137
|
-
this.simulatedSimulations = true;
|
|
197
|
+
return contracts;
|
|
138
198
|
}
|
|
139
199
|
|
|
140
|
-
|
|
141
|
-
|
|
200
|
+
protected accounts: Map<string, { account: Account; type: AccountType }> = new Map();
|
|
201
|
+
|
|
202
|
+
private getTypeFor(address: AztecAddress): AccountType {
|
|
203
|
+
return this.accounts.get(address.toString())?.type ?? 'schnorr';
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
private getStubAccountFor(address: AztecAddress, completeAddress: CompleteAddress) {
|
|
207
|
+
const type = this.getTypeFor(address);
|
|
208
|
+
return type === 'schnorr' || type === 'schnorr_initializerless'
|
|
209
|
+
? createStubSchnorrAccount(completeAddress)
|
|
210
|
+
: createStubEcdsaAccount(completeAddress);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Controls how the test wallet simulates transactions:
|
|
215
|
+
* - `kernelless`: Skips kernel circuits but uses the real account contract. Default.
|
|
216
|
+
* - `kernelless-override`: Skips kernels and replaces the account with a stub that doesn't do authwit validation.
|
|
217
|
+
* - `full`: Uses real kernel circuits and real account contracts. Slow!
|
|
218
|
+
*/
|
|
219
|
+
private simulationMode: 'kernelless' | 'kernelless-override' | 'full' = 'kernelless';
|
|
220
|
+
|
|
221
|
+
setSimulationMode(mode: 'kernelless' | 'kernelless-override' | 'full') {
|
|
222
|
+
this.simulationMode = mode;
|
|
142
223
|
}
|
|
143
224
|
|
|
144
225
|
setMinFeePadding(value?: number) {
|
|
145
|
-
this.minFeePadding = value ??
|
|
226
|
+
this.minFeePadding = value ?? DEFAULT_MIN_FEE_PADDING;
|
|
146
227
|
}
|
|
147
228
|
|
|
148
229
|
protected getAccountFromAddress(address: AztecAddress): Promise<Account> {
|
|
149
|
-
|
|
150
|
-
if (address.equals(AztecAddress.ZERO)) {
|
|
151
|
-
account = new SignerlessAccount();
|
|
152
|
-
} else {
|
|
153
|
-
account = this.accounts.get(address?.toString() ?? '');
|
|
154
|
-
}
|
|
230
|
+
const entry = this.accounts.get(address?.toString() ?? '');
|
|
155
231
|
|
|
156
|
-
if (!
|
|
232
|
+
if (!entry) {
|
|
157
233
|
throw new Error(`Account not found in wallet for address: ${address}`);
|
|
158
234
|
}
|
|
159
235
|
|
|
160
|
-
return Promise.resolve(account);
|
|
236
|
+
return Promise.resolve(entry.account);
|
|
161
237
|
}
|
|
162
238
|
|
|
163
239
|
getAccounts() {
|
|
164
|
-
return Promise.resolve(
|
|
240
|
+
return Promise.resolve(
|
|
241
|
+
Array.from(this.accounts.values()).map(entry => ({ alias: '', item: entry.account.getAddress() })),
|
|
242
|
+
);
|
|
165
243
|
}
|
|
166
244
|
|
|
167
245
|
async createAccount(accountData?: AccountData): Promise<AccountManager> {
|
|
168
246
|
const secret = accountData?.secret ?? Fr.random();
|
|
169
247
|
const salt = accountData?.salt ?? Fr.random();
|
|
248
|
+
const type = accountData?.type ?? 'schnorr';
|
|
170
249
|
const contract = accountData?.contract ?? new SchnorrAccountContract(GrumpkinScalar.random());
|
|
171
250
|
|
|
172
|
-
|
|
251
|
+
// Initializerless accounts have no deployment tx: the address commits to the signing public key
|
|
252
|
+
// (via the contract's immutablesHash, resolved by AccountManager.create) and the constructor's
|
|
253
|
+
// storage writes are materialized locally via a simulated "store" call below.
|
|
254
|
+
// Mirrors EmbeddedWallet.createAccountInternal.
|
|
255
|
+
const accountManager = await AccountManager.create(this, secret, contract, { salt });
|
|
173
256
|
|
|
174
257
|
const instance = accountManager.getInstance();
|
|
175
258
|
const artifact = await contract.getContractArtifact();
|
|
176
259
|
|
|
177
260
|
await this.registerContract(instance, artifact, secret);
|
|
178
261
|
|
|
179
|
-
|
|
262
|
+
const address = accountManager.address.toString();
|
|
263
|
+
this.accounts.set(address, { account: await accountManager.getAccount(), type });
|
|
264
|
+
|
|
265
|
+
if (contract instanceof SchnorrInitializerlessAccountContract) {
|
|
266
|
+
const constructorAbi = artifact.functions.find(f => f.name === 'constructor');
|
|
267
|
+
if (!constructorAbi) {
|
|
268
|
+
throw new Error('Could not create SchnorrInitializerlessAccount: constructor ABI not found');
|
|
269
|
+
}
|
|
270
|
+
const { x, y } = await contract.getSigningPublicKey();
|
|
271
|
+
const storeCall = new ContractFunctionInteraction(this, instance.address, constructorAbi, [x, y]);
|
|
272
|
+
await storeCall.simulate({ from: instance.address });
|
|
273
|
+
}
|
|
180
274
|
|
|
181
275
|
return accountManager;
|
|
182
276
|
}
|
|
@@ -219,62 +313,80 @@ export class TestWallet extends BaseWallet {
|
|
|
219
313
|
return account.createAuthWit(intentInnerHash, chainInfo);
|
|
220
314
|
}
|
|
221
315
|
|
|
222
|
-
/**
|
|
223
|
-
* Override simulateViaEntrypoint to use fake accounts for kernelless simulation
|
|
224
|
-
* when simulatedSimulations is enabled. Otherwise falls through to the real entrypoint path.
|
|
225
|
-
*/
|
|
226
316
|
protected override async simulateViaEntrypoint(
|
|
227
317
|
executionPayload: ExecutionPayload,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
skipTxValidation
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (!this.simulatedSimulations) {
|
|
235
|
-
return super.simulateViaEntrypoint(
|
|
236
|
-
executionPayload,
|
|
237
|
-
from,
|
|
238
|
-
feeOptions,
|
|
239
|
-
skipTxValidation,
|
|
240
|
-
skipFeeEnforcement,
|
|
241
|
-
scopes,
|
|
242
|
-
);
|
|
243
|
-
}
|
|
318
|
+
opts: SimulateViaEntrypointOptions,
|
|
319
|
+
): Promise<TxSimulationResultWithAppOffset> {
|
|
320
|
+
const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement, sendMessagesAs } = opts;
|
|
321
|
+
const scopes = this.scopesFrom(from, additionalScopes ?? [], sendMessagesAs);
|
|
322
|
+
const skipKernels = this.simulationMode !== 'full';
|
|
323
|
+
const useOverride = this.simulationMode === 'kernelless-override';
|
|
244
324
|
|
|
245
325
|
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
246
|
-
const executionOptions: DefaultAccountEntrypointOptions = {
|
|
247
|
-
txNonce: Fr.random(),
|
|
248
|
-
cancellable: this.cancellableTransactions,
|
|
249
|
-
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions,
|
|
250
|
-
};
|
|
251
326
|
const finalExecutionPayload = feeExecutionPayload
|
|
252
327
|
? mergeExecutionPayloads([feeExecutionPayload, executionPayload])
|
|
253
328
|
: executionPayload;
|
|
254
|
-
const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(from);
|
|
255
329
|
const chainInfo = await this.getChainInfo();
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
330
|
+
|
|
331
|
+
let overrides = opts.overrides;
|
|
332
|
+
let txRequest: TxExecutionRequest;
|
|
333
|
+
if (useOverride) {
|
|
334
|
+
const accountOverrides = await this.buildAccountOverrides(scopes);
|
|
335
|
+
overrides = new SimulationOverrides({
|
|
336
|
+
publicStorage: overrides?.publicStorage,
|
|
337
|
+
contracts: { ...overrides?.contracts, ...accountOverrides },
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (from === NO_FROM) {
|
|
342
|
+
const entrypoint = new DefaultEntrypoint();
|
|
343
|
+
txRequest = await entrypoint.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo);
|
|
344
|
+
} else {
|
|
345
|
+
let fromAccount: Account;
|
|
346
|
+
if (useOverride) {
|
|
347
|
+
const originalAccount = await this.getAccountFromAddress(from);
|
|
348
|
+
fromAccount = this.getStubAccountFor(from, originalAccount.getCompleteAddress());
|
|
349
|
+
} else {
|
|
350
|
+
fromAccount = await this.getAccountFromAddress(from);
|
|
351
|
+
}
|
|
352
|
+
const executionOptions: DefaultAccountEntrypointOptions = {
|
|
353
|
+
txNonce: Fr.random(),
|
|
354
|
+
cancellable: this.cancellableTransactions,
|
|
355
|
+
// If from is an address, feeOptions include the way the account contract should handle the fee payment
|
|
356
|
+
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions!,
|
|
357
|
+
};
|
|
358
|
+
txRequest = await fromAccount.createTxExecutionRequest(
|
|
359
|
+
finalExecutionPayload,
|
|
360
|
+
feeOptions.gasSettings,
|
|
361
|
+
chainInfo,
|
|
362
|
+
executionOptions,
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const result = await this.pxe.simulateTx(txRequest, {
|
|
266
367
|
simulatePublic: true,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
368
|
+
skipKernels,
|
|
369
|
+
skipFeeEnforcement,
|
|
370
|
+
skipTxValidation,
|
|
371
|
+
overrides,
|
|
270
372
|
scopes,
|
|
373
|
+
senderForTags: this.senderForTagsFrom(from, sendMessagesAs),
|
|
271
374
|
});
|
|
375
|
+
const appCallOffset = await this.computeAppCallOffset(from, feeOptions);
|
|
376
|
+
return TxSimulationResultWithAppOffset.fromResultAndOffset(result, appCallOffset);
|
|
272
377
|
}
|
|
273
378
|
|
|
274
379
|
async proveTx(exec: ExecutionPayload, opts: Omit<SendOptions, 'wait'>): Promise<ProvenTx> {
|
|
275
|
-
const fee = await this.completeFeeOptions(
|
|
380
|
+
const fee = await this.completeFeeOptions({
|
|
381
|
+
from: opts.from,
|
|
382
|
+
feePayer: exec.feePayer,
|
|
383
|
+
gasSettings: opts.fee?.gasSettings,
|
|
384
|
+
});
|
|
276
385
|
const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
|
|
277
|
-
const txProvingResult = await this.pxe.proveTx(txRequest,
|
|
386
|
+
const txProvingResult = await this.pxe.proveTx(txRequest, {
|
|
387
|
+
scopes: this.scopesFrom(opts.from, opts.additionalScopes ?? [], opts.sendMessagesAs),
|
|
388
|
+
senderForTags: this.senderForTagsFrom(opts.from, opts.sendMessagesAs),
|
|
389
|
+
});
|
|
278
390
|
return new ProvenTx(
|
|
279
391
|
this.aztecNode,
|
|
280
392
|
await txProvingResult.toTx(),
|
|
@@ -296,7 +408,16 @@ export class TestWallet extends BaseWallet {
|
|
|
296
408
|
}
|
|
297
409
|
|
|
298
410
|
sync(): Promise<void> {
|
|
299
|
-
return this.pxe.
|
|
411
|
+
return this.pxe.sync();
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Registers a non-sender tagging-secret source (e.g. a raw out-of-band shared secret) so this PXE discovers messages
|
|
416
|
+
* tagged with it. Test-only surface over {@link PXE.registerTaggingSecretSource}, which the base `Wallet` does not
|
|
417
|
+
* expose. The `address-derived` (sender) variant is excluded: use {@link Wallet.registerSender} for that.
|
|
418
|
+
*/
|
|
419
|
+
registerTaggingSecretSource(source: Exclude<TaggingSecretSource, { kind: 'address-derived' }>): Promise<void> {
|
|
420
|
+
return this.pxe.registerTaggingSecretSource(source);
|
|
300
421
|
}
|
|
301
422
|
|
|
302
423
|
stop(): Promise<void> {
|