chia-blockchain 2.5.2rc1__py3-none-any.whl → 2.5.3__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 +25 -15
- 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 +80 -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.2rc1.dist-info → chia_blockchain-2.5.3.dist-info}/METADATA +3 -2
- chia_blockchain-2.5.3.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.2rc1.dist-info/RECORD +0 -1042
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3.dist-info}/entry_points.txt +0 -0
chia/simulator/block_tools.py
CHANGED
|
@@ -17,14 +17,26 @@ from random import Random
|
|
|
17
17
|
from typing import Any, Callable, Optional
|
|
18
18
|
|
|
19
19
|
import anyio
|
|
20
|
-
from
|
|
20
|
+
from chia_puzzles_py.programs import CHIALISP_DESERIALISATION, ROM_BOOTSTRAP_GENERATOR
|
|
21
|
+
from chia_rs import (
|
|
22
|
+
MEMPOOL_MODE,
|
|
23
|
+
AugSchemeMPL,
|
|
24
|
+
ConsensusConstants,
|
|
25
|
+
G1Element,
|
|
26
|
+
G2Element,
|
|
27
|
+
PoolTarget,
|
|
28
|
+
PrivateKey,
|
|
29
|
+
solution_generator,
|
|
30
|
+
)
|
|
31
|
+
from chia_rs.sized_bytes import bytes32
|
|
32
|
+
from chia_rs.sized_ints import uint8, uint16, uint32, uint64, uint128
|
|
21
33
|
|
|
22
34
|
from chia.consensus.block_creation import create_unfinished_block, unfinished_block_to_full_block
|
|
23
35
|
from chia.consensus.block_record import BlockRecord
|
|
24
36
|
from chia.consensus.blockchain_interface import BlockRecordsProtocol
|
|
25
37
|
from chia.consensus.coinbase import create_puzzlehash_for_pk
|
|
26
38
|
from chia.consensus.condition_costs import ConditionCost
|
|
27
|
-
from chia.consensus.constants import
|
|
39
|
+
from chia.consensus.constants import replace_str_to_bytes
|
|
28
40
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
29
41
|
from chia.consensus.deficit import calculate_deficit
|
|
30
42
|
from chia.consensus.full_block_to_block_record import block_to_block_record
|
|
@@ -63,7 +75,6 @@ from chia.simulator.wallet_tools import WalletTool
|
|
|
63
75
|
from chia.ssl.create_ssl import create_all_ssl
|
|
64
76
|
from chia.types.blockchain_format.classgroup import ClassgroupElement
|
|
65
77
|
from chia.types.blockchain_format.coin import Coin
|
|
66
|
-
from chia.types.blockchain_format.pool_target import PoolTarget
|
|
67
78
|
from chia.types.blockchain_format.program import INFINITE_COST, Program
|
|
68
79
|
from chia.types.blockchain_format.proof_of_space import (
|
|
69
80
|
ProofOfSpace,
|
|
@@ -75,7 +86,6 @@ from chia.types.blockchain_format.proof_of_space import (
|
|
|
75
86
|
verify_and_get_quality_string,
|
|
76
87
|
)
|
|
77
88
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
78
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
79
89
|
from chia.types.blockchain_format.slots import (
|
|
80
90
|
ChallengeChainSubSlot,
|
|
81
91
|
InfusedChallengeChainSubSlot,
|
|
@@ -102,7 +112,6 @@ from chia.util.config import (
|
|
|
102
112
|
)
|
|
103
113
|
from chia.util.default_root import DEFAULT_ROOT_PATH
|
|
104
114
|
from chia.util.hash import std_hash
|
|
105
|
-
from chia.util.ints import uint8, uint16, uint32, uint64, uint128
|
|
106
115
|
from chia.util.keychain import Keychain, bytes_to_mnemonic
|
|
107
116
|
from chia.util.ssl_check import fix_ssl
|
|
108
117
|
from chia.util.timing import adjusted_timeout, backoff_times
|
|
@@ -113,15 +122,10 @@ from chia.wallet.derive_keys import (
|
|
|
113
122
|
master_sk_to_pool_sk,
|
|
114
123
|
master_sk_to_wallet_sk,
|
|
115
124
|
)
|
|
116
|
-
from chia.wallet.puzzles.load_clvm import load_serialized_clvm_maybe_recompile
|
|
117
125
|
|
|
118
|
-
|
|
119
|
-
"rom_bootstrap_generator.clsp", package_or_requirement="chia.consensus.puzzles"
|
|
120
|
-
)
|
|
126
|
+
DESERIALIZE_MOD = Program.from_bytes(CHIALISP_DESERIALISATION)
|
|
121
127
|
|
|
122
|
-
|
|
123
|
-
"chialisp_deserialisation.clsp", package_or_requirement="chia.consensus.puzzles"
|
|
124
|
-
)
|
|
128
|
+
GENERATOR_MOD: SerializedProgram = SerializedProgram.from_bytes(ROM_BOOTSTRAP_GENERATOR)
|
|
125
129
|
|
|
126
130
|
test_constants = DEFAULT_CONSTANTS.replace(
|
|
127
131
|
MIN_PLOT_SIZE=uint8(18),
|
|
@@ -7,6 +7,8 @@ from collections.abc import Collection
|
|
|
7
7
|
from typing import Any, Optional, Union
|
|
8
8
|
|
|
9
9
|
import anyio
|
|
10
|
+
from chia_rs.sized_bytes import bytes32
|
|
11
|
+
from chia_rs.sized_ints import uint8, uint32, uint64, uint128
|
|
10
12
|
|
|
11
13
|
from chia.consensus.block_body_validation import ForkInfo
|
|
12
14
|
from chia.consensus.block_record import BlockRecord
|
|
@@ -21,16 +23,14 @@ from chia.simulator.add_blocks_in_batches import add_blocks_in_batches
|
|
|
21
23
|
from chia.simulator.block_tools import BlockTools
|
|
22
24
|
from chia.simulator.simulator_protocol import FarmNewBlockProtocol, GetAllCoinsProtocol, ReorgProtocol
|
|
23
25
|
from chia.types.blockchain_format.coin import Coin
|
|
24
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
25
26
|
from chia.types.coin_record import CoinRecord
|
|
26
27
|
from chia.types.full_block import FullBlock
|
|
27
28
|
from chia.types.spend_bundle import SpendBundle
|
|
28
29
|
from chia.types.validation_state import ValidationState
|
|
29
30
|
from chia.util.augmented_chain import AugmentedBlockchain
|
|
30
31
|
from chia.util.config import lock_and_load_config, save_config
|
|
31
|
-
from chia.util.ints import uint8, uint32, uint64, uint128
|
|
32
32
|
from chia.util.timing import adjusted_timeout, backoff_times
|
|
33
|
-
from chia.wallet.
|
|
33
|
+
from chia.wallet.conditions import CreateCoin
|
|
34
34
|
from chia.wallet.transaction_record import LightTransactionRecord, TransactionRecord
|
|
35
35
|
from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG
|
|
36
36
|
from chia.wallet.wallet import Wallet
|
|
@@ -205,9 +205,7 @@ class FullNodeSimulator(FullNodeAPI):
|
|
|
205
205
|
await asyncio.sleep(1)
|
|
206
206
|
else:
|
|
207
207
|
current_time = False
|
|
208
|
-
mempool_bundle = await self.full_node.mempool_manager.create_bundle_from_mempool(
|
|
209
|
-
curr.header_hash, self.full_node.coin_store.get_unspent_lineage_info_for_puzzle_hash
|
|
210
|
-
)
|
|
208
|
+
mempool_bundle = await self.full_node.mempool_manager.create_bundle_from_mempool(curr.header_hash)
|
|
211
209
|
if mempool_bundle is None:
|
|
212
210
|
spend_bundle = None
|
|
213
211
|
else:
|
|
@@ -260,9 +258,7 @@ class FullNodeSimulator(FullNodeAPI):
|
|
|
260
258
|
await asyncio.sleep(1)
|
|
261
259
|
else:
|
|
262
260
|
current_time = False
|
|
263
|
-
mempool_bundle = await self.full_node.mempool_manager.create_bundle_from_mempool(
|
|
264
|
-
curr.header_hash, self.full_node.coin_store.get_unspent_lineage_info_for_puzzle_hash
|
|
265
|
-
)
|
|
261
|
+
mempool_bundle = await self.full_node.mempool_manager.create_bundle_from_mempool(curr.header_hash)
|
|
266
262
|
if mempool_bundle is None:
|
|
267
263
|
spend_bundle = None
|
|
268
264
|
else:
|
|
@@ -686,13 +682,13 @@ class FullNodeSimulator(FullNodeAPI):
|
|
|
686
682
|
if len(amounts) == 0:
|
|
687
683
|
return set()
|
|
688
684
|
|
|
689
|
-
outputs: list[
|
|
685
|
+
outputs: list[CreateCoin] = []
|
|
690
686
|
amounts_seen: set[uint64] = set()
|
|
691
687
|
for amount in amounts:
|
|
692
688
|
# We need unique puzzle hash amount combos so we'll only generate a new puzzle hash when we've already
|
|
693
689
|
# seen that amount sent to that puzzle hash
|
|
694
690
|
puzzle_hash = await wallet.get_puzzle_hash(new=amount in amounts_seen)
|
|
695
|
-
outputs.append(
|
|
691
|
+
outputs.append(CreateCoin(puzzle_hash, amount))
|
|
696
692
|
amounts_seen.add(amount)
|
|
697
693
|
|
|
698
694
|
transaction_records: list[TransactionRecord] = []
|
|
@@ -707,10 +703,9 @@ class FullNodeSimulator(FullNodeAPI):
|
|
|
707
703
|
DEFAULT_TX_CONFIG, push=True
|
|
708
704
|
) as action_scope:
|
|
709
705
|
await wallet.generate_signed_transaction(
|
|
710
|
-
|
|
711
|
-
|
|
706
|
+
amounts=[output.amount for output in outputs_group],
|
|
707
|
+
puzzle_hashes=[output.puzzle_hash for output in outputs_group],
|
|
712
708
|
action_scope=action_scope,
|
|
713
|
-
primaries=outputs_group[1:],
|
|
714
709
|
)
|
|
715
710
|
transaction_records.extend(action_scope.side_effects.transactions)
|
|
716
711
|
else:
|
chia/simulator/setup_services.py
CHANGED
|
@@ -11,8 +11,12 @@ from pathlib import Path
|
|
|
11
11
|
from types import FrameType
|
|
12
12
|
from typing import Any, Optional, Union
|
|
13
13
|
|
|
14
|
+
from chia_rs import ConsensusConstants
|
|
15
|
+
from chia_rs.sized_bytes import bytes32
|
|
16
|
+
from chia_rs.sized_ints import uint16
|
|
17
|
+
|
|
14
18
|
from chia.cmds.init_funcs import init
|
|
15
|
-
from chia.consensus.constants import
|
|
19
|
+
from chia.consensus.constants import replace_str_to_bytes
|
|
16
20
|
from chia.daemon.server import WebSocketServer, daemon_launch_lock_path
|
|
17
21
|
from chia.protocols.shared_protocol import Capability, default_capabilities
|
|
18
22
|
from chia.seeder.dns_server import DNSServer, create_dns_server_service
|
|
@@ -40,12 +44,10 @@ from chia.types.aliases import (
|
|
|
40
44
|
TimelordService,
|
|
41
45
|
WalletService,
|
|
42
46
|
)
|
|
43
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
44
47
|
from chia.types.peer_info import UnresolvedPeerInfo
|
|
45
48
|
from chia.util.bech32m import encode_puzzle_hash
|
|
46
49
|
from chia.util.config import config_path_for_filename, load_config, lock_and_load_config, save_config, set_peer_info
|
|
47
50
|
from chia.util.db_wrapper import generate_in_memory_db_uri
|
|
48
|
-
from chia.util.ints import uint16
|
|
49
51
|
from chia.util.keychain import bytes_to_mnemonic
|
|
50
52
|
from chia.util.lock import Lockfile
|
|
51
53
|
from chia.util.task_referencer import create_referenced_task
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from chia_rs.sized_bytes import bytes32
|
|
4
|
+
from chia_rs.sized_ints import uint32
|
|
5
|
+
|
|
3
6
|
from chia.rpc.full_node_rpc_api import FullNodeRpcApi
|
|
4
7
|
from chia.rpc.rpc_server import Endpoint, EndpointResult
|
|
5
8
|
from chia.simulator.full_node_simulator import FullNodeSimulator
|
|
6
9
|
from chia.simulator.simulator_protocol import FarmNewBlockProtocol, GetAllCoinsProtocol, ReorgProtocol
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
10
|
from chia.types.coin_record import CoinRecord
|
|
9
11
|
from chia.types.full_block import FullBlock
|
|
10
12
|
from chia.util.bech32m import decode_puzzle_hash
|
|
11
|
-
from chia.util.ints import uint32
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class SimulatorFullNodeRpcApi(FullNodeRpcApi):
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from chia_rs.sized_bytes import bytes32
|
|
4
|
+
from chia_rs.sized_ints import uint128
|
|
5
|
+
|
|
3
6
|
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
|
|
4
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
5
7
|
from chia.types.coin_record import CoinRecord
|
|
6
8
|
from chia.types.full_block import FullBlock
|
|
7
9
|
from chia.util.bech32m import encode_puzzle_hash
|
|
8
|
-
from chia.util.ints import uint128
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class SimulatorFullNodeRpcClient(FullNodeRpcClient):
|
|
@@ -3,8 +3,9 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from typing import Optional
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint32
|
|
8
|
+
|
|
8
9
|
from chia.util.streamable import Streamable, streamable
|
|
9
10
|
|
|
10
11
|
|
|
@@ -6,6 +6,8 @@ from pathlib import Path
|
|
|
6
6
|
from typing import Any, Optional
|
|
7
7
|
|
|
8
8
|
from chia_rs import PrivateKey
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint32
|
|
9
11
|
|
|
10
12
|
from chia.consensus.coinbase import create_puzzlehash_for_pk
|
|
11
13
|
from chia.daemon.server import WebSocketServer, daemon_launch_lock_path
|
|
@@ -21,11 +23,9 @@ from chia.simulator.ssl_certs import (
|
|
|
21
23
|
)
|
|
22
24
|
from chia.simulator.start_simulator import async_main as start_simulator_main
|
|
23
25
|
from chia.ssl.create_ssl import create_all_ssl
|
|
24
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
25
26
|
from chia.util.bech32m import encode_puzzle_hash
|
|
26
27
|
from chia.util.config import create_default_chia_config, load_config, save_config
|
|
27
28
|
from chia.util.errors import KeychainFingerprintExists
|
|
28
|
-
from chia.util.ints import uint32
|
|
29
29
|
from chia.util.keychain import Keychain
|
|
30
30
|
from chia.util.lock import Lockfile
|
|
31
31
|
from chia.wallet.derive_keys import master_sk_to_wallet_sk
|
|
@@ -7,6 +7,9 @@ from multiprocessing import freeze_support
|
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from typing import Any, Optional
|
|
9
9
|
|
|
10
|
+
from chia_rs.sized_bytes import bytes32
|
|
11
|
+
from chia_rs.sized_ints import uint16
|
|
12
|
+
|
|
10
13
|
from chia.apis import ApiProtocolRegistry
|
|
11
14
|
from chia.full_node.full_node import FullNode
|
|
12
15
|
from chia.server.outbound_message import NodeType
|
|
@@ -15,12 +18,10 @@ from chia.server.start_service import Service, async_run
|
|
|
15
18
|
from chia.simulator.block_tools import BlockTools, test_constants
|
|
16
19
|
from chia.simulator.full_node_simulator import FullNodeSimulator
|
|
17
20
|
from chia.simulator.simulator_full_node_rpc_api import SimulatorFullNodeRpcApi
|
|
18
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
19
21
|
from chia.util.bech32m import decode_puzzle_hash
|
|
20
22
|
from chia.util.chia_logging import initialize_logging
|
|
21
23
|
from chia.util.config import load_config, load_config_cli, override_config
|
|
22
24
|
from chia.util.default_root import resolve_root_path
|
|
23
|
-
from chia.util.ints import uint16
|
|
24
25
|
|
|
25
26
|
SimulatorFullNodeService = Service[FullNode, FullNodeSimulator, SimulatorFullNodeRpcApi]
|
|
26
27
|
|
chia/simulator/wallet_tools.py
CHANGED
|
@@ -2,21 +2,20 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import Any, Optional
|
|
4
4
|
|
|
5
|
-
from chia_rs import AugSchemeMPL, G1Element, G2Element, PrivateKey
|
|
5
|
+
from chia_rs import AugSchemeMPL, ConsensusConstants, G1Element, G2Element, PrivateKey
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
6
8
|
from clvm.casts import int_from_bytes, int_to_bytes
|
|
7
9
|
|
|
8
|
-
from chia.consensus.constants import ConsensusConstants
|
|
9
10
|
from chia.types.blockchain_format.coin import Coin
|
|
10
11
|
from chia.types.blockchain_format.program import Program
|
|
11
12
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
12
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
13
13
|
from chia.types.coin_spend import CoinSpend
|
|
14
14
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
15
15
|
from chia.types.condition_with_args import ConditionWithArgs
|
|
16
16
|
from chia.types.spend_bundle import SpendBundle
|
|
17
17
|
from chia.util.condition_tools import agg_sig_additional_data, conditions_dict_for_solution, make_aggsig_final_message
|
|
18
18
|
from chia.util.hash import std_hash
|
|
19
|
-
from chia.util.ints import uint32, uint64
|
|
20
19
|
from chia.wallet.conditions import AssertCoinAnnouncement
|
|
21
20
|
from chia.wallet.derive_keys import master_sk_to_wallet_sk
|
|
22
21
|
from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
|
|
@@ -2,12 +2,12 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import Optional, Union
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from chia_rs import ConsensusConstants, RewardChainBlock, RewardChainBlockUnfinished
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
8
|
+
|
|
6
9
|
from chia.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters
|
|
7
10
|
from chia.types.blockchain_format.proof_of_space import verify_and_get_quality_string
|
|
8
|
-
from chia.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished
|
|
9
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
10
|
-
from chia.util.ints import uint32, uint64
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def iters_from_block(
|
chia/timelord/timelord.py
CHANGED
|
@@ -15,9 +15,11 @@ from concurrent.futures import ThreadPoolExecutor
|
|
|
15
15
|
from pathlib import Path
|
|
16
16
|
from typing import IO, TYPE_CHECKING, Any, ClassVar, Optional, cast
|
|
17
17
|
|
|
18
|
+
from chia_rs import ConsensusConstants, RewardChainBlock
|
|
19
|
+
from chia_rs.sized_bytes import bytes32
|
|
20
|
+
from chia_rs.sized_ints import uint8, uint16, uint32, uint64, uint128
|
|
18
21
|
from chiavdf import create_discriminant, prove
|
|
19
22
|
|
|
20
|
-
from chia.consensus.constants import ConsensusConstants
|
|
21
23
|
from chia.consensus.pot_iterations import calculate_sp_iters, is_overflow_block
|
|
22
24
|
from chia.protocols import timelord_protocol
|
|
23
25
|
from chia.protocols.protocol_message_types import ProtocolMessageTypes
|
|
@@ -29,8 +31,6 @@ from chia.timelord.iters_from_block import iters_from_block
|
|
|
29
31
|
from chia.timelord.timelord_state import LastState
|
|
30
32
|
from chia.timelord.types import Chain, IterationType, StateType
|
|
31
33
|
from chia.types.blockchain_format.classgroup import ClassgroupElement
|
|
32
|
-
from chia.types.blockchain_format.reward_chain_block import RewardChainBlock
|
|
33
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
34
34
|
from chia.types.blockchain_format.slots import (
|
|
35
35
|
ChallengeChainSubSlot,
|
|
36
36
|
InfusedChallengeChainSubSlot,
|
|
@@ -40,7 +40,6 @@ from chia.types.blockchain_format.slots import (
|
|
|
40
40
|
from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary
|
|
41
41
|
from chia.types.blockchain_format.vdf import VDFInfo, VDFProof, validate_vdf
|
|
42
42
|
from chia.types.end_of_slot_bundle import EndOfSubSlotBundle
|
|
43
|
-
from chia.util.ints import uint8, uint16, uint32, uint64, uint128
|
|
44
43
|
from chia.util.streamable import Streamable, streamable
|
|
45
44
|
from chia.util.task_referencer import create_referenced_task
|
|
46
45
|
|
|
@@ -167,6 +166,7 @@ class Timelord:
|
|
|
167
166
|
self._executor_shutdown_tempfile = _create_shutdown_file()
|
|
168
167
|
self.bluebox_pool = ThreadPoolExecutor(
|
|
169
168
|
max_workers=workers,
|
|
169
|
+
thread_name_prefix="blue-box-",
|
|
170
170
|
)
|
|
171
171
|
self.main_loop = create_referenced_task(
|
|
172
172
|
self._start_manage_discriminant_queue_sanitizer_slow(self.bluebox_pool, workers)
|
|
@@ -937,18 +937,13 @@ class Timelord:
|
|
|
937
937
|
disc: int = create_discriminant(challenge, self.constants.DISCRIMINANT_SIZE_BITS)
|
|
938
938
|
|
|
939
939
|
try:
|
|
940
|
-
# Depending on the
|
|
941
|
-
# the timelord tells the vdf_client what to execute.
|
|
940
|
+
# Depending on the flag 'bluebox_mode', the timelord tells the vdf_client what to execute.
|
|
942
941
|
async with self.lock:
|
|
943
942
|
if self.bluebox_mode:
|
|
944
943
|
writer.write(b"S")
|
|
945
944
|
else:
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
writer.write(b"N")
|
|
949
|
-
else:
|
|
950
|
-
# Run two-wesolowski (slow) algorithm.
|
|
951
|
-
writer.write(b"T")
|
|
945
|
+
# Run two-wesolowski algorithm.
|
|
946
|
+
writer.write(b"T")
|
|
952
947
|
await writer.drain()
|
|
953
948
|
|
|
954
949
|
prefix = str(len(str(disc)))
|
chia/timelord/timelord_api.py
CHANGED
|
@@ -4,6 +4,8 @@ import logging
|
|
|
4
4
|
import time
|
|
5
5
|
from typing import TYPE_CHECKING, ClassVar, Optional, cast
|
|
6
6
|
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
8
|
+
|
|
7
9
|
from chia.protocols import timelord_protocol
|
|
8
10
|
from chia.protocols.timelord_protocol import NewPeakTimelord
|
|
9
11
|
from chia.rpc.rpc_server import StateChangedProtocol
|
|
@@ -11,7 +13,6 @@ from chia.server.api_protocol import ApiMetadata
|
|
|
11
13
|
from chia.timelord.iters_from_block import iters_from_block
|
|
12
14
|
from chia.timelord.timelord import Timelord
|
|
13
15
|
from chia.timelord.types import Chain, IterationType
|
|
14
|
-
from chia.util.ints import uint64
|
|
15
16
|
|
|
16
17
|
log = logging.getLogger(__name__)
|
|
17
18
|
|
|
@@ -76,8 +77,7 @@ class TimelordAPI:
|
|
|
76
77
|
else:
|
|
77
78
|
log.info("Skipping peak, block has equal or lower weight then our peak.")
|
|
78
79
|
log.debug(
|
|
79
|
-
f"new peak height {new_peak.reward_chain_block.height} "
|
|
80
|
-
f"weight {new_peak.reward_chain_block.weight}"
|
|
80
|
+
f"new peak height {new_peak.reward_chain_block.height} weight {new_peak.reward_chain_block.weight}"
|
|
81
81
|
)
|
|
82
82
|
|
|
83
83
|
self.timelord.state_changed("skipping_peak", {"height": new_peak.reward_chain_block.height})
|
chia/timelord/timelord_state.py
CHANGED
|
@@ -3,16 +3,17 @@ from __future__ import annotations
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import Optional, Union
|
|
5
5
|
|
|
6
|
-
from
|
|
6
|
+
from chia_rs import ConsensusConstants
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint8, uint32, uint64, uint128
|
|
9
|
+
|
|
7
10
|
from chia.protocols import timelord_protocol
|
|
8
11
|
from chia.timelord.iters_from_block import iters_from_block
|
|
9
12
|
from chia.timelord.types import Chain, StateType
|
|
10
13
|
from chia.types.blockchain_format.classgroup import ClassgroupElement
|
|
11
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
12
14
|
from chia.types.blockchain_format.slots import ChallengeBlockInfo
|
|
13
15
|
from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary
|
|
14
16
|
from chia.types.end_of_slot_bundle import EndOfSubSlotBundle
|
|
15
|
-
from chia.util.ints import uint8, uint32, uint64, uint128
|
|
16
17
|
|
|
17
18
|
log = logging.getLogger(__name__)
|
|
18
19
|
|
chia/types/block_protocol.py
CHANGED
|
@@ -2,11 +2,11 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import Optional
|
|
4
4
|
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
from chia_rs.sized_ints import uint32
|
|
5
7
|
from typing_extensions import Protocol
|
|
6
8
|
|
|
7
9
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
8
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
9
|
-
from chia.util.ints import uint32
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class BlockInfo(Protocol):
|
|
@@ -3,10 +3,10 @@ from __future__ import annotations
|
|
|
3
3
|
from typing import Union
|
|
4
4
|
|
|
5
5
|
from chia_rs import Coin
|
|
6
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
6
8
|
|
|
7
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
8
9
|
from chia.util.hash import std_hash
|
|
9
|
-
from chia.util.ints import uint64
|
|
10
10
|
|
|
11
11
|
__all__ = ["Coin", "coin_as_list", "hash_coin_ids"]
|
|
12
12
|
|
|
@@ -4,13 +4,13 @@ import io
|
|
|
4
4
|
from typing import TYPE_CHECKING, Any, Callable, Optional, TypeVar
|
|
5
5
|
|
|
6
6
|
from chia_rs import MEMPOOL_MODE, run_chia_program, tree_hash
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
8
|
from clvm.casts import int_from_bytes
|
|
8
9
|
from clvm.CLVMObject import CLVMStorage
|
|
9
10
|
from clvm.EvalError import EvalError
|
|
10
11
|
from clvm.serialize import sexp_from_stream, sexp_to_stream
|
|
11
12
|
from clvm.SExp import SExp
|
|
12
13
|
|
|
13
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
14
14
|
from chia.types.blockchain_format.tree_hash import sha256_treehash
|
|
15
15
|
from chia.util.byte_types import hexstr_to_bytes
|
|
16
16
|
from chia.util.hash import std_hash
|
|
@@ -5,13 +5,12 @@ from typing import Optional, cast
|
|
|
5
5
|
|
|
6
6
|
import chia_rs
|
|
7
7
|
from bitstring import BitArray
|
|
8
|
-
from chia_rs import AugSchemeMPL, G1Element, PrivateKey
|
|
8
|
+
from chia_rs import AugSchemeMPL, ConsensusConstants, G1Element, PrivateKey
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint32
|
|
9
11
|
from chiapos import Verifier
|
|
10
12
|
|
|
11
|
-
from chia.consensus.constants import ConsensusConstants
|
|
12
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
13
13
|
from chia.util.hash import std_hash
|
|
14
|
-
from chia.util.ints import uint32
|
|
15
14
|
|
|
16
15
|
ProofOfSpace = chia_rs.ProofOfSpace
|
|
17
16
|
|
|
@@ -10,10 +10,10 @@ from __future__ import annotations
|
|
|
10
10
|
|
|
11
11
|
from typing import Callable, Optional, Union
|
|
12
12
|
|
|
13
|
+
from chia_rs.sized_bytes import bytes32
|
|
13
14
|
from clvm.CLVMObject import CLVMStorage
|
|
14
15
|
from clvm.SExp import SExp
|
|
15
16
|
|
|
16
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
17
17
|
from chia.util.hash import std_hash
|
|
18
18
|
|
|
19
19
|
ValueType = Union[bytes, CLVMStorage]
|
|
@@ -6,13 +6,12 @@ from enum import IntEnum
|
|
|
6
6
|
from functools import lru_cache
|
|
7
7
|
from typing import Optional
|
|
8
8
|
|
|
9
|
-
from chia_rs import VDFInfo, VDFProof
|
|
9
|
+
from chia_rs import ConsensusConstants, VDFInfo, VDFProof
|
|
10
|
+
from chia_rs.sized_bytes import bytes32, bytes100
|
|
11
|
+
from chia_rs.sized_ints import uint8, uint64
|
|
10
12
|
from chiavdf import create_discriminant, verify_n_wesolowski
|
|
11
13
|
|
|
12
|
-
from chia.consensus.constants import ConsensusConstants
|
|
13
14
|
from chia.types.blockchain_format.classgroup import ClassgroupElement
|
|
14
|
-
from chia.types.blockchain_format.sized_bytes import bytes32, bytes100
|
|
15
|
-
from chia.util.ints import uint8, uint64
|
|
16
15
|
|
|
17
16
|
log = logging.getLogger(__name__)
|
|
18
17
|
|
chia/types/clvm_cost.py
CHANGED
chia/types/coin_record.py
CHANGED
|
@@ -3,10 +3,11 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from typing import Optional
|
|
5
5
|
|
|
6
|
-
from
|
|
6
|
+
from chia_rs import CoinState
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
8
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
9
|
+
|
|
7
10
|
from chia.types.blockchain_format.coin import Coin
|
|
8
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
9
|
-
from chia.util.ints import uint32, uint64
|
|
10
11
|
from chia.util.streamable import Streamable, streamable
|
|
11
12
|
|
|
12
13
|
|
chia/types/coin_spend.py
CHANGED
|
@@ -4,6 +4,7 @@ from dataclasses import dataclass
|
|
|
4
4
|
from typing import Any, Union
|
|
5
5
|
|
|
6
6
|
import chia_rs
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
7
8
|
|
|
8
9
|
from chia.consensus.condition_costs import ConditionCost
|
|
9
10
|
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
|
@@ -13,7 +14,6 @@ from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
|
13
14
|
from chia.types.condition_opcodes import ConditionOpcode
|
|
14
15
|
from chia.types.condition_with_args import ConditionWithArgs
|
|
15
16
|
from chia.util.errors import Err, ValidationError
|
|
16
|
-
from chia.util.ints import uint64
|
|
17
17
|
from chia.util.streamable import Streamable, streamable
|
|
18
18
|
|
|
19
19
|
CoinSpend = chia_rs.CoinSpend
|
|
@@ -5,19 +5,18 @@ import dataclasses
|
|
|
5
5
|
from collections.abc import Awaitable
|
|
6
6
|
from typing import Callable, Optional
|
|
7
7
|
|
|
8
|
-
from chia_rs import fast_forward_singleton, get_conditions_from_spendbundle
|
|
8
|
+
from chia_rs import ConsensusConstants, fast_forward_singleton, get_conditions_from_spendbundle
|
|
9
|
+
from chia_rs.sized_bytes import bytes32
|
|
10
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
9
11
|
|
|
10
12
|
from chia.consensus.condition_costs import ConditionCost
|
|
11
|
-
from chia.consensus.constants import ConsensusConstants
|
|
12
13
|
from chia.types.blockchain_format.coin import Coin
|
|
13
14
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
14
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
15
15
|
from chia.types.coin_spend import CoinSpend
|
|
16
16
|
from chia.types.internal_mempool_item import InternalMempoolItem
|
|
17
17
|
from chia.types.mempool_item import BundleCoinSpend
|
|
18
18
|
from chia.types.spend_bundle import SpendBundle
|
|
19
19
|
from chia.util.errors import Err
|
|
20
|
-
from chia.util.ints import uint32, uint64
|
|
21
20
|
|
|
22
21
|
|
|
23
22
|
@dataclasses.dataclass(frozen=True)
|
|
@@ -144,6 +143,11 @@ def perform_the_fast_forward(
|
|
|
144
143
|
return new_coin_spend, patched_additions
|
|
145
144
|
|
|
146
145
|
|
|
146
|
+
@dataclasses.dataclass
|
|
147
|
+
class SkipDedup(BaseException):
|
|
148
|
+
msg: str
|
|
149
|
+
|
|
150
|
+
|
|
147
151
|
@dataclasses.dataclass(frozen=True)
|
|
148
152
|
class EligibleCoinSpends:
|
|
149
153
|
deduplication_spends: dict[bytes32, DedupCoinSpend] = dataclasses.field(default_factory=dict)
|
|
@@ -201,7 +205,7 @@ class EligibleCoinSpends:
|
|
|
201
205
|
# even if they end up saving more cost, as we're going for the first
|
|
202
206
|
# solution we see from the relatively highest FPC item, to avoid
|
|
203
207
|
# severe performance and/or time-complexity impact
|
|
204
|
-
raise
|
|
208
|
+
raise SkipDedup("Solution is different from what we're deduplicating on")
|
|
205
209
|
# Let's calculate the saved cost if we never did that before
|
|
206
210
|
if duplicate_cost is None:
|
|
207
211
|
# See first if this mempool item had this cost computed before
|
chia/types/fee_rate.py
CHANGED
|
@@ -4,10 +4,10 @@ import math
|
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
|
|
6
6
|
import typing_extensions
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
7
8
|
|
|
8
9
|
from chia.types.clvm_cost import CLVMCost
|
|
9
10
|
from chia.types.mojos import Mojos
|
|
10
|
-
from chia.util.ints import uint64
|
|
11
11
|
from chia.util.streamable import Streamable, streamable
|
|
12
12
|
|
|
13
13
|
|
chia/types/generator_types.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from dataclasses import dataclass
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
4
|
|
|
5
5
|
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
|
6
6
|
from chia.util.streamable import Streamable, streamable
|
|
@@ -9,5 +9,5 @@ from chia.util.streamable import Streamable, streamable
|
|
|
9
9
|
@streamable
|
|
10
10
|
@dataclass(frozen=True)
|
|
11
11
|
class BlockGenerator(Streamable):
|
|
12
|
-
program: SerializedProgram
|
|
13
|
-
generator_refs: list[bytes]
|
|
12
|
+
program: SerializedProgram = field(default_factory=SerializedProgram.default)
|
|
13
|
+
generator_refs: list[bytes] = field(default_factory=list)
|
|
@@ -2,11 +2,12 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
from chia_rs.sized_ints import uint32
|
|
7
|
+
|
|
6
8
|
from chia.types.mempool_item import BundleCoinSpend
|
|
7
9
|
from chia.types.spend_bundle import SpendBundle
|
|
8
10
|
from chia.types.spend_bundle_conditions import SpendBundleConditions
|
|
9
|
-
from chia.util.ints import uint32
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
@dataclass(frozen=True)
|