@aztec/end-to-end 0.0.1-commit.d431d1c → 0.0.1-commit.d58ff9d0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -14
- package/dest/automine/automine_test_context.d.ts +85 -0
- package/dest/automine/automine_test_context.d.ts.map +1 -0
- package/dest/automine/automine_test_context.js +98 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.js +120 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts +48 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts +19 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +141 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.js +50 -54
- package/dest/automine/token/token_contract_test.d.ts +40 -0
- package/dest/automine/token/token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_token_contract → automine/token}/token_contract_test.js +44 -49
- package/dest/automine/token/token_test_helpers.d.ts +73 -0
- package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
- package/dest/automine/token/token_test_helpers.js +97 -0
- package/dest/bench/client_flows/benchmark.d.ts +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +19 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +6 -6
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +68 -44
- package/dest/bench/client_flows/config.d.ts +2 -2
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +18 -0
- package/dest/bench/client_flows/data_extractor.js +1 -0
- package/dest/bench/utils.d.ts +7 -6
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +108 -12
- package/dest/composed/ha/ha_full_setup.d.ts +77 -0
- package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
- package/dest/composed/ha/ha_full_setup.js +383 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.d.ts +15 -0
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.js +34 -0
- package/dest/fixtures/e2e_prover_test.d.ts +18 -14
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +85 -74
- package/dest/fixtures/elu_monitor.d.ts +21 -0
- package/dest/fixtures/elu_monitor.d.ts.map +1 -0
- package/dest/fixtures/elu_monitor.js +102 -0
- package/dest/fixtures/fixtures.d.ts +83 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +86 -0
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/ha_setup.d.ts +71 -0
- package/dest/fixtures/ha_setup.d.ts.map +1 -0
- package/dest/fixtures/ha_setup.js +119 -0
- package/dest/fixtures/index.d.ts +3 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +2 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
- package/dest/fixtures/setup.d.ts +113 -60
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +330 -326
- package/dest/fixtures/setup_p2p_test.d.ts +22 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +46 -35
- package/dest/fixtures/timing.d.ts +42 -0
- package/dest/fixtures/timing.d.ts.map +1 -0
- package/dest/fixtures/timing.js +72 -0
- package/dest/fixtures/token_utils.d.ts +22 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +28 -7
- package/dest/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- package/dest/fixtures/wait_helpers.d.ts +135 -0
- package/dest/fixtures/wait_helpers.d.ts.map +1 -0
- package/dest/fixtures/wait_helpers.js +154 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/install_legacy_contracts.d.cts +10 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/multi-node/block-production/setup.d.ts +97 -0
- package/dest/multi-node/block-production/setup.d.ts.map +1 -0
- package/dest/multi-node/block-production/setup.js +158 -0
- package/dest/multi-node/governance/setup.d.ts +67 -0
- package/dest/multi-node/governance/setup.d.ts.map +1 -0
- package/dest/multi-node/governance/setup.js +126 -0
- package/dest/multi-node/multi_node_test_context.d.ts +212 -0
- package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
- package/dest/multi-node/multi_node_test_context.js +347 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/inactivity_setup.js +111 -0
- package/dest/multi-node/slashing/setup.d.ts +167 -0
- package/dest/multi-node/slashing/setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/setup.js +275 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +22 -12
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.js +99 -35
- package/dest/p2p/reqresp/utils.d.ts +19 -0
- package/dest/p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/p2p/reqresp/utils.js +193 -0
- package/dest/p2p/shared.d.ts +72 -0
- package/dest/p2p/shared.d.ts.map +1 -0
- package/dest/p2p/shared.js +212 -0
- package/dest/shared/cross_chain_test_harness.d.ts +8 -7
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +44 -39
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +27 -15
- package/dest/shared/index.d.ts +2 -1
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/index.js +1 -0
- package/dest/shared/jest_setup.js +41 -1
- package/dest/shared/mock_state_view.d.ts +86 -0
- package/dest/shared/mock_state_view.d.ts.map +1 -0
- package/dest/shared/mock_state_view.js +186 -0
- package/dest/shared/submit-transactions.d.ts +4 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +19 -14
- package/dest/shared/timing_env.d.js +5 -0
- package/dest/shared/timing_env.js +365 -0
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +67 -55
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +29 -17
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +3 -24
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
- package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
- package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +18 -5
- package/dest/single-node/fees/fees_test.d.ts +93 -0
- package/dest/single-node/fees/fees_test.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/fees_test.js +96 -70
- package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
- package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
- package/dest/single-node/l1-reorgs/setup.js +57 -0
- package/dest/single-node/partial-proofs/setup.d.ts +5 -0
- package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
- package/dest/single-node/partial-proofs/setup.js +5 -0
- package/dest/single-node/proving/setup.d.ts +5 -0
- package/dest/single-node/proving/setup.d.ts.map +1 -0
- package/dest/single-node/proving/setup.js +5 -0
- package/dest/single-node/recovery/setup.d.ts +5 -0
- package/dest/single-node/recovery/setup.d.ts.map +1 -0
- package/dest/single-node/recovery/setup.js +5 -0
- package/dest/single-node/setup.d.ts +49 -0
- package/dest/single-node/setup.d.ts.map +1 -0
- package/dest/single-node/setup.js +56 -0
- package/dest/single-node/single_node_test_context.d.ts +360 -0
- package/dest/single-node/single_node_test_context.d.ts.map +1 -0
- package/dest/single-node/single_node_test_context.js +833 -0
- package/dest/spartan/setup_test_wallets.d.ts +12 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +153 -49
- package/dest/spartan/tx_metrics.d.ts +64 -5
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +280 -21
- package/dest/spartan/utils/bot.d.ts +28 -0
- package/dest/spartan/utils/bot.d.ts.map +1 -0
- package/dest/spartan/utils/bot.js +142 -0
- package/dest/spartan/utils/chaos.d.ts +79 -0
- package/dest/spartan/utils/chaos.d.ts.map +1 -0
- package/dest/spartan/utils/chaos.js +142 -0
- package/dest/spartan/utils/clients.d.ts +39 -0
- package/dest/spartan/utils/clients.d.ts.map +1 -0
- package/dest/spartan/utils/clients.js +90 -0
- package/dest/spartan/utils/config.d.ts +19 -0
- package/dest/spartan/utils/config.d.ts.map +1 -0
- package/dest/spartan/utils/config.js +23 -0
- package/dest/spartan/utils/health.d.ts +63 -0
- package/dest/spartan/utils/health.d.ts.map +1 -0
- package/dest/spartan/utils/health.js +202 -0
- package/dest/spartan/utils/helm.d.ts +15 -0
- package/dest/spartan/utils/helm.d.ts.map +1 -0
- package/dest/spartan/utils/helm.js +47 -0
- package/dest/spartan/utils/index.d.ts +11 -0
- package/dest/spartan/utils/index.d.ts.map +1 -0
- package/dest/spartan/utils/index.js +22 -0
- package/dest/spartan/utils/k8s.d.ts +128 -0
- package/dest/spartan/utils/k8s.d.ts.map +1 -0
- package/dest/spartan/utils/k8s.js +381 -0
- package/dest/spartan/utils/nodes.d.ts +40 -0
- package/dest/spartan/utils/nodes.d.ts.map +1 -0
- package/dest/spartan/utils/nodes.js +461 -0
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -0
- package/dest/spartan/utils/scripts.d.ts +30 -0
- package/dest/spartan/utils/scripts.d.ts.map +1 -0
- package/dest/spartan/utils/scripts.js +81 -0
- package/dest/spartan/utils.d.ts +2 -260
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -942
- package/dest/test-wallet/test_wallet.d.ts +105 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +320 -0
- package/dest/test-wallet/utils.d.ts +76 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +126 -0
- package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
- package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
- package/dest/test-wallet/wallet_worker_script.js +56 -0
- package/dest/test-wallet/worker_wallet.d.ts +53 -0
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet.js +157 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts +4 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet_schema.js +23 -0
- package/package.json +53 -46
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -0
- package/src/automine/contracts/fixtures/storage_proof.json +915 -0
- package/src/automine/contracts/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/automine/contracts/fixtures/storage_proof_fixture.ts +173 -0
- package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +213 -0
- package/src/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +56 -69
- package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +51 -59
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +21 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +111 -90
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +1 -0
- package/src/bench/utils.ts +123 -12
- package/src/composed/ha/ha_full_setup.ts +466 -0
- package/src/fixtures/authwit_proxy.ts +54 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +102 -103
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +110 -0
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +192 -0
- package/src/fixtures/index.ts +2 -0
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +421 -444
- package/src/fixtures/setup_p2p_test.ts +54 -54
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +46 -10
- package/src/fixtures/utils.ts +2 -3
- package/src/fixtures/wait_helpers.ts +333 -0
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +106 -0
- package/src/guides/up_quick_start.sh +7 -4
- package/src/infra/README.md +12 -0
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/multi-node/README.md +95 -0
- package/src/multi-node/block-production/setup.ts +272 -0
- package/src/multi-node/governance/setup.ts +172 -0
- package/src/multi-node/multi_node_test_context.ts +447 -0
- package/src/multi-node/slashing/inactivity_setup.ts +139 -0
- package/src/multi-node/slashing/setup.ts +433 -0
- package/src/p2p/README.md +78 -0
- package/src/{e2e_p2p → p2p}/p2p_network.ts +132 -57
- package/src/p2p/reqresp/utils.ts +263 -0
- package/src/p2p/shared.ts +329 -0
- package/src/shared/cross_chain_test_harness.ts +52 -41
- package/src/shared/gas_portal_test_harness.ts +34 -16
- package/src/shared/index.ts +1 -0
- package/src/shared/jest_setup.ts +51 -1
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +22 -19
- package/src/shared/timing_env.d.mts +39 -0
- package/src/shared/timing_env.mjs +363 -0
- package/src/shared/uniswap_l1_l2.ts +109 -74
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +35 -17
- package/src/simulators/token_simulator.ts +6 -30
- package/src/single-node/README.md +60 -0
- package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
- package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
- package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +20 -9
- package/src/{e2e_fees → single-node/fees}/fees_test.ts +120 -95
- package/src/single-node/l1-reorgs/setup.ts +93 -0
- package/src/single-node/partial-proofs/setup.ts +8 -0
- package/src/single-node/proving/setup.ts +15 -0
- package/src/single-node/recovery/setup.ts +8 -0
- package/src/single-node/setup.ts +63 -0
- package/src/single-node/single_node_test_context.ts +1041 -0
- package/src/spartan/setup_test_wallets.ts +208 -34
- package/src/spartan/tx_metrics.ts +255 -26
- package/src/spartan/utils/bot.ts +188 -0
- package/src/spartan/utils/chaos.ts +253 -0
- package/src/spartan/utils/clients.ts +100 -0
- package/src/spartan/utils/config.ts +29 -0
- package/src/spartan/utils/health.ts +255 -0
- package/src/spartan/utils/helm.ts +84 -0
- package/src/spartan/utils/index.ts +71 -0
- package/src/spartan/utils/k8s.ts +535 -0
- package/src/spartan/utils/nodes.ts +543 -0
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/spartan/utils/scripts.ts +99 -0
- package/src/spartan/utils.ts +1 -1246
- package/src/test-wallet/test_wallet.ts +426 -0
- package/src/test-wallet/utils.ts +205 -0
- package/src/test-wallet/wallet_worker_script.ts +66 -0
- package/src/test-wallet/worker_wallet.ts +216 -0
- package/src/test-wallet/worker_wallet_schema.ts +14 -0
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -53
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -47
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -128
- package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -37
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
- package/dest/e2e_deploy_contract/deploy_test.js +0 -50
- package/dest/e2e_epochs/epochs_test.d.ts +0 -94
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -339
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -88
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.d.ts +0 -10
- package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.js +0 -62
- package/dest/e2e_multi_validator/utils.d.ts +0 -12
- package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -26
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +0 -56
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +0 -136
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.d.ts +0 -46
- package/dest/e2e_p2p/shared.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.js +0 -184
- package/dest/e2e_token_contract/token_contract_test.d.ts +0 -42
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -194
- package/src/e2e_deploy_contract/deploy_test.ts +0 -85
- package/src/e2e_epochs/epochs_test.ts +0 -451
- package/src/e2e_l1_publisher/write_json.ts +0 -82
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -75
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -179
- package/src/e2e_p2p/shared.ts +0 -290
- /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
- /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
|
@@ -1,451 +0,0 @@
|
|
|
1
|
-
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
-
import { getTimestampRangeForEpoch } from '@aztec/aztec.js/block';
|
|
3
|
-
import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
4
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
|
-
import type { Logger } from '@aztec/aztec.js/log';
|
|
6
|
-
import { MerkleTreeId } from '@aztec/aztec.js/trees';
|
|
7
|
-
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
8
|
-
import { EpochCache } from '@aztec/epoch-cache';
|
|
9
|
-
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
10
|
-
import { DefaultL1ContractsConfig } from '@aztec/ethereum/config';
|
|
11
|
-
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
12
|
-
import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
13
|
-
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
14
|
-
import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
15
|
-
import { SecretValue } from '@aztec/foundation/config';
|
|
16
|
-
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
17
|
-
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
18
|
-
import { retryUntil } from '@aztec/foundation/retry';
|
|
19
|
-
import { sleep } from '@aztec/foundation/sleep';
|
|
20
|
-
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
21
|
-
import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
22
|
-
import { ProverNode, type ProverNodeConfig, ProverNodePublisher } from '@aztec/prover-node';
|
|
23
|
-
import type { TestProverNode } from '@aztec/prover-node/test';
|
|
24
|
-
import {
|
|
25
|
-
type SequencerClient,
|
|
26
|
-
type SequencerEvents,
|
|
27
|
-
type SequencerPublisher,
|
|
28
|
-
SequencerState,
|
|
29
|
-
} from '@aztec/sequencer-client';
|
|
30
|
-
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
31
|
-
import { type BlockParameter, EthAddress } from '@aztec/stdlib/block';
|
|
32
|
-
import { type L1RollupConstants, getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
33
|
-
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
34
|
-
|
|
35
|
-
import { join } from 'path';
|
|
36
|
-
import type { Hex } from 'viem';
|
|
37
|
-
import { privateKeyToAccount } from 'viem/accounts';
|
|
38
|
-
|
|
39
|
-
import {
|
|
40
|
-
type EndToEndContext,
|
|
41
|
-
type SetupOptions,
|
|
42
|
-
createAndSyncProverNode,
|
|
43
|
-
getPrivateKeyFromIndex,
|
|
44
|
-
setup,
|
|
45
|
-
} from '../fixtures/utils.js';
|
|
46
|
-
|
|
47
|
-
export const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
48
|
-
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
49
|
-
export const ARCHIVER_POLL_INTERVAL = 50;
|
|
50
|
-
export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
51
|
-
|
|
52
|
-
export type EpochsTestOpts = Partial<SetupOptions> & { numberOfAccounts?: number };
|
|
53
|
-
|
|
54
|
-
export type TrackedSequencerEvent = {
|
|
55
|
-
[K in keyof SequencerEvents]: Parameters<SequencerEvents[K]>[0] & {
|
|
56
|
-
type: K;
|
|
57
|
-
sequencerIndex: number;
|
|
58
|
-
validator: EthAddress;
|
|
59
|
-
};
|
|
60
|
-
}[keyof SequencerEvents];
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Tests building of epochs using fast block times and short epochs.
|
|
64
|
-
* Spawns an aztec node and a prover node with fake proofs.
|
|
65
|
-
* Sequencer is allowed to build empty blocks.
|
|
66
|
-
*/
|
|
67
|
-
export class EpochsTestContext {
|
|
68
|
-
public context!: EndToEndContext;
|
|
69
|
-
public l1Client!: ExtendedViemWalletClient;
|
|
70
|
-
public rollup!: RollupContract;
|
|
71
|
-
public constants!: L1RollupConstants;
|
|
72
|
-
public logger!: Logger;
|
|
73
|
-
public monitor!: ChainMonitor;
|
|
74
|
-
public epochCache!: EpochCache;
|
|
75
|
-
public proverDelayer!: Delayer;
|
|
76
|
-
public sequencerDelayer!: Delayer;
|
|
77
|
-
|
|
78
|
-
public proverNodes: ProverNode[] = [];
|
|
79
|
-
public nodes: AztecNodeService[] = [];
|
|
80
|
-
|
|
81
|
-
public epochDuration!: number;
|
|
82
|
-
|
|
83
|
-
public L1_BLOCK_TIME_IN_S!: number;
|
|
84
|
-
public L2_SLOT_DURATION_IN_S!: number;
|
|
85
|
-
|
|
86
|
-
public static async setup(opts: EpochsTestOpts = {}) {
|
|
87
|
-
const test = new EpochsTestContext();
|
|
88
|
-
await test.setup(opts);
|
|
89
|
-
return test;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public static getSlotDurations(opts: EpochsTestOpts = {}) {
|
|
93
|
-
const envEthereumSlotDuration = process.env.L1_BLOCK_TIME
|
|
94
|
-
? parseInt(process.env.L1_BLOCK_TIME)
|
|
95
|
-
: DEFAULT_L1_BLOCK_TIME;
|
|
96
|
-
const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
|
|
97
|
-
const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
|
|
98
|
-
const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
|
|
99
|
-
const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
|
|
100
|
-
const l1PublishingTime = opts.l1PublishingTime ?? 1;
|
|
101
|
-
return {
|
|
102
|
-
l1PublishingTime,
|
|
103
|
-
ethereumSlotDuration,
|
|
104
|
-
aztecSlotDuration,
|
|
105
|
-
aztecEpochDuration,
|
|
106
|
-
aztecProofSubmissionEpochs,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
public async setup(opts: EpochsTestOpts = {}) {
|
|
111
|
-
const {
|
|
112
|
-
ethereumSlotDuration,
|
|
113
|
-
aztecSlotDuration,
|
|
114
|
-
aztecEpochDuration,
|
|
115
|
-
aztecProofSubmissionEpochs,
|
|
116
|
-
l1PublishingTime,
|
|
117
|
-
} = EpochsTestContext.getSlotDurations(opts);
|
|
118
|
-
|
|
119
|
-
this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
|
|
120
|
-
this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
|
|
121
|
-
|
|
122
|
-
// Set up system without any account nor protocol contracts
|
|
123
|
-
// and with faster block times and shorter epochs.
|
|
124
|
-
const context = await setup(opts.numberOfAccounts ?? 0, {
|
|
125
|
-
automineL1Setup: true,
|
|
126
|
-
checkIntervalMs: 50,
|
|
127
|
-
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
128
|
-
worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
|
|
129
|
-
aztecEpochDuration,
|
|
130
|
-
aztecSlotDuration,
|
|
131
|
-
ethereumSlotDuration,
|
|
132
|
-
aztecProofSubmissionEpochs,
|
|
133
|
-
aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
|
|
134
|
-
minTxsPerBlock: 0,
|
|
135
|
-
realProofs: false,
|
|
136
|
-
startProverNode: true,
|
|
137
|
-
proverTestDelayMs: opts.proverTestDelayMs ?? 0,
|
|
138
|
-
// We use numeric incremental prover ids for simplicity, but we can switch to
|
|
139
|
-
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
140
|
-
// Use numeric EthAddress for deterministic prover id
|
|
141
|
-
proverId: EthAddress.fromNumber(1),
|
|
142
|
-
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
143
|
-
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
144
|
-
slasherFlavor: 'none',
|
|
145
|
-
l1PublishingTime,
|
|
146
|
-
...opts,
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
this.context = context;
|
|
150
|
-
this.proverNodes = context.proverNode ? [context.proverNode] : [];
|
|
151
|
-
this.nodes = context.aztecNode ? [context.aztecNode as AztecNodeService] : [];
|
|
152
|
-
this.logger = context.logger;
|
|
153
|
-
this.l1Client = context.deployL1ContractsValues.l1Client;
|
|
154
|
-
this.rollup = RollupContract.getFromConfig(context.config);
|
|
155
|
-
this.epochCache = await EpochCache.create(this.rollup, context.config, { dateProvider: context.dateProvider });
|
|
156
|
-
|
|
157
|
-
// Loop that tracks L1 and L2 block numbers and logs whenever there's a new one.
|
|
158
|
-
this.monitor = new ChainMonitor(this.rollup, context.dateProvider, this.logger).start();
|
|
159
|
-
|
|
160
|
-
// This is hideous.
|
|
161
|
-
// We ought to have a definite reference to the l1TxUtils that we're using in both places, provided by the test context.
|
|
162
|
-
this.proverDelayer = context.proverNode
|
|
163
|
-
? (((context.proverNode as TestProverNode).publisher as ProverNodePublisher).l1TxUtils as DelayedTxUtils).delayer!
|
|
164
|
-
: undefined!;
|
|
165
|
-
this.sequencerDelayer = context.sequencer
|
|
166
|
-
? (
|
|
167
|
-
((context.sequencer as TestSequencerClient).sequencer.publisher as SequencerPublisher)
|
|
168
|
-
.l1TxUtils as DelayedTxUtils
|
|
169
|
-
).delayer!
|
|
170
|
-
: undefined!;
|
|
171
|
-
|
|
172
|
-
if ((context.proverNode && !this.proverDelayer) || (context.sequencer && !this.sequencerDelayer)) {
|
|
173
|
-
throw new Error(`Could not find prover or sequencer delayer`);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Constants used for time calculation
|
|
177
|
-
this.epochDuration = aztecEpochDuration;
|
|
178
|
-
this.constants = {
|
|
179
|
-
epochDuration: aztecEpochDuration,
|
|
180
|
-
slotDuration: aztecSlotDuration,
|
|
181
|
-
l1StartBlock: await this.rollup.getL1StartBlock(),
|
|
182
|
-
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
183
|
-
ethereumSlotDuration,
|
|
184
|
-
proofSubmissionEpochs: Number(await this.rollup.getProofSubmissionEpochs()),
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
this.logger.info(
|
|
188
|
-
`L2 genesis at L1 block ${this.constants.l1StartBlock} (timestamp ${this.constants.l1GenesisTime})`,
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
public async teardown() {
|
|
193
|
-
await this.monitor.stop();
|
|
194
|
-
await Promise.all(this.proverNodes.map(node => tryStop(node, this.logger)));
|
|
195
|
-
await Promise.all(this.nodes.map(node => tryStop(node, this.logger)));
|
|
196
|
-
await this.context.teardown();
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
public async createProverNode(opts: { dontStart?: boolean } & Partial<ProverNodeConfig> = {}) {
|
|
200
|
-
this.logger.warn('Creating and syncing a simulated prover node...');
|
|
201
|
-
const proverNodePrivateKey = this.getNextPrivateKey();
|
|
202
|
-
const suffix = (this.proverNodes.length + 1).toString();
|
|
203
|
-
const proverNode = await withLogNameSuffix(suffix, () =>
|
|
204
|
-
createAndSyncProverNode(
|
|
205
|
-
proverNodePrivateKey,
|
|
206
|
-
{ ...this.context.config },
|
|
207
|
-
{
|
|
208
|
-
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
209
|
-
proverId: EthAddress.fromNumber(parseInt(suffix, 10)),
|
|
210
|
-
dontStart: opts.dontStart,
|
|
211
|
-
...opts,
|
|
212
|
-
},
|
|
213
|
-
this.context.aztecNode,
|
|
214
|
-
this.context.prefilledPublicData ?? [],
|
|
215
|
-
{ dateProvider: this.context.dateProvider },
|
|
216
|
-
),
|
|
217
|
-
);
|
|
218
|
-
this.proverNodes.push(proverNode);
|
|
219
|
-
return proverNode;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
public createNonValidatorNode(opts: Partial<AztecNodeConfig> = {}) {
|
|
223
|
-
this.logger.warn('Creating and syncing a node without a validator...');
|
|
224
|
-
return this.createNode({ ...opts, disableValidator: true });
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
public createValidatorNode(
|
|
228
|
-
privateKeys: `0x${string}`[],
|
|
229
|
-
opts: Partial<AztecNodeConfig> & { txDelayerMaxInclusionTimeIntoSlot?: number; dontStartSequencer?: boolean } = {},
|
|
230
|
-
) {
|
|
231
|
-
this.logger.warn('Creating and syncing a validator node...');
|
|
232
|
-
return this.createNode({ ...opts, disableValidator: false, validatorPrivateKeys: new SecretValue(privateKeys) });
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
private async createNode(
|
|
236
|
-
opts: Partial<AztecNodeConfig> & { txDelayerMaxInclusionTimeIntoSlot?: number; dontStartSequencer?: boolean } = {},
|
|
237
|
-
) {
|
|
238
|
-
const suffix = (this.nodes.length + 1).toString();
|
|
239
|
-
const { mockGossipSubNetwork } = this.context;
|
|
240
|
-
const resolvedConfig = { ...this.context.config, ...opts };
|
|
241
|
-
const p2pEnabled = resolvedConfig.p2pEnabled || mockGossipSubNetwork !== undefined;
|
|
242
|
-
const p2pIp = resolvedConfig.p2pIp ?? (p2pEnabled ? '127.0.0.1' : undefined);
|
|
243
|
-
const node = await withLogNameSuffix(suffix, () =>
|
|
244
|
-
AztecNodeService.createAndSync(
|
|
245
|
-
{
|
|
246
|
-
...resolvedConfig,
|
|
247
|
-
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
248
|
-
validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
|
|
249
|
-
p2pEnabled,
|
|
250
|
-
p2pIp,
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
dateProvider: this.context.dateProvider,
|
|
254
|
-
p2pClientDeps: {
|
|
255
|
-
p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined,
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
prefilledPublicData: this.context.prefilledPublicData,
|
|
260
|
-
...opts,
|
|
261
|
-
},
|
|
262
|
-
),
|
|
263
|
-
);
|
|
264
|
-
|
|
265
|
-
// REFACTOR: We're getting too much into the internals of the sequencer here.
|
|
266
|
-
// We should have a single method for constructing an aztec node that returns a TestAztecNodeService
|
|
267
|
-
// which directly exposes the delayer and sets any test config.
|
|
268
|
-
if (opts.txDelayerMaxInclusionTimeIntoSlot !== undefined) {
|
|
269
|
-
this.logger.info(
|
|
270
|
-
`Setting tx delayer max inclusion time into slot to ${opts.txDelayerMaxInclusionTimeIntoSlot} seconds`,
|
|
271
|
-
);
|
|
272
|
-
// Here we reach into the sequencer and hook in a tx delayer. The problem is that the sequencer's l1 utils only uses a public client, not a wallet.
|
|
273
|
-
// The delayer needs a wallet (a client that can sign), so we have to create one here.
|
|
274
|
-
const l1Client = createExtendedL1Client(
|
|
275
|
-
resolvedConfig.l1RpcUrls!,
|
|
276
|
-
resolvedConfig.publisherPrivateKeys![0]!.getValue(),
|
|
277
|
-
);
|
|
278
|
-
const sequencer = node.getSequencer() as TestSequencerClient;
|
|
279
|
-
const publisher = sequencer.sequencer.publisher;
|
|
280
|
-
const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, this.L1_BLOCK_TIME_IN_S, l1Client);
|
|
281
|
-
delayed.delayer!.setMaxInclusionTimeIntoSlot(opts.txDelayerMaxInclusionTimeIntoSlot);
|
|
282
|
-
publisher.l1TxUtils = delayed;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
this.nodes.push(node);
|
|
286
|
-
return node;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
private getNextPrivateKey(): Hex {
|
|
290
|
-
const key = getPrivateKeyFromIndex(this.nodes.length + this.proverNodes.length + 1);
|
|
291
|
-
return `0x${key!.toString('hex')}`;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */
|
|
295
|
-
public async waitUntilEpochStarts(epoch: number) {
|
|
296
|
-
const [start] = getTimestampRangeForEpoch(EpochNumber(epoch), this.constants);
|
|
297
|
-
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
298
|
-
await waitUntilL1Timestamp(
|
|
299
|
-
this.l1Client,
|
|
300
|
-
start - BigInt(this.L1_BLOCK_TIME_IN_S),
|
|
301
|
-
undefined,
|
|
302
|
-
30 * this.epochDuration,
|
|
303
|
-
);
|
|
304
|
-
return start;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/** Waits until the given checkpoint number is mined. */
|
|
308
|
-
public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout = 120) {
|
|
309
|
-
await retryUntil(
|
|
310
|
-
() => Promise.resolve(target <= this.monitor.checkpointNumber),
|
|
311
|
-
`Wait until checkpoint ${target}`,
|
|
312
|
-
timeout,
|
|
313
|
-
0.1,
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/** Waits until the given checkpoint number is marked as proven. */
|
|
318
|
-
public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout = 120) {
|
|
319
|
-
await retryUntil(
|
|
320
|
-
() => Promise.resolve(target <= this.monitor.provenCheckpointNumber),
|
|
321
|
-
`Wait proven checkpoint ${target}`,
|
|
322
|
-
timeout,
|
|
323
|
-
0.1,
|
|
324
|
-
);
|
|
325
|
-
return this.monitor.provenCheckpointNumber;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/** Waits until the last slot of the proof submission window for a given epoch. */
|
|
329
|
-
public async waitUntilLastSlotOfProofSubmissionWindow(epochNumber: number | bigint) {
|
|
330
|
-
const deadline = getProofSubmissionDeadlineTimestamp(EpochNumber.fromBigInt(BigInt(epochNumber)), this.constants);
|
|
331
|
-
const oneSlotBefore = deadline - BigInt(this.constants.slotDuration);
|
|
332
|
-
const date = new Date(Number(oneSlotBefore) * 1000);
|
|
333
|
-
this.logger.info(`Waiting until last slot of submission window for epoch ${epochNumber} at ${date}`, {
|
|
334
|
-
oneSlotBefore,
|
|
335
|
-
});
|
|
336
|
-
await waitUntilL1Timestamp(this.l1Client, oneSlotBefore);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/** Waits for the aztec node to sync to the target block number. */
|
|
340
|
-
public async waitForNodeToSync(blockNumber: BlockNumber, type: 'proven' | 'finalized' | 'historic') {
|
|
341
|
-
const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
|
|
342
|
-
let synched = false;
|
|
343
|
-
while (!synched) {
|
|
344
|
-
await sleep(waitTime);
|
|
345
|
-
const [syncState, tips] = await Promise.all([
|
|
346
|
-
this.context.aztecNode.getWorldStateSyncStatus(),
|
|
347
|
-
await this.context.aztecNode.getL2Tips(),
|
|
348
|
-
]);
|
|
349
|
-
this.logger.info(`Wait for node synch ${blockNumber} ${type}`, { blockNumber, type, syncState, tips });
|
|
350
|
-
if (type === 'proven') {
|
|
351
|
-
synched = tips.proven.block.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
|
|
352
|
-
} else if (type === 'finalized') {
|
|
353
|
-
synched = syncState.finalizedBlockNumber >= blockNumber;
|
|
354
|
-
} else {
|
|
355
|
-
synched = syncState.oldestHistoricBlockNumber >= blockNumber;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/** Registers the SpamContract on the given wallet. */
|
|
361
|
-
public async registerSpamContract(wallet: Wallet, salt = Fr.ZERO) {
|
|
362
|
-
const instance = await getContractInstanceFromInstantiationParams(SpamContract.artifact, {
|
|
363
|
-
constructorArgs: [],
|
|
364
|
-
constructorArtifact: undefined,
|
|
365
|
-
salt,
|
|
366
|
-
publicKeys: undefined,
|
|
367
|
-
deployer: undefined,
|
|
368
|
-
});
|
|
369
|
-
await wallet.registerContract(instance, SpamContract.artifact);
|
|
370
|
-
return SpamContract.at(instance.address, wallet);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
|
|
374
|
-
public async createL1Client() {
|
|
375
|
-
const { client, delayer } = withDelayer(
|
|
376
|
-
createExtendedL1Client(
|
|
377
|
-
[...this.l1Client.chain.rpcUrls.default.http],
|
|
378
|
-
privateKeyToAccount(this.getNextPrivateKey()),
|
|
379
|
-
this.l1Client.chain,
|
|
380
|
-
),
|
|
381
|
-
this.context.dateProvider!,
|
|
382
|
-
{ ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S },
|
|
383
|
-
);
|
|
384
|
-
expect(await client.getBalance({ address: client.account.address })).toBeGreaterThan(0n);
|
|
385
|
-
return { client, delayer };
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/** Verifies whether the given block number is found on the aztec node. */
|
|
389
|
-
public async verifyHistoricBlock(blockNumber: BlockParameter, expectedSuccess: boolean) {
|
|
390
|
-
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
391
|
-
// at a particular block, so we know whether that historic block is available or has been
|
|
392
|
-
// pruned. Note that `getBlock` would not work here, since it only hits the archiver.
|
|
393
|
-
const result = await this.context.aztecNode
|
|
394
|
-
.findLeavesIndexes(blockNumber, MerkleTreeId.NULLIFIER_TREE, [Fr.ZERO])
|
|
395
|
-
.then(_ => true)
|
|
396
|
-
.catch(_ => false);
|
|
397
|
-
expect(result).toBe(expectedSuccess);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
public watchSequencerEvents(
|
|
401
|
-
sequencers: SequencerClient[],
|
|
402
|
-
getMetadata: (i: number) => Record<string, any> = () => ({}),
|
|
403
|
-
) {
|
|
404
|
-
const stateChanges: TrackedSequencerEvent[] = [];
|
|
405
|
-
const failEvents: TrackedSequencerEvent[] = [];
|
|
406
|
-
|
|
407
|
-
// Note we do not include the 'block-tx-count-check-failed' event here, since it is fine if we dont build
|
|
408
|
-
// due to lack of txs available.
|
|
409
|
-
const failEventsKeys: (keyof SequencerEvents)[] = [
|
|
410
|
-
'block-build-failed',
|
|
411
|
-
'checkpoint-publish-failed',
|
|
412
|
-
'proposer-rollup-check-failed',
|
|
413
|
-
];
|
|
414
|
-
|
|
415
|
-
const makeEvent = (
|
|
416
|
-
i: number,
|
|
417
|
-
eventName: keyof SequencerEvents,
|
|
418
|
-
args: Parameters<SequencerEvents[keyof SequencerEvents]>[0],
|
|
419
|
-
) =>
|
|
420
|
-
({
|
|
421
|
-
...args,
|
|
422
|
-
type: eventName,
|
|
423
|
-
sequencerIndex: i + 2,
|
|
424
|
-
...getMetadata(i),
|
|
425
|
-
}) as TrackedSequencerEvent;
|
|
426
|
-
|
|
427
|
-
sequencers.forEach((sequencer, i) => {
|
|
428
|
-
const sequencerIndex = i + 2;
|
|
429
|
-
sequencer.getSequencer().on('state-changed', (args: Parameters<SequencerEvents['state-changed']>[0]) => {
|
|
430
|
-
const noisyStates = [SequencerState.IDLE, SequencerState.PROPOSER_CHECK, SequencerState.SYNCHRONIZING];
|
|
431
|
-
if (!noisyStates.includes(args.newState)) {
|
|
432
|
-
const evt = makeEvent(i, 'state-changed', args);
|
|
433
|
-
stateChanges.push(evt);
|
|
434
|
-
this.logger.verbose(
|
|
435
|
-
`Sequencer ${sequencerIndex} transitioned from state ${args.oldState} to state ${args.newState}`,
|
|
436
|
-
evt,
|
|
437
|
-
);
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
failEventsKeys.forEach(eventName => {
|
|
441
|
-
sequencer.getSequencer().on(eventName, (args: Parameters<SequencerEvents[typeof eventName]>[0]) => {
|
|
442
|
-
const evt = makeEvent(i, eventName, args);
|
|
443
|
-
failEvents.push(evt);
|
|
444
|
-
this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, undefined, evt);
|
|
445
|
-
});
|
|
446
|
-
});
|
|
447
|
-
});
|
|
448
|
-
|
|
449
|
-
return { failEvents, stateChanges };
|
|
450
|
-
}
|
|
451
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
-
import { BatchedBlob, Blob, getEthBlobEvaluationInputs, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
|
|
4
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
-
import { L2BlockNew } from '@aztec/stdlib/block';
|
|
6
|
-
import { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
7
|
-
|
|
8
|
-
import { writeFile } from 'fs/promises';
|
|
9
|
-
|
|
10
|
-
const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Creates a json object that can be used to test the solidity contract.
|
|
14
|
-
* The json object must be put into
|
|
15
|
-
*/
|
|
16
|
-
export async function writeJson(
|
|
17
|
-
fileName: string,
|
|
18
|
-
block: L2BlockNew,
|
|
19
|
-
l1ToL2Content: Fr[],
|
|
20
|
-
blobs: Blob[],
|
|
21
|
-
batchedBlob: BatchedBlob,
|
|
22
|
-
recipientAddress: AztecAddress,
|
|
23
|
-
deployerAddress: `0x${string}`,
|
|
24
|
-
): Promise<void> {
|
|
25
|
-
if (!AZTEC_GENERATE_TEST_DATA) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
// Path relative to the package.json in the end-to-end folder
|
|
29
|
-
const path = `../../l1-contracts/test/fixtures/${fileName}.json`;
|
|
30
|
-
|
|
31
|
-
const asHex = (value: Fr | Buffer | EthAddress | AztecAddress, size = 64) => {
|
|
32
|
-
const buffer = Buffer.isBuffer(value) ? value : value.toBuffer();
|
|
33
|
-
return `0x${buffer.toString('hex').padStart(size, '0')}`;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// Create a checkpoint header for this block
|
|
37
|
-
const checkpointHeader = CheckpointHeader.random({
|
|
38
|
-
slotNumber: block.slot,
|
|
39
|
-
timestamp: block.timestamp,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const jsonObject = {
|
|
43
|
-
populate: {
|
|
44
|
-
l1ToL2Content: l1ToL2Content.map(value => asHex(value)),
|
|
45
|
-
recipient: asHex(recipientAddress.toField()),
|
|
46
|
-
sender: deployerAddress,
|
|
47
|
-
},
|
|
48
|
-
messages: {
|
|
49
|
-
l2ToL1Messages: block.body.txEffects.flatMap(txEffect => txEffect.l2ToL1Msgs).map(value => asHex(value)),
|
|
50
|
-
},
|
|
51
|
-
checkpoint: {
|
|
52
|
-
// The json formatting in forge is a bit brittle, so we convert Fr to a number in the few values below.
|
|
53
|
-
// This should not be a problem for testing as long as the values are not larger than u32.
|
|
54
|
-
archive: asHex(block.archive.root),
|
|
55
|
-
blobCommitments: getPrefixedEthBlobCommitments(blobs),
|
|
56
|
-
batchedBlobInputs: getEthBlobEvaluationInputs(batchedBlob),
|
|
57
|
-
checkpointNumber: block.number,
|
|
58
|
-
body: `0x${block.body.toBuffer().toString('hex')}`,
|
|
59
|
-
header: {
|
|
60
|
-
lastArchiveRoot: asHex(checkpointHeader.lastArchiveRoot),
|
|
61
|
-
blockHeadersHash: asHex(checkpointHeader.blockHeadersHash),
|
|
62
|
-
blobsHash: asHex(checkpointHeader.blobsHash),
|
|
63
|
-
inHash: asHex(checkpointHeader.inHash),
|
|
64
|
-
outHash: asHex(checkpointHeader.epochOutHash),
|
|
65
|
-
slotNumber: Number(checkpointHeader.slotNumber),
|
|
66
|
-
timestamp: Number(checkpointHeader.timestamp),
|
|
67
|
-
coinbase: asHex(checkpointHeader.coinbase, 40),
|
|
68
|
-
feeRecipient: asHex(checkpointHeader.feeRecipient),
|
|
69
|
-
gasFees: {
|
|
70
|
-
feePerDaGas: Number(checkpointHeader.gasFees.feePerDaGas),
|
|
71
|
-
feePerL2Gas: Number(checkpointHeader.gasFees.feePerL2Gas),
|
|
72
|
-
},
|
|
73
|
-
totalManaUsed: checkpointHeader.totalManaUsed.toNumber(),
|
|
74
|
-
},
|
|
75
|
-
headerHash: asHex(checkpointHeader.hash()),
|
|
76
|
-
numTxs: block.body.txEffects.length,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const output = JSON.stringify(jsonObject, null, 2);
|
|
81
|
-
await writeFile(path, output, 'utf8');
|
|
82
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
3
|
-
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
4
|
-
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
5
|
-
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
6
|
-
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
type EndToEndContext,
|
|
10
|
-
deployAccounts,
|
|
11
|
-
publicDeployAccounts,
|
|
12
|
-
setup,
|
|
13
|
-
teardown as teardownSubsystems,
|
|
14
|
-
} from '../fixtures/setup.js';
|
|
15
|
-
|
|
16
|
-
export class NestedContractTest {
|
|
17
|
-
context!: EndToEndContext;
|
|
18
|
-
logger: Logger;
|
|
19
|
-
wallet!: Wallet;
|
|
20
|
-
defaultAccountAddress!: AztecAddress;
|
|
21
|
-
aztecNode!: AztecNode;
|
|
22
|
-
|
|
23
|
-
parentContract!: ParentContract;
|
|
24
|
-
childContract!: ChildContract;
|
|
25
|
-
|
|
26
|
-
constructor(
|
|
27
|
-
testName: string,
|
|
28
|
-
private numberOfAccounts = 1,
|
|
29
|
-
) {
|
|
30
|
-
this.logger = createLogger(`e2e:e2e_nested_contract:${testName}`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Applies base setup by deploying accounts and publicly deploying them.
|
|
35
|
-
*/
|
|
36
|
-
async applyBaseSetup() {
|
|
37
|
-
this.logger.info('Deploying accounts');
|
|
38
|
-
const { deployedAccounts } = await deployAccounts(
|
|
39
|
-
this.numberOfAccounts,
|
|
40
|
-
this.logger,
|
|
41
|
-
)({
|
|
42
|
-
wallet: this.context.wallet,
|
|
43
|
-
initialFundedAccounts: this.context.initialFundedAccounts,
|
|
44
|
-
});
|
|
45
|
-
this.wallet = this.context.wallet;
|
|
46
|
-
[{ address: this.defaultAccountAddress }] = deployedAccounts;
|
|
47
|
-
this.aztecNode = this.context.aztecNodeService!;
|
|
48
|
-
|
|
49
|
-
this.logger.info('Public deploy accounts');
|
|
50
|
-
await publicDeployAccounts(this.wallet, [this.defaultAccountAddress]);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async setup() {
|
|
54
|
-
this.logger.info('Setting up fresh subsystems');
|
|
55
|
-
this.context = await setup(0, {
|
|
56
|
-
fundSponsoredFPC: true,
|
|
57
|
-
skipAccountDeployment: true,
|
|
58
|
-
});
|
|
59
|
-
await this.applyBaseSetup();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async teardown() {
|
|
63
|
-
await teardownSubsystems(this.context);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async applyManual() {
|
|
67
|
-
this.logger.info('Deploying parent and child contracts');
|
|
68
|
-
const parentContract = await ParentContract.deploy(this.wallet)
|
|
69
|
-
.send({ from: this.defaultAccountAddress })
|
|
70
|
-
.deployed();
|
|
71
|
-
const childContract = await ChildContract.deploy(this.wallet).send({ from: this.defaultAccountAddress }).deployed();
|
|
72
|
-
this.parentContract = parentContract;
|
|
73
|
-
this.childContract = childContract;
|
|
74
|
-
}
|
|
75
|
-
}
|