chia-blockchain 2.5.2rc2__py3-none-any.whl → 2.5.3rc1__py3-none-any.whl
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.
- chia/__init__.py +7 -0
- chia/_tests/blockchain/blockchain_test_utils.py +1 -1
- chia/_tests/blockchain/test_augmented_chain.py +54 -5
- chia/_tests/blockchain/test_blockchain.py +5 -12
- chia/_tests/blockchain/test_blockchain_transactions.py +3 -5
- chia/_tests/blockchain/test_get_block_generator.py +2 -2
- chia/_tests/blockchain/test_lookup_fork_chain.py +2 -2
- chia/_tests/clvm/benchmark_costs.py +2 -1
- chia/_tests/clvm/coin_store.py +4 -3
- chia/_tests/clvm/test_chialisp_deserialization.py +2 -2
- chia/_tests/clvm/test_curry_and_treehash.py +1 -1
- chia/_tests/clvm/test_puzzle_compression.py +2 -2
- chia/_tests/clvm/test_puzzles.py +2 -2
- chia/_tests/clvm/test_singletons.py +2 -2
- chia/_tests/clvm/test_spend_sim.py +1 -1
- chia/_tests/cmds/cmd_test_utils.py +2 -2
- chia/_tests/cmds/test_click_types.py +2 -2
- chia/_tests/cmds/test_cmd_framework.py +6 -6
- chia/_tests/cmds/test_show.py +4 -3
- chia/_tests/cmds/test_tx_config_args.py +1 -1
- chia/_tests/cmds/testing_classes.py +2 -2
- chia/_tests/cmds/wallet/test_consts.py +2 -2
- chia/_tests/cmds/wallet/test_did.py +2 -2
- chia/_tests/cmds/wallet/test_nft.py +2 -2
- chia/_tests/cmds/wallet/test_notifications.py +3 -2
- chia/_tests/cmds/wallet/test_vcs.py +2 -2
- chia/_tests/cmds/wallet/test_wallet.py +4 -8
- chia/_tests/conftest.py +4 -3
- chia/_tests/connection_utils.py +2 -2
- chia/_tests/core/cmds/test_keys.py +1 -2
- chia/_tests/core/cmds/test_wallet.py +2 -2
- chia/_tests/core/consensus/test_block_creation.py +2 -2
- chia/_tests/core/consensus/test_pot_iterations.py +1 -1
- chia/_tests/core/custom_types/test_coin.py +2 -2
- chia/_tests/core/custom_types/test_proof_of_space.py +2 -2
- chia/_tests/core/custom_types/test_spend_bundle.py +2 -2
- chia/_tests/core/data_layer/conftest.py +1 -1
- chia/_tests/core/data_layer/test_data_layer.py +1 -1
- chia/_tests/core/data_layer/test_data_layer_util.py +1 -1
- chia/_tests/core/data_layer/test_data_rpc.py +2 -2
- chia/_tests/core/data_layer/test_data_store.py +1 -1
- chia/_tests/core/data_layer/test_data_store_schema.py +1 -1
- chia/_tests/core/data_layer/util.py +2 -1
- chia/_tests/core/farmer/test_farmer_api.py +1 -1
- chia/_tests/core/full_node/full_sync/test_full_sync.py +1 -7
- chia/_tests/core/full_node/ram_db.py +2 -1
- chia/_tests/core/full_node/stores/test_block_store.py +2 -2
- chia/_tests/core/full_node/stores/test_coin_store.py +2 -2
- chia/_tests/core/full_node/stores/test_full_node_store.py +3 -3
- chia/_tests/core/full_node/stores/test_hint_store.py +2 -2
- chia/_tests/core/full_node/stores/test_sync_store.py +1 -1
- chia/_tests/core/full_node/test_address_manager.py +1 -1
- chia/_tests/core/full_node/test_block_height_map.py +2 -2
- chia/_tests/core/full_node/test_conditions.py +1 -1
- chia/_tests/core/full_node/test_full_node.py +346 -164
- chia/_tests/core/full_node/test_generator_tools.py +3 -2
- chia/_tests/core/full_node/test_hint_management.py +2 -2
- chia/_tests/core/full_node/test_performance.py +2 -15
- chia/_tests/core/full_node/test_subscriptions.py +1 -1
- chia/_tests/core/full_node/test_transactions.py +186 -185
- chia/_tests/core/full_node/test_tx_processing_queue.py +1 -1
- chia/_tests/core/make_block_generator.py +2 -2
- chia/_tests/core/mempool/test_mempool.py +165 -22
- chia/_tests/core/mempool/test_mempool_fee_estimator.py +1 -1
- chia/_tests/core/mempool/test_mempool_fee_protocol.py +1 -1
- chia/_tests/core/mempool/test_mempool_manager.py +476 -66
- chia/_tests/core/mempool/test_mempool_performance.py +2 -2
- chia/_tests/core/mempool/test_singleton_fast_forward.py +19 -25
- chia/_tests/core/node_height.py +2 -1
- chia/_tests/core/server/test_capabilities.py +1 -1
- chia/_tests/core/server/test_dos.py +36 -28
- chia/_tests/core/server/test_loop.py +3 -3
- chia/_tests/core/server/test_rate_limits.py +1 -1
- chia/_tests/core/server/test_server.py +2 -2
- chia/_tests/core/services/test_services.py +1 -1
- chia/_tests/core/ssl/test_ssl.py +1 -1
- chia/_tests/core/test_coins.py +2 -1
- chia/_tests/core/test_cost_calculation.py +2 -2
- chia/_tests/core/test_crawler.py +2 -2
- chia/_tests/core/test_db_conversion.py +2 -2
- chia/_tests/core/test_db_validation.py +26 -13
- chia/_tests/core/test_farmer_harvester_rpc.py +2 -2
- chia/_tests/core/test_full_node_rpc.py +2 -2
- chia/_tests/core/test_merkle_set.py +2 -2
- chia/_tests/core/test_program.py +2 -2
- chia/_tests/core/test_rpc_util.py +1 -1
- chia/_tests/core/test_seeder.py +1 -1
- chia/_tests/core/util/test_block_cache.py +3 -3
- chia/_tests/core/util/test_jsonify.py +3 -2
- chia/_tests/core/util/test_keychain.py +3 -3
- chia/_tests/core/util/test_streamable.py +3 -4
- chia/_tests/environments/wallet.py +3 -2
- chia/_tests/farmer_harvester/test_farmer.py +3 -4
- chia/_tests/farmer_harvester/test_farmer_harvester.py +2 -2
- chia/_tests/farmer_harvester/test_filter_prefix_bits.py +2 -2
- chia/_tests/farmer_harvester/test_third_party_harvesters.py +3 -4
- chia/_tests/fee_estimation/test_fee_estimation_integration.py +1 -1
- chia/_tests/fee_estimation/test_fee_estimation_rpc.py +2 -2
- chia/_tests/fee_estimation/test_fee_estimation_unit_tests.py +1 -1
- chia/_tests/fee_estimation/test_mempoolitem_height_added.py +3 -4
- chia/_tests/generator/test_compression.py +20 -10
- chia/_tests/generator/test_rom.py +7 -9
- chia/_tests/plot_sync/test_delta.py +2 -2
- chia/_tests/plot_sync/test_plot_sync.py +2 -2
- chia/_tests/plot_sync/test_receiver.py +2 -2
- chia/_tests/plot_sync/test_sender.py +2 -2
- chia/_tests/plot_sync/test_sync_simulated.py +2 -2
- chia/_tests/plot_sync/util.py +3 -2
- chia/_tests/plotting/test_plot_manager.py +1 -1
- chia/_tests/pools/test_pool_cli_parsing.py +3 -2
- chia/_tests/pools/test_pool_cmdline.py +2 -2
- chia/_tests/pools/test_pool_puzzles_lifecycle.py +3 -3
- chia/_tests/pools/test_pool_rpc.py +4 -5
- chia/_tests/pools/test_pool_wallet.py +1 -1
- chia/_tests/pools/test_wallet_pool_store.py +2 -2
- chia/_tests/rpc/test_rpc_client.py +1 -1
- chia/_tests/rpc/test_rpc_server.py +1 -1
- chia/_tests/simulation/test_simulation.py +36 -8
- chia/_tests/simulation/test_simulator.py +5 -5
- chia/_tests/simulation/test_start_simulator.py +2 -2
- chia/_tests/timelord/test_new_peak.py +2 -2
- chia/_tests/tools/test_run_block.py +3 -2
- chia/_tests/util/benchmark_cost.py +2 -2
- chia/_tests/util/benchmarks.py +17 -6
- chia/_tests/util/blockchain.py +2 -1
- chia/_tests/util/blockchain_mock.py +9 -5
- chia/_tests/util/build_network_protocol_files.py +2 -1
- chia/_tests/util/constants.py +2 -1
- chia/_tests/util/full_sync.py +6 -3
- chia/_tests/util/gen_ssl_certs.py +2 -2
- chia/_tests/util/generator_tools_testing.py +4 -3
- chia/_tests/util/get_name_puzzle_conditions.py +2 -2
- chia/_tests/util/misc.py +16 -2
- chia/_tests/util/network_protocol_data.py +17 -7
- chia/_tests/util/run_block.py +6 -8
- chia/_tests/util/setup_nodes.py +4 -3
- chia/_tests/util/spend_sim.py +9 -5
- chia/_tests/util/test_condition_tools.py +2 -2
- chia/_tests/util/test_config.py +2 -1
- chia/_tests/util/test_errors.py +2 -1
- chia/_tests/util/test_full_block_utils.py +17 -7
- chia/_tests/util/test_misc.py +1 -1
- chia/_tests/util/test_network_protocol_test.py +24 -24
- chia/_tests/util/test_replace_str_to_bytes.py +2 -2
- chia/_tests/util/test_trusted_peer.py +1 -1
- chia/_tests/util/time_out_assert.py +20 -7
- chia/_tests/wallet/cat_wallet/test_cat_lifecycle.py +1 -1
- chia/_tests/wallet/cat_wallet/test_cat_outer_puzzle.py +2 -2
- chia/_tests/wallet/cat_wallet/test_cat_wallet.py +5 -6
- chia/_tests/wallet/cat_wallet/test_offer_lifecycle.py +17 -15
- chia/_tests/wallet/cat_wallet/test_trades.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_lifecycle.py +2 -2
- chia/_tests/wallet/clawback/test_clawback_metadata.py +2 -2
- chia/_tests/wallet/conftest.py +3 -3
- chia/_tests/wallet/db_wallet/test_db_graftroot.py +3 -5
- chia/_tests/wallet/db_wallet/test_dl_offers.py +2 -2
- chia/_tests/wallet/db_wallet/test_dl_wallet.py +433 -384
- chia/_tests/wallet/did_wallet/test_did.py +3 -3
- chia/_tests/wallet/nft_wallet/test_nft_1_offers.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_bulk_mint.py +2 -2
- chia/_tests/wallet/nft_wallet/test_nft_lifecycle.py +3 -4
- chia/_tests/wallet/nft_wallet/test_nft_offers.py +1293 -703
- chia/_tests/wallet/nft_wallet/test_nft_puzzles.py +28 -30
- chia/_tests/wallet/nft_wallet/test_nft_wallet.py +2 -2
- chia/_tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +2 -2
- chia/_tests/wallet/rpc/config.py +1 -1
- chia/_tests/wallet/rpc/test_dl_wallet_rpc.py +2 -2
- chia/_tests/wallet/rpc/test_wallet_rpc.py +20 -77
- chia/_tests/wallet/simple_sync/test_simple_sync_protocol.py +9 -7
- chia/_tests/wallet/sync/test_wallet_sync.py +79 -31
- chia/_tests/wallet/test_clvm_streamable.py +2 -2
- chia/_tests/wallet/test_coin_management.py +7 -7
- chia/_tests/wallet/test_coin_selection.py +20 -2
- chia/_tests/wallet/test_conditions.py +2 -2
- chia/_tests/wallet/test_debug_spend_bundle.py +2 -2
- chia/_tests/wallet/test_new_wallet_protocol.py +2 -2
- chia/_tests/wallet/test_nft_store.py +2 -2
- chia/_tests/wallet/test_notifications.py +2 -2
- chia/_tests/wallet/test_puzzle_store.py +2 -2
- chia/_tests/wallet/test_sign_coin_spends.py +2 -2
- chia/_tests/wallet/test_signer_protocol.py +3 -3
- chia/_tests/wallet/test_singleton.py +3 -11
- chia/_tests/wallet/test_singleton_lifecycle_fast.py +12 -13
- chia/_tests/wallet/test_singleton_store.py +2 -4
- chia/_tests/wallet/test_transaction_store.py +2 -2
- chia/_tests/wallet/test_util.py +2 -2
- chia/_tests/wallet/test_wallet.py +53 -49
- chia/_tests/wallet/test_wallet_action_scope.py +24 -6
- chia/_tests/wallet/test_wallet_blockchain.py +1 -1
- chia/_tests/wallet/test_wallet_coin_store.py +2 -2
- chia/_tests/wallet/test_wallet_interested_store.py +2 -2
- chia/_tests/wallet/test_wallet_node.py +3 -3
- chia/_tests/wallet/test_wallet_retry.py +3 -3
- chia/_tests/wallet/test_wallet_state_manager.py +8 -8
- chia/_tests/wallet/test_wallet_test_framework.py +1 -1
- chia/_tests/wallet/test_wallet_trade_store.py +2 -2
- chia/_tests/wallet/test_wallet_utils.py +2 -2
- chia/_tests/wallet/vc_wallet/test_cr_outer_puzzle.py +3 -2
- chia/_tests/wallet/vc_wallet/test_vc_lifecycle.py +15 -15
- chia/_tests/wallet/vc_wallet/test_vc_wallet.py +5 -3
- chia/_tests/wallet/wallet_block_tools.py +15 -7
- chia/_tests/weight_proof/test_weight_proof.py +3 -3
- chia/cmds/chia.py +0 -2
- chia/cmds/cmd_classes.py +3 -3
- chia/cmds/cmd_helpers.py +4 -4
- chia/cmds/cmds_util.py +2 -2
- chia/cmds/coin_funcs.py +3 -2
- chia/cmds/coins.py +1 -1
- chia/cmds/data.py +2 -2
- chia/cmds/data_funcs.py +3 -2
- chia/cmds/db_upgrade_func.py +2 -2
- chia/cmds/db_validate_func.py +15 -8
- chia/cmds/farm.py +2 -4
- chia/cmds/keys.py +0 -2
- chia/cmds/keys_funcs.py +1 -1
- chia/cmds/netspace_funcs.py +2 -1
- chia/cmds/param_types.py +2 -2
- chia/cmds/plotnft.py +2 -2
- chia/cmds/plotnft_funcs.py +2 -2
- chia/cmds/rpc.py +1 -1
- chia/cmds/show.py +1 -2
- chia/cmds/show_funcs.py +6 -3
- chia/cmds/signer.py +1 -2
- chia/cmds/sim.py +1 -2
- chia/cmds/sim_funcs.py +2 -2
- chia/cmds/wallet.py +2 -2
- chia/cmds/wallet_funcs.py +4 -11
- chia/consensus/block_body_validation.py +3 -4
- chia/consensus/block_creation.py +10 -6
- chia/consensus/block_header_validation.py +3 -4
- chia/consensus/block_record.py +2 -3
- chia/consensus/block_rewards.py +1 -1
- chia/consensus/blockchain.py +20 -17
- chia/consensus/blockchain_interface.py +5 -4
- chia/consensus/coinbase.py +2 -2
- chia/consensus/constants.py +1 -1
- chia/consensus/cost_calculator.py +2 -1
- chia/consensus/default_constants.py +4 -3
- chia/consensus/deficit.py +3 -2
- chia/consensus/difficulty_adjustment.py +8 -9
- chia/consensus/find_fork_point.py +4 -3
- chia/consensus/full_block_to_block_record.py +4 -3
- chia/consensus/get_block_challenge.py +4 -3
- chia/consensus/get_block_generator.py +3 -2
- chia/consensus/make_sub_epoch_summary.py +3 -2
- chia/consensus/multiprocess_validation.py +9 -4
- chia/consensus/pos_quality.py +1 -1
- chia/consensus/pot_iterations.py +4 -3
- chia/consensus/vdf_info_computation.py +4 -3
- chia/daemon/client.py +1 -1
- chia/daemon/keychain_server.py +1 -1
- chia/daemon/server.py +1 -1
- chia/daemon/windows_signal.py +1 -1
- chia/data_layer/data_layer.py +4 -3
- chia/data_layer/data_layer_errors.py +1 -1
- chia/data_layer/data_layer_util.py +2 -2
- chia/data_layer/data_layer_wallet.py +47 -69
- chia/data_layer/data_store.py +1 -1
- chia/data_layer/dl_wallet_store.py +5 -6
- chia/data_layer/download_data.py +1 -1
- chia/data_layer/s3_plugin_service.py +4 -4
- chia/data_layer/singleton_record.py +23 -0
- chia/data_layer/util/benchmark.py +2 -1
- chia/farmer/farmer.py +4 -6
- chia/farmer/farmer_api.py +4 -6
- chia/full_node/bitcoin_fee_estimator.py +2 -1
- chia/full_node/block_height_map.py +2 -2
- chia/full_node/block_store.py +8 -9
- chia/{util → full_node}/check_fork_next_block.py +2 -1
- chia/full_node/coin_store.py +10 -10
- chia/full_node/fee_estimate.py +2 -1
- chia/full_node/fee_estimation.py +2 -1
- chia/full_node/fee_estimator.py +2 -1
- chia/full_node/fee_estimator_interface.py +1 -1
- chia/full_node/fee_history.py +2 -1
- chia/full_node/fee_tracker.py +2 -1
- chia/full_node/full_node.py +15 -13
- chia/full_node/full_node_api.py +12 -32
- chia/full_node/full_node_store.py +4 -3
- chia/full_node/hint_management.py +2 -1
- chia/full_node/hint_store.py +3 -3
- chia/full_node/mempool.py +79 -12
- chia/full_node/mempool_check_conditions.py +6 -7
- chia/full_node/mempool_manager.py +168 -21
- chia/full_node/pending_tx_cache.py +2 -2
- chia/full_node/subscriptions.py +2 -2
- chia/full_node/sync_store.py +2 -3
- chia/full_node/tx_processing_queue.py +2 -1
- chia/full_node/weight_proof.py +5 -8
- chia/harvester/harvester.py +5 -3
- chia/harvester/harvester_api.py +2 -2
- chia/introducer/introducer.py +30 -2
- chia/introducer/introducer_api.py +9 -1
- chia/legacy/keyring.py +1 -2
- chia/plot_sync/exceptions.py +2 -1
- chia/plot_sync/receiver.py +2 -2
- chia/plot_sync/sender.py +1 -1
- chia/plotting/cache.py +2 -2
- chia/plotting/check_plots.py +4 -2
- chia/plotting/create_plots.py +1 -1
- chia/plotting/manager.py +3 -3
- chia/plotting/util.py +2 -2
- chia/pools/pool_config.py +1 -1
- chia/pools/pool_puzzles.py +23 -17
- chia/pools/pool_wallet.py +22 -9
- chia/pools/pool_wallet_info.py +2 -2
- chia/protocols/farmer_protocol.py +3 -6
- chia/protocols/full_node_protocol.py +3 -2
- chia/protocols/harvester_protocol.py +3 -4
- chia/protocols/pool_protocol.py +2 -2
- chia/protocols/shared_protocol.py +2 -1
- chia/protocols/timelord_protocol.py +4 -4
- chia/protocols/wallet_protocol.py +2 -2
- chia/rpc/data_layer_rpc_api.py +3 -4
- chia/rpc/data_layer_rpc_client.py +3 -2
- chia/rpc/farmer_rpc_api.py +2 -2
- chia/rpc/farmer_rpc_client.py +2 -1
- chia/rpc/full_node_rpc_api.py +3 -2
- chia/rpc/full_node_rpc_client.py +3 -2
- chia/rpc/harvester_rpc_api.py +2 -1
- chia/rpc/rpc_client.py +2 -2
- chia/rpc/rpc_server.py +1 -1
- chia/rpc/wallet_request_types.py +2 -62
- chia/rpc/wallet_rpc_api.py +98 -628
- chia/rpc/wallet_rpc_client.py +5 -253
- chia/seeder/crawl_store.py +1 -1
- chia/seeder/crawler.py +2 -2
- chia/seeder/peer_record.py +2 -1
- chia/seeder/start_crawler.py +3 -1
- chia/server/address_manager.py +2 -1
- chia/server/address_manager_store.py +1 -1
- chia/server/capabilities.py +2 -1
- chia/server/introducer_peers.py +2 -1
- chia/server/node_discovery.py +1 -1
- chia/server/outbound_message.py +2 -1
- chia/server/server.py +2 -2
- chia/server/start_data_layer.py +2 -1
- chia/server/start_farmer.py +3 -1
- chia/server/start_full_node.py +4 -2
- chia/server/start_harvester.py +3 -1
- chia/server/start_introducer.py +12 -1
- chia/server/start_service.py +2 -1
- chia/server/start_timelord.py +3 -1
- chia/server/start_wallet.py +3 -1
- chia/server/upnp.py +1 -2
- chia/server/ws_connection.py +3 -4
- chia/simulator/add_blocks_in_batches.py +5 -3
- chia/simulator/block_tools.py +16 -12
- chia/simulator/full_node_simulator.py +9 -14
- chia/simulator/setup_services.py +5 -3
- chia/simulator/simulator_full_node_rpc_api.py +3 -2
- chia/simulator/simulator_full_node_rpc_client.py +3 -2
- chia/simulator/simulator_protocol.py +3 -2
- chia/simulator/simulator_test_tools.py +2 -2
- chia/simulator/start_simulator.py +3 -2
- chia/simulator/wallet_tools.py +3 -4
- chia/timelord/iters_from_block.py +4 -4
- chia/timelord/timelord.py +7 -12
- chia/timelord/timelord_api.py +3 -3
- chia/timelord/timelord_state.py +4 -3
- chia/types/block_protocol.py +2 -2
- chia/types/blockchain_format/coin.py +2 -2
- chia/types/blockchain_format/program.py +1 -1
- chia/types/blockchain_format/proof_of_space.py +3 -4
- chia/types/blockchain_format/tree_hash.py +1 -1
- chia/types/blockchain_format/vdf.py +3 -4
- chia/types/clvm_cost.py +1 -1
- chia/types/coin_record.py +4 -3
- chia/types/coin_spend.py +1 -1
- chia/types/eligible_coin_spends.py +9 -5
- chia/types/fee_rate.py +1 -1
- chia/types/generator_types.py +3 -3
- chia/types/internal_mempool_item.py +3 -2
- chia/types/mempool_item.py +10 -3
- chia/types/mempool_submission_status.py +2 -1
- chia/types/mojos.py +1 -1
- chia/types/peer_info.py +2 -1
- chia/types/transaction_queue_entry.py +2 -1
- chia/types/unfinished_header_block.py +4 -4
- chia/types/validation_state.py +2 -1
- chia/types/weight_proof.py +1 -9
- chia/util/augmented_chain.py +20 -9
- chia/util/block_cache.py +8 -4
- chia/util/condition_tools.py +2 -2
- chia/util/full_block_utils.py +3 -4
- chia/util/generator_tools.py +2 -2
- chia/util/initial-config.yaml +2 -11
- chia/util/network.py +2 -2
- chia/util/prev_transaction_block.py +2 -1
- chia/util/task_timing.py +1 -1
- chia/util/vdf_prover.py +3 -3
- chia/util/ws_message.py +1 -1
- chia/wallet/cat_wallet/cat_info.py +3 -2
- chia/wallet/cat_wallet/cat_outer_puzzle.py +3 -2
- chia/wallet/cat_wallet/cat_utils.py +6 -4
- chia/wallet/cat_wallet/cat_wallet.py +16 -18
- chia/wallet/cat_wallet/lineage_store.py +2 -1
- chia/wallet/coin_selection.py +5 -5
- chia/wallet/conditions.py +22 -16
- chia/wallet/db_wallet/db_wallet_puzzles.py +15 -15
- chia/wallet/derivation_record.py +2 -2
- chia/wallet/derive_keys.py +2 -2
- chia/wallet/did_wallet/did_info.py +3 -2
- chia/wallet/did_wallet/did_wallet.py +41 -19
- chia/wallet/did_wallet/did_wallet_puzzles.py +18 -12
- chia/wallet/driver_protocol.py +1 -1
- chia/wallet/lineage_proof.py +3 -2
- chia/wallet/nft_wallet/metadata_outer_puzzle.py +6 -7
- chia/wallet/nft_wallet/nft_info.py +5 -5
- chia/wallet/nft_wallet/nft_puzzle_utils.py +293 -0
- chia/wallet/nft_wallet/nft_puzzles.py +21 -298
- chia/wallet/nft_wallet/nft_wallet.py +47 -62
- chia/wallet/nft_wallet/ownership_outer_puzzle.py +4 -8
- chia/wallet/nft_wallet/singleton_outer_puzzle.py +3 -2
- chia/wallet/nft_wallet/transfer_program_puzzle.py +6 -10
- chia/wallet/nft_wallet/uncurry_nft.py +6 -8
- chia/wallet/notification_manager.py +5 -5
- chia/wallet/notification_store.py +3 -2
- chia/wallet/outer_puzzles.py +2 -1
- chia/wallet/puzzles/clawback/drivers.py +21 -8
- chia/wallet/puzzles/clawback/metadata.py +3 -2
- chia/wallet/puzzles/clawback/puzzle_decorator.py +5 -4
- chia/wallet/puzzles/deployed_puzzle_hashes.json +0 -10
- chia/wallet/puzzles/p2_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_conditions.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle.py +3 -2
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +3 -3
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +3 -2
- chia/wallet/puzzles/p2_puzzle_hash.py +4 -3
- chia/wallet/puzzles/puzzle_utils.py +3 -2
- chia/wallet/puzzles/singleton_top_layer.py +26 -10
- chia/wallet/puzzles/singleton_top_layer_v1_1.py +21 -9
- chia/wallet/puzzles/tails.py +21 -129
- chia/wallet/signer_protocol.py +3 -2
- chia/wallet/singleton.py +12 -6
- chia/wallet/singleton_record.py +3 -2
- chia/wallet/trade_manager.py +31 -55
- chia/wallet/trade_record.py +3 -2
- chia/wallet/trading/offer.py +14 -13
- chia/wallet/trading/trade_store.py +3 -4
- chia/wallet/transaction_record.py +2 -2
- chia/wallet/util/blind_signer_tl.py +3 -2
- chia/wallet/util/compute_hints.py +3 -2
- chia/wallet/util/compute_memos.py +2 -2
- chia/wallet/util/curry_and_treehash.py +1 -2
- chia/wallet/util/merkle_tree.py +1 -1
- chia/wallet/util/merkle_utils.py +1 -1
- chia/wallet/util/new_peak_queue.py +2 -1
- chia/wallet/util/notifications.py +5 -4
- chia/wallet/util/peer_request_cache.py +3 -2
- chia/wallet/util/puzzle_compression.py +6 -4
- chia/wallet/util/puzzle_decorator.py +6 -4
- chia/wallet/util/query_filter.py +3 -2
- chia/wallet/util/tx_config.py +3 -3
- chia/wallet/util/wallet_sync_utils.py +2 -2
- chia/wallet/util/wallet_types.py +2 -3
- chia/wallet/vc_wallet/cr_cat_drivers.py +18 -22
- chia/wallet/vc_wallet/cr_cat_wallet.py +14 -10
- chia/wallet/vc_wallet/cr_outer_puzzle.py +2 -2
- chia/wallet/vc_wallet/vc_drivers.py +50 -68
- chia/wallet/vc_wallet/vc_store.py +2 -2
- chia/wallet/vc_wallet/vc_wallet.py +47 -15
- chia/wallet/wallet.py +51 -46
- chia/wallet/wallet_action_scope.py +4 -0
- chia/wallet/wallet_blockchain.py +12 -7
- chia/wallet/wallet_coin_record.py +3 -2
- chia/wallet/wallet_coin_store.py +3 -2
- chia/wallet/wallet_info.py +2 -1
- chia/wallet/wallet_interested_store.py +3 -2
- chia/wallet/wallet_nft_store.py +4 -4
- chia/wallet/wallet_node.py +3 -4
- chia/wallet/wallet_pool_store.py +3 -4
- chia/wallet/wallet_protocol.py +19 -5
- chia/wallet/wallet_puzzle_store.py +2 -2
- chia/wallet/wallet_retry_store.py +3 -6
- chia/wallet/wallet_singleton_store.py +2 -2
- chia/wallet/wallet_state_manager.py +20 -197
- chia/wallet/wallet_transaction_store.py +2 -2
- chia/wallet/wallet_user_store.py +2 -1
- chia/wallet/wallet_weight_proof_handler.py +3 -2
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3rc1.dist-info/RECORD +891 -0
- mozilla-ca/cacert.pem +64 -33
- chia/_tests/clvm/test_condition_codes.py +0 -13
- chia/_tests/cmds/wallet/test_dao.py +0 -565
- chia/_tests/wallet/dao_wallet/__init__.py +0 -0
- chia/_tests/wallet/dao_wallet/config.py +0 -3
- chia/_tests/wallet/dao_wallet/test_dao_clvm.py +0 -1330
- chia/_tests/wallet/dao_wallet/test_dao_wallets.py +0 -3488
- chia/cmds/dao.py +0 -1064
- chia/cmds/dao_funcs.py +0 -598
- chia/consensus/puzzles/__init__.py +0 -0
- chia/consensus/puzzles/chialisp_deserialisation.clsp +0 -69
- chia/consensus/puzzles/chialisp_deserialisation.clsp.hex +0 -1
- chia/consensus/puzzles/rom_bootstrap_generator.clsp +0 -37
- chia/consensus/puzzles/rom_bootstrap_generator.clsp.hex +0 -1
- chia/full_node/puzzles/__init__.py +0 -0
- chia/full_node/puzzles/block_program_zero.clsp +0 -14
- chia/full_node/puzzles/block_program_zero.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp +0 -5
- chia/full_node/puzzles/decompress_coin_spend_entry.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp +0 -7
- chia/full_node/puzzles/decompress_coin_spend_entry_with_prefix.clsp.hex +0 -1
- chia/full_node/puzzles/decompress_puzzle.clsp +0 -6
- chia/full_node/puzzles/decompress_puzzle.clsp.hex +0 -1
- chia/pools/puzzles/__init__.py +0 -0
- chia/pools/puzzles/pool_member_innerpuz.clsp +0 -70
- chia/pools/puzzles/pool_member_innerpuz.clsp.hex +0 -1
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp +0 -69
- chia/pools/puzzles/pool_waitingroom_innerpuz.clsp.hex +0 -1
- chia/simulator/simulator_constants.py +0 -13
- chia/types/blockchain_format/foliage.py +0 -8
- chia/types/blockchain_format/pool_target.py +0 -5
- chia/types/blockchain_format/reward_chain_block.py +0 -6
- chia/types/blockchain_format/sized_bytes.py +0 -11
- chia/util/ints.py +0 -19
- chia/wallet/cat_wallet/dao_cat_info.py +0 -28
- chia/wallet/cat_wallet/dao_cat_wallet.py +0 -669
- chia/wallet/cat_wallet/puzzles/__init__.py +0 -0
- chia/wallet/cat_wallet/puzzles/cat_truths.clib +0 -31
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp +0 -397
- chia/wallet/cat_wallet/puzzles/cat_v2.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp +0 -25
- chia/wallet/cat_wallet/puzzles/delegated_tail.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp +0 -15
- chia/wallet/cat_wallet/puzzles/everything_with_signature.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp +0 -26
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp +0 -42
- chia/wallet/cat_wallet/puzzles/genesis_by_coin_id_or_singleton.clsp.hex +0 -1
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp +0 -24
- chia/wallet/cat_wallet/puzzles/genesis_by_puzzle_hash.clsp.hex +0 -1
- chia/wallet/dao_wallet/__init__.py +0 -0
- chia/wallet/dao_wallet/dao_info.py +0 -61
- chia/wallet/dao_wallet/dao_utils.py +0 -811
- chia/wallet/dao_wallet/dao_wallet.py +0 -2119
- chia/wallet/did_wallet/puzzles/__init__.py +0 -0
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp +0 -135
- chia/wallet/did_wallet/puzzles/did_innerpuz.clsp.hex +0 -1
- chia/wallet/payment.py +0 -33
- chia/wallet/puzzles/augmented_condition.clsp +0 -13
- chia/wallet/puzzles/augmented_condition.clsp.hex +0 -1
- chia/wallet/puzzles/condition_codes.clib +0 -77
- chia/wallet/puzzles/curry-and-treehash.clib +0 -102
- chia/wallet/puzzles/curry.clib +0 -135
- chia/wallet/puzzles/curry_by_index.clib +0 -16
- chia/wallet/puzzles/dao_cat_eve.clsp +0 -17
- chia/wallet/puzzles/dao_cat_eve.clsp.hex +0 -1
- chia/wallet/puzzles/dao_cat_launcher.clsp +0 -36
- chia/wallet/puzzles/dao_cat_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp +0 -35
- chia/wallet/puzzles/dao_finished_state.clsp.hex +0 -1
- chia/wallet/puzzles/dao_finished_state.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_lockup.clsp +0 -288
- chia/wallet/puzzles/dao_lockup.clsp.hex +0 -1
- chia/wallet/puzzles/dao_lockup.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal.clsp +0 -377
- chia/wallet/puzzles/dao_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp +0 -78
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_timer.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp +0 -87
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex +0 -1
- chia/wallet/puzzles/dao_proposal_validator.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp +0 -240
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex +0 -1
- chia/wallet/puzzles/dao_spend_p2_singleton_v2.clsp.hex.sha256tree +0 -1
- chia/wallet/puzzles/dao_treasury.clsp +0 -115
- chia/wallet/puzzles/dao_treasury.clsp.hex +0 -1
- chia/wallet/puzzles/dao_update_proposal.clsp +0 -44
- chia/wallet/puzzles/dao_update_proposal.clsp.hex +0 -1
- chia/wallet/puzzles/json.clib +0 -25
- chia/wallet/puzzles/merkle_utils.clib +0 -18
- chia/wallet/puzzles/notification.clsp +0 -7
- chia/wallet/puzzles/notification.clsp.hex +0 -1
- chia/wallet/puzzles/p2_1_of_n.clsp +0 -22
- chia/wallet/puzzles/p2_1_of_n.clsp.hex +0 -1
- chia/wallet/puzzles/p2_conditions.clsp +0 -3
- chia/wallet/puzzles/p2_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_conditions.clsp +0 -18
- chia/wallet/puzzles/p2_delegated_conditions.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle.clsp +0 -19
- chia/wallet/puzzles/p2_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp +0 -91
- chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp +0 -108
- chia/wallet/puzzles/p2_m_of_n_delegate_direct.clsp.hex +0 -1
- chia/wallet/puzzles/p2_parent.clsp +0 -19
- chia/wallet/puzzles/p2_parent.clsp.hex +0 -1
- chia/wallet/puzzles/p2_puzzle_hash.clsp +0 -18
- chia/wallet/puzzles/p2_puzzle_hash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton.clsp +0 -30
- chia/wallet/puzzles/p2_singleton.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_aggregator.clsp +0 -81
- chia/wallet/puzzles/p2_singleton_aggregator.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp +0 -50
- chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clsp.hex +0 -1
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp +0 -47
- chia/wallet/puzzles/p2_singleton_via_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/puzzles/settlement_payments.clsp +0 -49
- chia/wallet/puzzles/settlement_payments.clsp.hex +0 -1
- chia/wallet/puzzles/sha256tree.clib +0 -11
- chia/wallet/puzzles/singleton_launcher.clsp +0 -16
- chia/wallet/puzzles/singleton_launcher.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer.clsp +0 -177
- chia/wallet/puzzles/singleton_top_layer.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp +0 -107
- chia/wallet/puzzles/singleton_top_layer_v1_1.clsp.hex +0 -1
- chia/wallet/puzzles/singleton_truths.clib +0 -21
- chia/wallet/vc_wallet/cr_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp +0 -3
- chia/wallet/vc_wallet/cr_puzzles/conditions_w_fee_announce.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp +0 -304
- chia/wallet/vc_wallet/cr_puzzles/credential_restriction.clsp.hex +0 -1
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp +0 -45
- chia/wallet/vc_wallet/cr_puzzles/flag_proofs_checker.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/__init__.py +0 -0
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp +0 -30
- chia/wallet/vc_wallet/vc_puzzles/covenant_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp +0 -75
- chia/wallet/vc_wallet/vc_puzzles/eml_covenant_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp +0 -32
- chia/wallet/vc_wallet/vc_puzzles/eml_transfer_program_covenant_adapter.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp +0 -80
- chia/wallet/vc_wallet/vc_puzzles/eml_update_metadata_with_DID.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp +0 -163
- chia/wallet/vc_wallet/vc_puzzles/exigent_metadata_layer.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp +0 -16
- chia/wallet/vc_wallet/vc_puzzles/p2_announced_delegated_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp +0 -74
- chia/wallet/vc_wallet/vc_puzzles/standard_vc_backdoor_puzzle.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp +0 -23
- chia/wallet/vc_wallet/vc_puzzles/std_parent_morpher.clsp.hex +0 -1
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp +0 -64
- chia/wallet/vc_wallet/vc_puzzles/viral_backdoor.clsp.hex +0 -1
- chia_blockchain-2.5.2rc2.dist-info/RECORD +0 -1042
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc2.dist-info → chia_blockchain-2.5.3rc1.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
|
+
from chia_rs.sized_ints import uint64, uint128
|
|
4
5
|
|
|
5
6
|
from chia._tests.util.misc import BenchmarkRunner, wallet_height_at_least
|
|
6
7
|
from chia._tests.util.setup_nodes import OldSimulatorsAndWallets
|
|
@@ -9,7 +10,6 @@ from chia.simulator.add_blocks_in_batches import add_blocks_in_batches
|
|
|
9
10
|
from chia.types.full_block import FullBlock
|
|
10
11
|
from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
11
12
|
from chia.types.peer_info import PeerInfo
|
|
12
|
-
from chia.util.ints import uint64, uint128
|
|
13
13
|
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG
|
|
14
14
|
from chia.wallet.wallet_node import WalletNode
|
|
15
15
|
|
|
@@ -45,7 +45,7 @@ async def test_mempool_update_performance(
|
|
|
45
45
|
|
|
46
46
|
ph = await wallet.get_new_puzzlehash()
|
|
47
47
|
async with wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=False, sign=True) as action_scope:
|
|
48
|
-
await wallet.generate_signed_transaction(send_amount, ph, action_scope, fee_amount)
|
|
48
|
+
await wallet.generate_signed_transaction([send_amount], [ph], action_scope, fee_amount)
|
|
49
49
|
[big_transaction] = action_scope.side_effects.transactions
|
|
50
50
|
assert big_transaction.spend_bundle is not None
|
|
51
51
|
status, err = await full_node.add_transaction(
|
|
@@ -6,6 +6,8 @@ from typing import Any, Optional
|
|
|
6
6
|
|
|
7
7
|
import pytest
|
|
8
8
|
from chia_rs import AugSchemeMPL, G1Element, G2Element, PrivateKey
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint64
|
|
9
11
|
from chiabip158 import PyBIP158
|
|
10
12
|
|
|
11
13
|
from chia._tests.clvm.test_puzzles import public_key_for_index, secret_exponent_for_index
|
|
@@ -24,7 +26,6 @@ from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
|
24
26
|
from chia.types.blockchain_format.coin import Coin
|
|
25
27
|
from chia.types.blockchain_format.program import Program
|
|
26
28
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
27
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
28
29
|
from chia.types.coin_spend import CoinSpend, make_spend
|
|
29
30
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
30
31
|
from chia.types.eligible_coin_spends import EligibleCoinSpends, UnspentLineageInfo, perform_the_fast_forward
|
|
@@ -33,7 +34,6 @@ from chia.types.mempool_inclusion_status import MempoolInclusionStatus
|
|
|
33
34
|
from chia.types.mempool_item import BundleCoinSpend
|
|
34
35
|
from chia.types.spend_bundle import SpendBundle
|
|
35
36
|
from chia.util.errors import Err
|
|
36
|
-
from chia.util.ints import uint64
|
|
37
37
|
from chia.wallet.puzzles import p2_conditions, p2_delegated_puzzle_or_hidden_puzzle
|
|
38
38
|
from chia.wallet.puzzles import singleton_top_layer_v1_1 as singleton_top_layer
|
|
39
39
|
|
|
@@ -123,9 +123,9 @@ async def test_process_fast_forward_spends_latest_unspent() -> None:
|
|
|
123
123
|
assert False # pragma: no cover
|
|
124
124
|
|
|
125
125
|
# At this point, spends are considered *potentially* eligible for singleton
|
|
126
|
-
# fast forward mainly when their amount is
|
|
126
|
+
# fast forward mainly when their amount is odd and they don't have conditions
|
|
127
127
|
# that disqualify them
|
|
128
|
-
conditions = [[ConditionOpcode.CREATE_COIN, IDENTITY_PUZZLE_HASH, test_amount
|
|
128
|
+
conditions = [[ConditionOpcode.CREATE_COIN, IDENTITY_PUZZLE_HASH, test_amount]]
|
|
129
129
|
sb = spend_bundle_from_conditions(conditions, test_coin)
|
|
130
130
|
item = mempool_item_from_spendbundle(sb)
|
|
131
131
|
assert item.bundle_coin_spends[test_coin.name()].eligible_for_fast_forward is True
|
|
@@ -416,7 +416,7 @@ async def test_singleton_fast_forward_solo() -> None:
|
|
|
416
416
|
parent_parent_id=eve_coin_spend.coin.parent_coin_info,
|
|
417
417
|
)
|
|
418
418
|
|
|
419
|
-
inner_conditions = [[ConditionOpcode.CREATE_COIN, inner_puzzle_hash,
|
|
419
|
+
inner_conditions = [[ConditionOpcode.CREATE_COIN, inner_puzzle_hash, SINGLETON_AMOUNT]]
|
|
420
420
|
# this is a FF spend that isn't combined with any other spend. It's not allowed
|
|
421
421
|
singleton_coin_spend, _ = make_singleton_coin_spend(eve_coin_spend, singleton, inner_puzzle, inner_conditions)
|
|
422
422
|
status, error = await sim_client.push_tx(SpendBundle([singleton_coin_spend], G2Element()))
|
|
@@ -437,8 +437,6 @@ async def test_singleton_fast_forward_different_block(is_eligible_for_ff: bool)
|
|
|
437
437
|
START_AMOUNT = uint64(1337)
|
|
438
438
|
# We're decrementing the next iteration's amount for testing purposes
|
|
439
439
|
SINGLETON_AMOUNT = uint64(1335)
|
|
440
|
-
# We're incrementing the next iteration's amount for testing purposes
|
|
441
|
-
SINGLETON_CHILD_AMOUNT = uint64(1339)
|
|
442
440
|
async with sim_and_client() as (sim, sim_client):
|
|
443
441
|
singleton, eve_coin_spend, inner_puzzle, remaining_coin = await prepare_and_test_singleton(
|
|
444
442
|
sim, sim_client, is_eligible_for_ff, START_AMOUNT, SINGLETON_AMOUNT
|
|
@@ -452,15 +450,14 @@ async def test_singleton_fast_forward_different_block(is_eligible_for_ff: bool)
|
|
|
452
450
|
sig = AugSchemeMPL.sign(sk, b"foobar", g1)
|
|
453
451
|
inner_conditions: list[list[Any]] = [
|
|
454
452
|
[ConditionOpcode.AGG_SIG_UNSAFE, bytes(g1), b"foobar"],
|
|
455
|
-
[ConditionOpcode.CREATE_COIN, inner_puzzle_hash,
|
|
453
|
+
[ConditionOpcode.CREATE_COIN, inner_puzzle_hash, SINGLETON_AMOUNT],
|
|
456
454
|
]
|
|
457
455
|
singleton_coin_spend, singleton_signing_puzzle = make_singleton_coin_spend(
|
|
458
456
|
eve_coin_spend, singleton, inner_puzzle, inner_conditions
|
|
459
457
|
)
|
|
460
|
-
# Spend also a remaining coin
|
|
461
|
-
diff_to_balance = SINGLETON_CHILD_AMOUNT - SINGLETON_AMOUNT
|
|
458
|
+
# Spend also a remaining coin
|
|
462
459
|
remaining_spend_solution = SerializedProgram.from_program(
|
|
463
|
-
Program.to([[ConditionOpcode.CREATE_COIN, IDENTITY_PUZZLE_HASH, remaining_coin.amount
|
|
460
|
+
Program.to([[ConditionOpcode.CREATE_COIN, IDENTITY_PUZZLE_HASH, remaining_coin.amount]])
|
|
464
461
|
)
|
|
465
462
|
remaining_coin_spend = CoinSpend(remaining_coin, IDENTITY_PUZZLE, remaining_spend_solution)
|
|
466
463
|
await make_and_send_spend_bundle(
|
|
@@ -476,7 +473,7 @@ async def test_singleton_fast_forward_different_block(is_eligible_for_ff: bool)
|
|
|
476
473
|
singleton_puzzle_hash
|
|
477
474
|
)
|
|
478
475
|
singleton_child, [remaining_coin] = await get_singleton_and_remaining_coins(sim)
|
|
479
|
-
assert singleton_child.amount ==
|
|
476
|
+
assert singleton_child.amount == SINGLETON_AMOUNT
|
|
480
477
|
assert unspent_lineage_info == UnspentLineageInfo(
|
|
481
478
|
coin_id=singleton_child.name(),
|
|
482
479
|
coin_amount=singleton_child.amount,
|
|
@@ -486,7 +483,7 @@ async def test_singleton_fast_forward_different_block(is_eligible_for_ff: bool)
|
|
|
486
483
|
)
|
|
487
484
|
# Now let's spend the first version again (despite being already spent by now)
|
|
488
485
|
remaining_spend_solution = SerializedProgram.from_program(
|
|
489
|
-
Program.to([[ConditionOpcode.CREATE_COIN, IDENTITY_PUZZLE_HASH, remaining_coin.amount
|
|
486
|
+
Program.to([[ConditionOpcode.CREATE_COIN, IDENTITY_PUZZLE_HASH, remaining_coin.amount]])
|
|
490
487
|
)
|
|
491
488
|
remaining_coin_spend = CoinSpend(remaining_coin, IDENTITY_PUZZLE, remaining_spend_solution)
|
|
492
489
|
status, error = await make_and_send_spend_bundle(
|
|
@@ -532,8 +529,6 @@ async def test_singleton_fast_forward_same_block() -> None:
|
|
|
532
529
|
START_AMOUNT = uint64(1337)
|
|
533
530
|
# We're decrementing the next iteration's amount for testing purposes
|
|
534
531
|
SINGLETON_AMOUNT = uint64(1335)
|
|
535
|
-
# We're incrementing the next iteration's amount for testing purposes
|
|
536
|
-
SINGLETON_CHILD_AMOUNT = uint64(1339)
|
|
537
532
|
async with sim_and_client() as (sim, sim_client):
|
|
538
533
|
singleton, eve_coin_spend, inner_puzzle, remaining_coin = await prepare_and_test_singleton(
|
|
539
534
|
sim, sim_client, True, START_AMOUNT, SINGLETON_AMOUNT
|
|
@@ -546,13 +541,14 @@ async def test_singleton_fast_forward_same_block() -> None:
|
|
|
546
541
|
sig = AugSchemeMPL.sign(sk, b"foobar", g1)
|
|
547
542
|
inner_conditions: list[list[Any]] = [
|
|
548
543
|
[ConditionOpcode.AGG_SIG_UNSAFE, bytes(g1), b"foobar"],
|
|
549
|
-
[ConditionOpcode.CREATE_COIN, inner_puzzle_hash,
|
|
544
|
+
[ConditionOpcode.CREATE_COIN, inner_puzzle_hash, SINGLETON_AMOUNT],
|
|
550
545
|
]
|
|
551
546
|
singleton_coin_spend, _ = make_singleton_coin_spend(eve_coin_spend, singleton, inner_puzzle, inner_conditions)
|
|
552
|
-
# Spend also a remaining coin
|
|
553
|
-
|
|
547
|
+
# Spend also a remaining coin. Change amount to create a new coin ID.
|
|
548
|
+
# The test assumes any odd amount is a singleton, so we must keep it
|
|
549
|
+
# even
|
|
554
550
|
remaining_spend_solution = SerializedProgram.from_program(
|
|
555
|
-
Program.to([[ConditionOpcode.CREATE_COIN, IDENTITY_PUZZLE_HASH, remaining_coin.amount -
|
|
551
|
+
Program.to([[ConditionOpcode.CREATE_COIN, IDENTITY_PUZZLE_HASH, remaining_coin.amount - 2]])
|
|
556
552
|
)
|
|
557
553
|
remaining_coin_spend = CoinSpend(remaining_coin, IDENTITY_PUZZLE, remaining_spend_solution)
|
|
558
554
|
await make_and_send_spend_bundle(sim, sim_client, [remaining_coin_spend, singleton_coin_spend], aggsig=sig)
|
|
@@ -560,7 +556,7 @@ async def test_singleton_fast_forward_same_block() -> None:
|
|
|
560
556
|
singleton_puzzle_hash
|
|
561
557
|
)
|
|
562
558
|
singleton_child, [remaining_coin] = await get_singleton_and_remaining_coins(sim)
|
|
563
|
-
assert singleton_child.amount ==
|
|
559
|
+
assert singleton_child.amount == SINGLETON_AMOUNT
|
|
564
560
|
assert unspent_lineage_info == UnspentLineageInfo(
|
|
565
561
|
coin_id=singleton_child.name(),
|
|
566
562
|
coin_amount=singleton_child.amount,
|
|
@@ -570,7 +566,6 @@ async def test_singleton_fast_forward_same_block() -> None:
|
|
|
570
566
|
)
|
|
571
567
|
# Now let's send 3 arbitrary spends of the already spent singleton in
|
|
572
568
|
# one block. They should all properly fast forward
|
|
573
|
-
random_amounts = [21, 17, 11]
|
|
574
569
|
|
|
575
570
|
sk = AugSchemeMPL.key_gen(b"a" * 32)
|
|
576
571
|
g1 = sk.get_g1()
|
|
@@ -583,7 +578,7 @@ async def test_singleton_fast_forward_same_block() -> None:
|
|
|
583
578
|
aggsig = G2Element()
|
|
584
579
|
for _ in range(cost_factor):
|
|
585
580
|
aggsig += sig
|
|
586
|
-
inner_conditions.append([ConditionOpcode.CREATE_COIN, inner_puzzle_hash,
|
|
581
|
+
inner_conditions.append([ConditionOpcode.CREATE_COIN, inner_puzzle_hash, SINGLETON_AMOUNT])
|
|
587
582
|
singleton_coin_spend, _ = make_singleton_coin_spend(
|
|
588
583
|
eve_coin_spend, singleton, inner_puzzle, inner_conditions
|
|
589
584
|
)
|
|
@@ -602,13 +597,13 @@ async def test_singleton_fast_forward_same_block() -> None:
|
|
|
602
597
|
# The unspent coin ID should reflect the latest version
|
|
603
598
|
assert unspent_lineage_info.coin_id == latest_singleton.name()
|
|
604
599
|
# The latest version should have the last random amount
|
|
605
|
-
assert latest_singleton.amount ==
|
|
600
|
+
assert latest_singleton.amount == SINGLETON_AMOUNT
|
|
606
601
|
# The unspent coin amount should reflect the latest version
|
|
607
602
|
assert unspent_lineage_info.coin_amount == latest_singleton.amount
|
|
608
603
|
# The unspent parent ID should reflect the latest version's parent
|
|
609
604
|
assert unspent_lineage_info.parent_id == latest_singleton.parent_coin_info
|
|
610
605
|
# The one before it should have the second last random amount
|
|
611
|
-
assert unspent_lineage_info.parent_amount ==
|
|
606
|
+
assert unspent_lineage_info.parent_amount == SINGLETON_AMOUNT
|
|
612
607
|
|
|
613
608
|
|
|
614
609
|
@pytest.mark.anyio
|
|
@@ -676,7 +671,6 @@ async def test_mempool_items_immutability_on_ff() -> None:
|
|
|
676
671
|
# Let's trigger the fast forward by creating a mempool bundle
|
|
677
672
|
result = await sim.mempool_manager.create_bundle_from_mempool(
|
|
678
673
|
sim_client.service.block_records[-1].header_hash,
|
|
679
|
-
sim_client.service.coin_store.get_unspent_lineage_info_for_puzzle_hash,
|
|
680
674
|
)
|
|
681
675
|
assert result is not None
|
|
682
676
|
bundle, _ = result
|
chia/_tests/core/node_height.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
|
+
from chia_rs.sized_ints import uint16
|
|
4
5
|
|
|
5
6
|
from chia.protocols.shared_protocol import Capability
|
|
6
7
|
from chia.server.capabilities import known_active_capabilities
|
|
7
|
-
from chia.util.ints import uint16
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
@pytest.mark.parametrize(
|
|
@@ -7,13 +7,14 @@ from typing import Optional
|
|
|
7
7
|
|
|
8
8
|
import pytest
|
|
9
9
|
from aiohttp import ClientSession, ClientTimeout, WSCloseCode, WSMessage, WSMsgType, WSServerHandshakeError
|
|
10
|
+
from chia_rs.sized_bytes import bytes32
|
|
11
|
+
from chia_rs.sized_ints import uint8, uint16, uint64
|
|
10
12
|
|
|
11
13
|
import chia.server.server
|
|
12
14
|
from chia._tests.util.time_out_assert import time_out_assert
|
|
13
|
-
from chia.full_node.full_node_api import FullNodeAPI
|
|
14
15
|
from chia.protocols import full_node_protocol
|
|
15
16
|
from chia.protocols.protocol_message_types import ProtocolMessageTypes
|
|
16
|
-
from chia.protocols.shared_protocol import Handshake
|
|
17
|
+
from chia.protocols.shared_protocol import Capability, Handshake
|
|
17
18
|
from chia.server.outbound_message import Message, make_msg
|
|
18
19
|
from chia.server.rate_limits import RateLimiter
|
|
19
20
|
from chia.server.server import ChiaServer
|
|
@@ -22,7 +23,6 @@ from chia.simulator.block_tools import BlockTools
|
|
|
22
23
|
from chia.simulator.full_node_simulator import FullNodeSimulator
|
|
23
24
|
from chia.types.peer_info import PeerInfo
|
|
24
25
|
from chia.util.errors import Err
|
|
25
|
-
from chia.util.ints import uint64
|
|
26
26
|
from chia.util.timing import adjusted_timeout
|
|
27
27
|
from chia.wallet.wallet_node import WalletNode
|
|
28
28
|
|
|
@@ -33,18 +33,10 @@ def not_localhost(host: str) -> bool:
|
|
|
33
33
|
return False
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
async def get_block_path(full_node: FullNodeAPI):
|
|
37
|
-
blocks_list = [await full_node.full_node.blockchain.get_full_peak()]
|
|
38
|
-
assert blocks_list[0] is not None
|
|
39
|
-
while blocks_list[0].height != 0:
|
|
40
|
-
b = await full_node.full_node.block_store.get_full_block(blocks_list[0].prev_header_hash)
|
|
41
|
-
assert b is not None
|
|
42
|
-
blocks_list.insert(0, b)
|
|
43
|
-
return blocks_list
|
|
44
|
-
|
|
45
|
-
|
|
46
36
|
class FakeRateLimiter:
|
|
47
|
-
def process_msg_and_check(
|
|
37
|
+
def process_msg_and_check(
|
|
38
|
+
self, message: Message, our_capabilities: list[Capability], peer_capabilities: list[Capability]
|
|
39
|
+
) -> Optional[str]:
|
|
48
40
|
return None
|
|
49
41
|
|
|
50
42
|
|
|
@@ -142,7 +134,11 @@ class TestDos:
|
|
|
142
134
|
await ws.close()
|
|
143
135
|
|
|
144
136
|
@pytest.mark.anyio
|
|
145
|
-
async def test_invalid_protocol_handshake(
|
|
137
|
+
async def test_invalid_protocol_handshake(
|
|
138
|
+
self,
|
|
139
|
+
setup_two_nodes_fixture: tuple[list[FullNodeSimulator], list[tuple[WalletNode, ChiaServer]], BlockTools],
|
|
140
|
+
self_hostname: str,
|
|
141
|
+
) -> None:
|
|
146
142
|
nodes, _, _ = setup_two_nodes_fixture
|
|
147
143
|
server_1 = nodes[0].full_node.server
|
|
148
144
|
server_2 = nodes[1].full_node.server
|
|
@@ -159,8 +155,8 @@ class TestDos:
|
|
|
159
155
|
)
|
|
160
156
|
|
|
161
157
|
# Construct an otherwise valid handshake message
|
|
162
|
-
handshake: Handshake = Handshake("test", "0.0.32", "1.0.0.0", 3456, 1, [(1, "1")])
|
|
163
|
-
outbound_handshake: Message = Message(2, None, bytes(handshake)) # 2 is an invalid ProtocolType
|
|
158
|
+
handshake: Handshake = Handshake("test", "0.0.32", "1.0.0.0", uint16(3456), uint8(1), [(uint16(1), "1")])
|
|
159
|
+
outbound_handshake: Message = Message(uint8(2), None, bytes(handshake)) # 2 is an invalid ProtocolType
|
|
164
160
|
await ws.send_bytes(bytes(outbound_handshake))
|
|
165
161
|
|
|
166
162
|
response: WSMessage = await ws.receive()
|
|
@@ -173,7 +169,11 @@ class TestDos:
|
|
|
173
169
|
await asyncio.sleep(1) # give some time for cleanup to work
|
|
174
170
|
|
|
175
171
|
@pytest.mark.anyio
|
|
176
|
-
async def test_spam_tx(
|
|
172
|
+
async def test_spam_tx(
|
|
173
|
+
self,
|
|
174
|
+
setup_two_nodes_fixture: tuple[list[FullNodeSimulator], list[tuple[WalletNode, ChiaServer]], BlockTools],
|
|
175
|
+
self_hostname: str,
|
|
176
|
+
) -> None:
|
|
177
177
|
nodes, _, _ = setup_two_nodes_fixture
|
|
178
178
|
_full_node_1, full_node_2 = nodes
|
|
179
179
|
server_1 = nodes[0].full_node.server
|
|
@@ -191,7 +191,7 @@ class TestDos:
|
|
|
191
191
|
|
|
192
192
|
new_tx_message = make_msg(
|
|
193
193
|
ProtocolMessageTypes.new_transaction,
|
|
194
|
-
full_node_protocol.NewTransaction(
|
|
194
|
+
full_node_protocol.NewTransaction(bytes32([9] * 32), uint64(0), uint64(0)),
|
|
195
195
|
)
|
|
196
196
|
for i in range(4000):
|
|
197
197
|
await ws_con._send_message(new_tx_message)
|
|
@@ -215,20 +215,24 @@ class TestDos:
|
|
|
215
215
|
await asyncio.sleep(0)
|
|
216
216
|
await asyncio.sleep(1)
|
|
217
217
|
|
|
218
|
-
def is_closed():
|
|
218
|
+
def is_closed() -> bool:
|
|
219
219
|
return ws_con.closed
|
|
220
220
|
|
|
221
221
|
await time_out_assert(15, is_closed)
|
|
222
222
|
|
|
223
223
|
assert ws_con.closed
|
|
224
224
|
|
|
225
|
-
def is_banned():
|
|
225
|
+
def is_banned() -> bool:
|
|
226
226
|
return "1.2.3.4" in server_2.banned_peers
|
|
227
227
|
|
|
228
228
|
await time_out_assert(15, is_banned)
|
|
229
229
|
|
|
230
230
|
@pytest.mark.anyio
|
|
231
|
-
async def test_spam_message_non_tx(
|
|
231
|
+
async def test_spam_message_non_tx(
|
|
232
|
+
self,
|
|
233
|
+
setup_two_nodes_fixture: tuple[list[FullNodeSimulator], list[tuple[WalletNode, ChiaServer]], BlockTools],
|
|
234
|
+
self_hostname: str,
|
|
235
|
+
) -> None:
|
|
232
236
|
nodes, _, _ = setup_two_nodes_fixture
|
|
233
237
|
_full_node_1, full_node_2 = nodes
|
|
234
238
|
server_1 = nodes[0].full_node.server
|
|
@@ -244,7 +248,7 @@ class TestDos:
|
|
|
244
248
|
ws_con.peer_info = PeerInfo("1.2.3.4", ws_con.peer_info.port)
|
|
245
249
|
ws_con_2.peer_info = PeerInfo("1.2.3.4", ws_con_2.peer_info.port)
|
|
246
250
|
|
|
247
|
-
def is_closed():
|
|
251
|
+
def is_closed() -> bool:
|
|
248
252
|
return ws_con.closed
|
|
249
253
|
|
|
250
254
|
new_message = make_msg(
|
|
@@ -271,13 +275,17 @@ class TestDos:
|
|
|
271
275
|
await time_out_assert(15, is_closed)
|
|
272
276
|
|
|
273
277
|
# Banned
|
|
274
|
-
def is_banned():
|
|
278
|
+
def is_banned() -> bool:
|
|
275
279
|
return "1.2.3.4" in server_2.banned_peers
|
|
276
280
|
|
|
277
281
|
await time_out_assert(15, is_banned)
|
|
278
282
|
|
|
279
283
|
@pytest.mark.anyio
|
|
280
|
-
async def test_spam_message_too_large(
|
|
284
|
+
async def test_spam_message_too_large(
|
|
285
|
+
self,
|
|
286
|
+
setup_two_nodes_fixture: tuple[list[FullNodeSimulator], list[tuple[WalletNode, ChiaServer]], BlockTools],
|
|
287
|
+
self_hostname: str,
|
|
288
|
+
) -> None:
|
|
281
289
|
nodes, _, _ = setup_two_nodes_fixture
|
|
282
290
|
_full_node_1, full_node_2 = nodes
|
|
283
291
|
server_1 = nodes[0].full_node.server
|
|
@@ -293,7 +301,7 @@ class TestDos:
|
|
|
293
301
|
ws_con.peer_info = PeerInfo("1.2.3.4", ws_con.peer_info.port)
|
|
294
302
|
ws_con_2.peer_info = PeerInfo("1.2.3.4", ws_con_2.peer_info.port)
|
|
295
303
|
|
|
296
|
-
def is_closed():
|
|
304
|
+
def is_closed() -> bool:
|
|
297
305
|
return ws_con.closed
|
|
298
306
|
|
|
299
307
|
new_message = make_msg(
|
|
@@ -307,13 +315,13 @@ class TestDos:
|
|
|
307
315
|
assert not ws_con.closed
|
|
308
316
|
|
|
309
317
|
# Remove outbound rate limiter to test inbound limits
|
|
310
|
-
ws_con.outbound_rate_limiter = FakeRateLimiter()
|
|
318
|
+
ws_con.outbound_rate_limiter = FakeRateLimiter() # type: ignore[assignment]
|
|
311
319
|
|
|
312
320
|
await ws_con._send_message(new_message)
|
|
313
321
|
await time_out_assert(15, is_closed)
|
|
314
322
|
|
|
315
323
|
# Banned
|
|
316
|
-
def is_banned():
|
|
324
|
+
def is_banned() -> bool:
|
|
317
325
|
return "1.2.3.4" in server_2.banned_peers
|
|
318
326
|
|
|
319
327
|
await time_out_assert(15, is_banned)
|
|
@@ -245,9 +245,9 @@ async def test_loop(tmp_path: pathlib.Path) -> None:
|
|
|
245
245
|
assert "Traceback" not in serve_output
|
|
246
246
|
assert "paused accepting connections" in serve_output
|
|
247
247
|
assert post_connection_succeeded, post_connection_error
|
|
248
|
-
assert all(
|
|
249
|
-
"new connection
|
|
250
|
-
)
|
|
248
|
+
assert all("new connection" not in line.casefold() for line in shutdown_lines), (
|
|
249
|
+
"new connection found during shut down"
|
|
250
|
+
)
|
|
251
251
|
|
|
252
252
|
logger.info(" ==== all checks passed")
|
|
253
253
|
|
|
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import asyncio
|
|
4
4
|
|
|
5
5
|
import pytest
|
|
6
|
+
from chia_rs.sized_ints import uint32
|
|
6
7
|
|
|
7
8
|
from chia._tests.conftest import node_with_params
|
|
8
9
|
from chia._tests.util.time_out_assert import time_out_assert
|
|
@@ -17,7 +18,6 @@ from chia.server.server import ChiaServer
|
|
|
17
18
|
from chia.server.ws_connection import WSChiaConnection
|
|
18
19
|
from chia.simulator.block_tools import BlockTools
|
|
19
20
|
from chia.types.peer_info import PeerInfo
|
|
20
|
-
from chia.util.ints import uint32
|
|
21
21
|
|
|
22
22
|
rl_v2 = [Capability.BASE, Capability.BLOCK_HEADERS, Capability.RATE_LIMITS_V2]
|
|
23
23
|
rl_v1 = [Capability.BASE]
|
|
@@ -5,6 +5,8 @@ from dataclasses import dataclass
|
|
|
5
5
|
from typing import Callable, ClassVar, cast
|
|
6
6
|
|
|
7
7
|
import pytest
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import int16, uint32
|
|
8
10
|
from packaging.version import Version
|
|
9
11
|
|
|
10
12
|
from chia import __version__
|
|
@@ -23,10 +25,8 @@ from chia.server.start_full_node import create_full_node_service
|
|
|
23
25
|
from chia.server.start_wallet import create_wallet_service
|
|
24
26
|
from chia.server.ws_connection import WSChiaConnection, error_response_version
|
|
25
27
|
from chia.simulator.block_tools import BlockTools
|
|
26
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
27
28
|
from chia.types.peer_info import PeerInfo
|
|
28
29
|
from chia.util.errors import ApiError, Err
|
|
29
|
-
from chia.util.ints import int16, uint32
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
@dataclass
|
|
@@ -11,6 +11,7 @@ from typing import Any, Optional, cast
|
|
|
11
11
|
|
|
12
12
|
import aiohttp.client_exceptions
|
|
13
13
|
import pytest
|
|
14
|
+
from chia_rs.sized_ints import uint16
|
|
14
15
|
from typing_extensions import Protocol
|
|
15
16
|
|
|
16
17
|
from chia._tests.core.data_layer.util import ChiaRoot
|
|
@@ -24,7 +25,6 @@ from chia.rpc.rpc_client import RpcClient
|
|
|
24
25
|
from chia.rpc.wallet_rpc_client import WalletRpcClient
|
|
25
26
|
from chia.simulator.socket import find_available_listen_port
|
|
26
27
|
from chia.util.config import lock_and_load_config, save_config
|
|
27
|
-
from chia.util.ints import uint16
|
|
28
28
|
from chia.util.timing import adjusted_timeout
|
|
29
29
|
|
|
30
30
|
if sys.platform == "win32" or sys.platform == "cygwin":
|
chia/_tests/core/ssl/test_ssl.py
CHANGED
|
@@ -7,6 +7,7 @@ import ssl
|
|
|
7
7
|
|
|
8
8
|
import aiohttp
|
|
9
9
|
import pytest
|
|
10
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
11
|
|
|
11
12
|
from chia.apis import ApiProtocolRegistry
|
|
12
13
|
from chia.protocols.shared_protocol import default_capabilities
|
|
@@ -15,7 +16,6 @@ from chia.server.server import ChiaServer, ssl_context_for_client
|
|
|
15
16
|
from chia.server.ssl_context import chia_ssl_ca_paths, private_ssl_ca_paths
|
|
16
17
|
from chia.server.ws_connection import WSChiaConnection
|
|
17
18
|
from chia.ssl.create_ssl import generate_ca_signed_cert
|
|
18
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
19
19
|
from chia.types.peer_info import PeerInfo
|
|
20
20
|
|
|
21
21
|
|
chia/_tests/core/test_coins.py
CHANGED
|
@@ -2,9 +2,10 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from itertools import permutations
|
|
4
4
|
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
|
|
5
7
|
from chia._tests.util.benchmarks import rand_hash
|
|
6
8
|
from chia.types.blockchain_format.coin import hash_coin_ids
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
9
|
from chia.util.hash import std_hash
|
|
9
10
|
|
|
10
11
|
|
|
@@ -5,6 +5,8 @@ import pathlib
|
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
7
|
from chia_rs import G1Element
|
|
8
|
+
from chia_rs.sized_bytes import bytes32
|
|
9
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
8
10
|
from clvm_tools import binutils
|
|
9
11
|
|
|
10
12
|
from chia._tests.core.make_block_generator import make_block_generator
|
|
@@ -19,9 +21,7 @@ from chia.simulator.block_tools import BlockTools, test_constants
|
|
|
19
21
|
from chia.types.blockchain_format.coin import Coin
|
|
20
22
|
from chia.types.blockchain_format.program import Program
|
|
21
23
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
22
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
23
24
|
from chia.types.generator_types import BlockGenerator
|
|
24
|
-
from chia.util.ints import uint32, uint64
|
|
25
25
|
from chia.wallet.puzzles import p2_delegated_puzzle_or_hidden_puzzle
|
|
26
26
|
|
|
27
27
|
BURN_PUZZLE_HASH = bytes32(b"0" * 32)
|
chia/_tests/core/test_crawler.py
CHANGED
|
@@ -6,6 +6,8 @@ from datetime import datetime, timedelta
|
|
|
6
6
|
from typing import cast
|
|
7
7
|
|
|
8
8
|
import pytest
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint32, uint64, uint128
|
|
9
11
|
|
|
10
12
|
from chia._tests.util.setup_nodes import SimulatorsAndWalletsServices
|
|
11
13
|
from chia._tests.util.time_out_assert import time_out_assert
|
|
@@ -16,9 +18,7 @@ from chia.protocols.wallet_protocol import RequestChildren
|
|
|
16
18
|
from chia.seeder.peer_record import PeerRecord, PeerReliability
|
|
17
19
|
from chia.server.outbound_message import make_msg
|
|
18
20
|
from chia.types.aliases import CrawlerService
|
|
19
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
20
21
|
from chia.types.peer_info import PeerInfo
|
|
21
|
-
from chia.util.ints import uint32, uint64, uint128
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
@pytest.mark.anyio
|
|
@@ -4,6 +4,8 @@ import random
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
6
|
import pytest
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
7
9
|
|
|
8
10
|
from chia._tests.util.temp_file import TempFile
|
|
9
11
|
from chia.cmds.db_upgrade_func import convert_v1_to_v2
|
|
@@ -14,9 +16,7 @@ from chia.full_node.block_store import BlockStore
|
|
|
14
16
|
from chia.full_node.coin_store import CoinStore
|
|
15
17
|
from chia.full_node.hint_store import HintStore
|
|
16
18
|
from chia.simulator.block_tools import test_constants
|
|
17
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
18
19
|
from chia.util.db_wrapper import DBWrapper2
|
|
19
|
-
from chia.util.ints import uint32, uint64
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
def rand_bytes(num) -> bytes:
|
|
@@ -4,8 +4,11 @@ import random
|
|
|
4
4
|
import sqlite3
|
|
5
5
|
from contextlib import closing
|
|
6
6
|
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
7
8
|
|
|
8
9
|
import pytest
|
|
10
|
+
from chia_rs.sized_bytes import bytes32
|
|
11
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
9
12
|
|
|
10
13
|
from chia._tests.util.temp_file import TempFile
|
|
11
14
|
from chia.cmds.db_validate_func import validate_v2
|
|
@@ -16,10 +19,8 @@ from chia.consensus.multiprocess_validation import PreValidationResult
|
|
|
16
19
|
from chia.full_node.block_store import BlockStore
|
|
17
20
|
from chia.full_node.coin_store import CoinStore
|
|
18
21
|
from chia.simulator.block_tools import test_constants
|
|
19
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
20
22
|
from chia.types.full_block import FullBlock
|
|
21
23
|
from chia.util.db_wrapper import DBWrapper2
|
|
22
|
-
from chia.util.ints import uint32, uint64
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
def rand_hash() -> bytes32:
|
|
@@ -69,27 +70,32 @@ def add_block(
|
|
|
69
70
|
)
|
|
70
71
|
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
@pytest.fixture(name="default_config")
|
|
74
|
+
def default_config_fixture() -> dict[str, Any]:
|
|
75
|
+
return {"full_node": {"selected_network": "local", "network_overrides": {"constants": {"local": {}}}}}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def test_db_validate_wrong_version(default_config: dict[str, Any]) -> None:
|
|
73
79
|
with TempFile() as db_file:
|
|
74
80
|
with closing(sqlite3.connect(db_file)) as conn:
|
|
75
81
|
make_version(conn, 3)
|
|
76
82
|
|
|
77
83
|
with pytest.raises(RuntimeError) as execinfo:
|
|
78
|
-
validate_v2(db_file, validate_blocks=False)
|
|
84
|
+
validate_v2(db_file, config=default_config, validate_blocks=False)
|
|
79
85
|
assert "Database has the wrong version (3 expected 2)" in str(execinfo.value)
|
|
80
86
|
|
|
81
87
|
|
|
82
|
-
def test_db_validate_missing_peak_table() -> None:
|
|
88
|
+
def test_db_validate_missing_peak_table(default_config: dict[str, Any]) -> None:
|
|
83
89
|
with TempFile() as db_file:
|
|
84
90
|
with closing(sqlite3.connect(db_file)) as conn:
|
|
85
91
|
make_version(conn, 2)
|
|
86
92
|
|
|
87
93
|
with pytest.raises(RuntimeError) as execinfo:
|
|
88
|
-
validate_v2(db_file, validate_blocks=False)
|
|
94
|
+
validate_v2(db_file, config=default_config, validate_blocks=False)
|
|
89
95
|
assert "Database is missing current_peak table" in str(execinfo.value)
|
|
90
96
|
|
|
91
97
|
|
|
92
|
-
def test_db_validate_missing_peak_block() -> None:
|
|
98
|
+
def test_db_validate_missing_peak_block(default_config: dict[str, Any]) -> None:
|
|
93
99
|
with TempFile() as db_file:
|
|
94
100
|
with closing(sqlite3.connect(db_file)) as conn:
|
|
95
101
|
make_version(conn, 2)
|
|
@@ -98,12 +104,12 @@ def test_db_validate_missing_peak_block() -> None:
|
|
|
98
104
|
make_block_table(conn)
|
|
99
105
|
|
|
100
106
|
with pytest.raises(RuntimeError) as execinfo:
|
|
101
|
-
validate_v2(db_file, validate_blocks=False)
|
|
107
|
+
validate_v2(db_file, config=default_config, validate_blocks=False)
|
|
102
108
|
assert "Database is missing the peak block" in str(execinfo.value)
|
|
103
109
|
|
|
104
110
|
|
|
105
111
|
@pytest.mark.parametrize("invalid_in_chain", [True, False])
|
|
106
|
-
def test_db_validate_in_main_chain(invalid_in_chain: bool) -> None:
|
|
112
|
+
def test_db_validate_in_main_chain(invalid_in_chain: bool, default_config: dict[str, Any]) -> None:
|
|
107
113
|
with TempFile() as db_file:
|
|
108
114
|
with closing(sqlite3.connect(db_file)) as conn:
|
|
109
115
|
make_version(conn, 2)
|
|
@@ -122,10 +128,10 @@ def test_db_validate_in_main_chain(invalid_in_chain: bool) -> None:
|
|
|
122
128
|
|
|
123
129
|
if invalid_in_chain:
|
|
124
130
|
with pytest.raises(RuntimeError) as execinfo:
|
|
125
|
-
validate_v2(db_file, validate_blocks=False)
|
|
131
|
+
validate_v2(db_file, config=default_config, validate_blocks=False)
|
|
126
132
|
assert " (height: 96) is orphaned, but in_main_chain is set" in str(execinfo.value)
|
|
127
133
|
else:
|
|
128
|
-
validate_v2(db_file, validate_blocks=False)
|
|
134
|
+
validate_v2(db_file, config=default_config, validate_blocks=False)
|
|
129
135
|
|
|
130
136
|
|
|
131
137
|
async def make_db(db_file: Path, blocks: list[FullBlock]) -> None:
|
|
@@ -151,12 +157,19 @@ async def make_db(db_file: Path, blocks: list[FullBlock]) -> None:
|
|
|
151
157
|
|
|
152
158
|
|
|
153
159
|
@pytest.mark.anyio
|
|
154
|
-
async def test_db_validate_default_1000_blocks(
|
|
160
|
+
async def test_db_validate_default_1000_blocks(
|
|
161
|
+
default_1000_blocks: list[FullBlock], default_config: dict[str, Any]
|
|
162
|
+
) -> None:
|
|
155
163
|
with TempFile() as db_file:
|
|
156
164
|
await make_db(db_file, default_1000_blocks)
|
|
157
165
|
|
|
158
166
|
# we expect everything to be valid except this is a test chain, so it
|
|
159
167
|
# doesn't have the correct genesis challenge
|
|
160
168
|
with pytest.raises(RuntimeError) as execinfo:
|
|
161
|
-
validate_v2(db_file, validate_blocks=True)
|
|
169
|
+
validate_v2(db_file, config=default_config, validate_blocks=True)
|
|
162
170
|
assert "Blockchain has invalid genesis challenge" in str(execinfo.value)
|
|
171
|
+
|
|
172
|
+
default_config["full_node"]["network_overrides"]["constants"]["local"]["AGG_SIG_ME_ADDITIONAL_DATA"] = (
|
|
173
|
+
default_1000_blocks[0].foliage.prev_block_hash.hex()
|
|
174
|
+
)
|
|
175
|
+
validate_v2(db_file, config=default_config, validate_blocks=True)
|