@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,179 +0,0 @@
|
|
|
1
|
-
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
-
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
4
|
-
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
5
|
-
|
|
6
|
-
import fs from 'fs';
|
|
7
|
-
import 'jest-extended';
|
|
8
|
-
import os from 'os';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
|
|
11
|
-
import { createNodes } from '../fixtures/setup_p2p_test.js';
|
|
12
|
-
import { P2PNetworkTest } from './p2p_network.js';
|
|
13
|
-
|
|
14
|
-
const NUM_NODES = 6;
|
|
15
|
-
const NUM_VALIDATORS = NUM_NODES;
|
|
16
|
-
const COMMITTEE_SIZE = NUM_VALIDATORS;
|
|
17
|
-
const SLASHING_QUORUM = 3;
|
|
18
|
-
const EPOCH_DURATION = 2;
|
|
19
|
-
const SLASHING_ROUND_SIZE_IN_EPOCHS = 2;
|
|
20
|
-
const BOOT_NODE_UDP_PORT = 4500;
|
|
21
|
-
const ETHEREUM_SLOT_DURATION = process.env.CI ? 8 : 4;
|
|
22
|
-
const AZTEC_SLOT_DURATION = ETHEREUM_SLOT_DURATION * 2;
|
|
23
|
-
const SLASHING_UNIT = BigInt(1e18);
|
|
24
|
-
const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
|
|
25
|
-
|
|
26
|
-
// How many epochs it may take to set everything up, so we dont slash during this period
|
|
27
|
-
const SETUP_EPOCH_DURATION = 8;
|
|
28
|
-
|
|
29
|
-
export class P2PInactivityTest {
|
|
30
|
-
public nodes!: AztecNodeService[];
|
|
31
|
-
public activeNodes!: AztecNodeService[];
|
|
32
|
-
public inactiveNodes!: AztecNodeService[];
|
|
33
|
-
|
|
34
|
-
public rollup!: RollupContract;
|
|
35
|
-
public offlineValidators!: EthAddress[];
|
|
36
|
-
|
|
37
|
-
private dataDir: string;
|
|
38
|
-
private inactiveNodeCount: number;
|
|
39
|
-
private keepInitialNode: boolean;
|
|
40
|
-
|
|
41
|
-
constructor(
|
|
42
|
-
public readonly test: P2PNetworkTest,
|
|
43
|
-
opts: { inactiveNodeCount: number; keepInitialNode?: boolean },
|
|
44
|
-
) {
|
|
45
|
-
this.dataDir = fs.mkdtempSync(path.join(os.tmpdir(), test.testName));
|
|
46
|
-
this.inactiveNodeCount = opts.inactiveNodeCount;
|
|
47
|
-
this.keepInitialNode = opts.keepInitialNode ?? false;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static async create(
|
|
51
|
-
testName: string,
|
|
52
|
-
opts: { slashInactivityConsecutiveEpochThreshold: number; inactiveNodeCount: number; keepInitialNode?: boolean },
|
|
53
|
-
) {
|
|
54
|
-
const test = await P2PNetworkTest.create({
|
|
55
|
-
testName,
|
|
56
|
-
numberOfNodes: 0,
|
|
57
|
-
numberOfValidators: NUM_VALIDATORS,
|
|
58
|
-
basePort: BOOT_NODE_UDP_PORT,
|
|
59
|
-
startProverNode: true,
|
|
60
|
-
initialConfig: {
|
|
61
|
-
proverNodeConfig: { proverNodeEpochProvingDelayMs: AZTEC_SLOT_DURATION * 1000 },
|
|
62
|
-
aztecTargetCommitteeSize: COMMITTEE_SIZE,
|
|
63
|
-
aztecSlotDuration: AZTEC_SLOT_DURATION,
|
|
64
|
-
ethereumSlotDuration: ETHEREUM_SLOT_DURATION,
|
|
65
|
-
aztecProofSubmissionEpochs: 1024, // effectively do not reorg
|
|
66
|
-
listenAddress: '127.0.0.1',
|
|
67
|
-
minTxsPerBlock: 0,
|
|
68
|
-
aztecEpochDuration: EPOCH_DURATION,
|
|
69
|
-
validatorReexecute: false,
|
|
70
|
-
sentinelEnabled: true,
|
|
71
|
-
slashingQuorum: SLASHING_QUORUM,
|
|
72
|
-
slashingRoundSizeInEpochs: SLASHING_ROUND_SIZE_IN_EPOCHS,
|
|
73
|
-
slashInactivityTargetPercentage: 0.8,
|
|
74
|
-
slashGracePeriodL2Slots: SETUP_EPOCH_DURATION * EPOCH_DURATION, // do not slash during setup
|
|
75
|
-
slashAmountSmall: SLASHING_UNIT,
|
|
76
|
-
slashAmountMedium: SLASHING_UNIT * 2n,
|
|
77
|
-
slashAmountLarge: SLASHING_UNIT * 3n,
|
|
78
|
-
...opts,
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
return new P2PInactivityTest(test, opts);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
public async setup() {
|
|
85
|
-
await this.test.setup();
|
|
86
|
-
await this.test.applyBaseSetup();
|
|
87
|
-
|
|
88
|
-
// Set slashing penalties for inactivity
|
|
89
|
-
const { rollup } = await this.test.getContracts();
|
|
90
|
-
const [activationThreshold, ejectionThreshold, localEjectionThreshold] = await Promise.all([
|
|
91
|
-
rollup.getActivationThreshold(),
|
|
92
|
-
rollup.getEjectionThreshold(),
|
|
93
|
-
rollup.getLocalEjectionThreshold(),
|
|
94
|
-
]);
|
|
95
|
-
const biggestEjection = ejectionThreshold > localEjectionThreshold ? ejectionThreshold : localEjectionThreshold;
|
|
96
|
-
expect(activationThreshold - SLASHING_AMOUNT).toBeLessThan(biggestEjection);
|
|
97
|
-
this.test.ctx.aztecNodeConfig.slashInactivityPenalty = SLASHING_AMOUNT;
|
|
98
|
-
this.rollup = rollup;
|
|
99
|
-
|
|
100
|
-
if (!this.keepInitialNode) {
|
|
101
|
-
await this.test.ctx.aztecNodeService!.stop();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Create all active nodes
|
|
105
|
-
this.activeNodes = await createNodes(
|
|
106
|
-
this.test.ctx.aztecNodeConfig,
|
|
107
|
-
this.test.ctx.dateProvider!,
|
|
108
|
-
this.test.bootstrapNodeEnr,
|
|
109
|
-
NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode),
|
|
110
|
-
BOOT_NODE_UDP_PORT,
|
|
111
|
-
this.test.prefilledPublicData,
|
|
112
|
-
this.dataDir,
|
|
113
|
-
undefined,
|
|
114
|
-
Number(this.keepInitialNode),
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
// And the ones with an initially disabled sequencer
|
|
118
|
-
const inactiveConfig = { ...this.test.ctx.aztecNodeConfig, dontStartSequencer: true };
|
|
119
|
-
this.inactiveNodes = await createNodes(
|
|
120
|
-
inactiveConfig,
|
|
121
|
-
this.test.ctx.dateProvider!,
|
|
122
|
-
this.test.bootstrapNodeEnr,
|
|
123
|
-
this.inactiveNodeCount,
|
|
124
|
-
BOOT_NODE_UDP_PORT,
|
|
125
|
-
this.test.prefilledPublicData,
|
|
126
|
-
this.dataDir,
|
|
127
|
-
undefined,
|
|
128
|
-
NUM_NODES - this.inactiveNodeCount,
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
this.nodes = [
|
|
132
|
-
...(this.keepInitialNode ? [this.test.ctx.aztecNodeService!] : []),
|
|
133
|
-
...this.activeNodes,
|
|
134
|
-
...this.inactiveNodes,
|
|
135
|
-
];
|
|
136
|
-
|
|
137
|
-
if (this.nodes.length !== NUM_NODES) {
|
|
138
|
-
throw new Error(`Expected ${NUM_NODES} nodes but got ${this.nodes.length}`);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
this.offlineValidators = this.test.validators
|
|
142
|
-
.slice(this.test.validators.length - this.inactiveNodeCount)
|
|
143
|
-
.map(a => a.attester);
|
|
144
|
-
|
|
145
|
-
this.test.logger.warn(`Setup complete. Offline validators are ${this.offlineValidators.join(', ')}.`, {
|
|
146
|
-
validators: this.test.validators,
|
|
147
|
-
offlineValidators: this.offlineValidators,
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// Wait for P2P mesh to be fully formed before starting slashing period
|
|
151
|
-
// This prevents race conditions where validators propose blocks before the network is ready
|
|
152
|
-
await this.test.waitForP2PMeshConnectivity(this.nodes, NUM_NODES);
|
|
153
|
-
|
|
154
|
-
this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION - 1} (slashing will start after it is completed)`);
|
|
155
|
-
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(EpochNumber(SETUP_EPOCH_DURATION - 1));
|
|
156
|
-
|
|
157
|
-
return this;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
public async teardown() {
|
|
161
|
-
await this.test.stopNodes(this.nodes);
|
|
162
|
-
await this.test.teardown();
|
|
163
|
-
for (let i = 0; i < NUM_NODES; i++) {
|
|
164
|
-
fs.rmSync(`${this.dataDir}-${i}`, { recursive: true, force: true, maxRetries: 3 });
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
public get ctx() {
|
|
169
|
-
return this.test.ctx;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
public get logger() {
|
|
173
|
-
return this.test.logger;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
public get slashingAmount() {
|
|
177
|
-
return SLASHING_AMOUNT;
|
|
178
|
-
}
|
|
179
|
-
}
|
package/src/e2e_p2p/shared.ts
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
|
-
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
4
|
-
import { type SentTx, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
5
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
6
|
-
import type { Logger } from '@aztec/aztec.js/log';
|
|
7
|
-
import { Tx, TxStatus } from '@aztec/aztec.js/tx';
|
|
8
|
-
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
9
|
-
import type {
|
|
10
|
-
EmpireSlashingProposerContract,
|
|
11
|
-
RollupContract,
|
|
12
|
-
TallySlashingProposerContract,
|
|
13
|
-
} from '@aztec/ethereum/contracts';
|
|
14
|
-
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
15
|
-
import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
16
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
17
|
-
import { retryUntil } from '@aztec/foundation/retry';
|
|
18
|
-
import { pluralize } from '@aztec/foundation/string';
|
|
19
|
-
import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
20
|
-
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
21
|
-
import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
22
|
-
import { getRoundForOffense } from '@aztec/slasher';
|
|
23
|
-
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
24
|
-
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
25
|
-
import { TestWallet, proveInteraction } from '@aztec/test-wallet/server';
|
|
26
|
-
|
|
27
|
-
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
28
|
-
|
|
29
|
-
// submits a set of transactions to the provided Private eXecution Environment (PXE)
|
|
30
|
-
export const submitComplexTxsTo = async (
|
|
31
|
-
logger: Logger,
|
|
32
|
-
from: AztecAddress,
|
|
33
|
-
spamContract: SpamContract,
|
|
34
|
-
numTxs: number,
|
|
35
|
-
opts: { callPublic?: boolean } = {},
|
|
36
|
-
) => {
|
|
37
|
-
const txs: SentTx[] = [];
|
|
38
|
-
|
|
39
|
-
const seed = 1234n;
|
|
40
|
-
const spamCount = 15;
|
|
41
|
-
for (let i = 0; i < numTxs; i++) {
|
|
42
|
-
const tx = spamContract.methods.spam(seed + BigInt(i * spamCount), spamCount, !!opts.callPublic).send({ from });
|
|
43
|
-
const txHash = await tx.getTxHash();
|
|
44
|
-
|
|
45
|
-
logger.info(`Tx sent with hash ${txHash.toString()}`);
|
|
46
|
-
const receipt = await tx.getReceipt();
|
|
47
|
-
expect(receipt).toEqual(
|
|
48
|
-
expect.objectContaining({
|
|
49
|
-
status: TxStatus.PENDING,
|
|
50
|
-
error: '',
|
|
51
|
-
}),
|
|
52
|
-
);
|
|
53
|
-
logger.info(`Receipt received for ${txHash.toString()}`);
|
|
54
|
-
txs.push(tx);
|
|
55
|
-
}
|
|
56
|
-
return txs;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// creates a wallet and submit a given number of transactions through it.
|
|
60
|
-
export const submitTransactions = async (
|
|
61
|
-
logger: Logger,
|
|
62
|
-
node: AztecNodeService,
|
|
63
|
-
numTxs: number,
|
|
64
|
-
fundedAccount: InitialAccountData,
|
|
65
|
-
): Promise<SentTx[]> => {
|
|
66
|
-
const rpcConfig = getRpcConfig();
|
|
67
|
-
rpcConfig.proverEnabled = false;
|
|
68
|
-
const wallet = await TestWallet.create(node, { ...getPXEConfig(), proverEnabled: false }, { useLogSuffix: true });
|
|
69
|
-
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
70
|
-
return submitTxsTo(wallet, fundedAccountManager.address, numTxs, logger);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export async function prepareTransactions(
|
|
74
|
-
logger: Logger,
|
|
75
|
-
node: AztecNodeService,
|
|
76
|
-
numTxs: number,
|
|
77
|
-
fundedAccount: InitialAccountData,
|
|
78
|
-
): Promise<Tx[]> {
|
|
79
|
-
const rpcConfig = getRpcConfig();
|
|
80
|
-
rpcConfig.proverEnabled = false;
|
|
81
|
-
|
|
82
|
-
const wallet = await TestWallet.create(node, { ...getPXEConfig(), proverEnabled: false }, { useLogSuffix: true });
|
|
83
|
-
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
84
|
-
|
|
85
|
-
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
|
|
86
|
-
salt: Fr.random(),
|
|
87
|
-
});
|
|
88
|
-
await wallet.registerContract(testContractInstance, TestContractArtifact);
|
|
89
|
-
const contract = TestContract.at(testContractInstance.address, wallet);
|
|
90
|
-
|
|
91
|
-
return timesAsync(numTxs, async () => {
|
|
92
|
-
const tx = await proveInteraction(wallet, contract.methods.emit_nullifier(Fr.random()), {
|
|
93
|
-
from: fundedAccountManager.address,
|
|
94
|
-
});
|
|
95
|
-
const txHash = tx.getTxHash();
|
|
96
|
-
logger.info(`Tx prepared with hash ${txHash}`);
|
|
97
|
-
return tx;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export function awaitProposalExecution(
|
|
102
|
-
slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract,
|
|
103
|
-
timeoutSeconds: number,
|
|
104
|
-
logger: Logger,
|
|
105
|
-
): Promise<bigint> {
|
|
106
|
-
return new Promise<bigint>((resolve, reject) => {
|
|
107
|
-
const timeout = setTimeout(() => {
|
|
108
|
-
logger.warn(`Timed out waiting for proposal execution`);
|
|
109
|
-
reject(new Error(`Timeout waiting for proposal execution after ${timeoutSeconds}s`));
|
|
110
|
-
}, timeoutSeconds * 1000);
|
|
111
|
-
|
|
112
|
-
if (slashingProposer.type === 'empire') {
|
|
113
|
-
const unwatch = slashingProposer.listenToPayloadSubmitted(args => {
|
|
114
|
-
logger.warn(`Proposal ${args.payload} from round ${args.round} executed`);
|
|
115
|
-
clearTimeout(timeout);
|
|
116
|
-
unwatch();
|
|
117
|
-
resolve(args.round);
|
|
118
|
-
});
|
|
119
|
-
} else if (slashingProposer.type === 'tally') {
|
|
120
|
-
const unwatch = slashingProposer.listenToRoundExecuted(args => {
|
|
121
|
-
logger.warn(`Slash from round ${args.round} executed`);
|
|
122
|
-
clearTimeout(timeout);
|
|
123
|
-
unwatch();
|
|
124
|
-
resolve(args.round);
|
|
125
|
-
});
|
|
126
|
-
} else {
|
|
127
|
-
clearTimeout(timeout);
|
|
128
|
-
reject(new Error(`Unknown slashing proposer type: ${(slashingProposer as any).type}`));
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export async function awaitCommitteeExists({
|
|
134
|
-
rollup,
|
|
135
|
-
logger,
|
|
136
|
-
}: {
|
|
137
|
-
rollup: RollupContract;
|
|
138
|
-
logger: Logger;
|
|
139
|
-
}): Promise<readonly `0x${string}`[]> {
|
|
140
|
-
logger.info(`Waiting for committee to be set`);
|
|
141
|
-
let committee: EthAddress[] | undefined;
|
|
142
|
-
await retryUntil(
|
|
143
|
-
async () => {
|
|
144
|
-
committee = await rollup.getCurrentEpochCommittee();
|
|
145
|
-
return committee && committee.length > 0;
|
|
146
|
-
},
|
|
147
|
-
'non-empty committee',
|
|
148
|
-
60,
|
|
149
|
-
);
|
|
150
|
-
return committee!.map(c => c.toString() as `0x${string}`);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export async function awaitOffenseDetected({
|
|
154
|
-
logger,
|
|
155
|
-
nodeAdmin,
|
|
156
|
-
slashingRoundSize,
|
|
157
|
-
epochDuration,
|
|
158
|
-
waitUntilOffenseCount,
|
|
159
|
-
timeoutSeconds = 120,
|
|
160
|
-
}: {
|
|
161
|
-
nodeAdmin: AztecNodeAdmin;
|
|
162
|
-
logger: Logger;
|
|
163
|
-
slashingRoundSize: number;
|
|
164
|
-
epochDuration: number;
|
|
165
|
-
waitUntilOffenseCount?: number;
|
|
166
|
-
timeoutSeconds?: number;
|
|
167
|
-
}) {
|
|
168
|
-
const targetOffenseCount = waitUntilOffenseCount ?? 1;
|
|
169
|
-
logger.warn(`Waiting for ${pluralize('offense', targetOffenseCount)} to be detected`);
|
|
170
|
-
const offenses = await retryUntil(
|
|
171
|
-
async () => {
|
|
172
|
-
const offenses = await nodeAdmin.getSlashOffenses('all');
|
|
173
|
-
if (offenses.length >= targetOffenseCount) {
|
|
174
|
-
return offenses;
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
'non-empty offenses',
|
|
178
|
-
timeoutSeconds,
|
|
179
|
-
);
|
|
180
|
-
logger.info(
|
|
181
|
-
`Hit ${offenses.length} offenses on rounds ${unique(offenses.map(o => getRoundForOffense(o, { slashingRoundSize, epochDuration })))}`,
|
|
182
|
-
{ offenses },
|
|
183
|
-
);
|
|
184
|
-
return offenses;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Await the committee to be slashed out of the validator set.
|
|
189
|
-
* Currently assumes that the committee is the same size as the validator set.
|
|
190
|
-
*/
|
|
191
|
-
export async function awaitCommitteeKicked({
|
|
192
|
-
rollup,
|
|
193
|
-
cheatCodes,
|
|
194
|
-
committee,
|
|
195
|
-
slashFactory,
|
|
196
|
-
slashingProposer,
|
|
197
|
-
slashingRoundSize,
|
|
198
|
-
aztecSlotDuration,
|
|
199
|
-
aztecEpochDuration,
|
|
200
|
-
logger,
|
|
201
|
-
offenseEpoch,
|
|
202
|
-
}: {
|
|
203
|
-
rollup: RollupContract;
|
|
204
|
-
cheatCodes: RollupCheatCodes;
|
|
205
|
-
committee: readonly `0x${string}`[];
|
|
206
|
-
slashFactory: SlashFactoryContract;
|
|
207
|
-
slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
|
|
208
|
-
slashingRoundSize: number;
|
|
209
|
-
aztecSlotDuration: number;
|
|
210
|
-
aztecEpochDuration: number;
|
|
211
|
-
logger: Logger;
|
|
212
|
-
offenseEpoch: number;
|
|
213
|
-
}) {
|
|
214
|
-
if (!slashingProposer) {
|
|
215
|
-
throw new Error('No slashing proposer configured. Cannot test slashing.');
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
await cheatCodes.debugRollup();
|
|
219
|
-
|
|
220
|
-
if (slashingProposer.type === 'empire') {
|
|
221
|
-
// Await for the slash payload to be created if empire (no payload is created on tally until execution time)
|
|
222
|
-
const targetEpoch = EpochNumber((await cheatCodes.getEpoch()) + (await rollup.getLagInEpochsForValidatorSet()) + 1);
|
|
223
|
-
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
224
|
-
await cheatCodes.advanceToEpoch(targetEpoch);
|
|
225
|
-
|
|
226
|
-
const slashPayloadEvents = await retryUntil(
|
|
227
|
-
async () => {
|
|
228
|
-
const events = await slashFactory.getSlashPayloadCreatedEvents();
|
|
229
|
-
return events.length > 0 ? events : undefined;
|
|
230
|
-
},
|
|
231
|
-
'slash payload created',
|
|
232
|
-
120,
|
|
233
|
-
1,
|
|
234
|
-
);
|
|
235
|
-
expect(slashPayloadEvents.length).toBe(1);
|
|
236
|
-
// The uniqueness check is needed since a validator may be slashed more than once on the same round (eg because they let two epochs be pruned)
|
|
237
|
-
expect(unique(slashPayloadEvents[0].slashes.map(slash => slash.validator.toString()))).toHaveLength(
|
|
238
|
-
committee.length,
|
|
239
|
-
);
|
|
240
|
-
} else {
|
|
241
|
-
// Use the slash offset to ensure we are in the right epoch for tally
|
|
242
|
-
const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
|
|
243
|
-
const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
|
|
244
|
-
const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
|
|
245
|
-
const firstEpochInOffenseRound = offenseEpoch - (offenseEpoch % slashingRoundSizeInEpochs);
|
|
246
|
-
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
|
|
247
|
-
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
248
|
-
await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), { offset: -aztecSlotDuration / 2 });
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
const attestersPre = await rollup.getAttesters();
|
|
252
|
-
expect(attestersPre.length).toBe(committee.length);
|
|
253
|
-
|
|
254
|
-
for (const attester of attestersPre) {
|
|
255
|
-
const attesterInfo = await rollup.getAttesterView(attester);
|
|
256
|
-
expect(attesterInfo.status).toEqual(1); // Validating
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
const timeout = slashingRoundSize * 2 * aztecSlotDuration + 30;
|
|
260
|
-
logger.info(`Waiting for slash to be executed (timeout ${timeout}s)`);
|
|
261
|
-
await awaitProposalExecution(slashingProposer, timeout, logger);
|
|
262
|
-
|
|
263
|
-
// The attesters should still form the committee but they should be reduced to the "living" status
|
|
264
|
-
await cheatCodes.debugRollup();
|
|
265
|
-
const committeePostSlashing = await rollup.getCurrentEpochCommittee();
|
|
266
|
-
expect(committeePostSlashing?.length).toBe(attestersPre.length);
|
|
267
|
-
|
|
268
|
-
const attestersPostSlashing = await rollup.getAttesters();
|
|
269
|
-
expect(attestersPostSlashing.length).toBe(0);
|
|
270
|
-
|
|
271
|
-
for (const attester of attestersPre) {
|
|
272
|
-
const attesterInfo = await rollup.getAttesterView(attester);
|
|
273
|
-
expect(attesterInfo.status).toEqual(2); // Living
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
logger.info(`Advancing to check current committee`);
|
|
277
|
-
await cheatCodes.debugRollup();
|
|
278
|
-
await cheatCodes.advanceToEpoch(
|
|
279
|
-
EpochNumber((await cheatCodes.getEpoch()) + (await rollup.getLagInEpochsForValidatorSet()) + 1),
|
|
280
|
-
);
|
|
281
|
-
await cheatCodes.debugRollup();
|
|
282
|
-
|
|
283
|
-
const committeeNextEpoch = await rollup.getCurrentEpochCommittee();
|
|
284
|
-
// The committee should be undefined, since the validator set is empty
|
|
285
|
-
// and the tests currently using this helper always set a target committee size.
|
|
286
|
-
expect(committeeNextEpoch).toBeUndefined();
|
|
287
|
-
|
|
288
|
-
const attestersNextEpoch = await rollup.getAttesters();
|
|
289
|
-
expect(attestersNextEpoch.length).toBe(0);
|
|
290
|
-
}
|
/package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js}
RENAMED
|
File without changes
|
/package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts}
RENAMED
|
File without changes
|