chia-blockchain 2.5.2rc1__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 +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 +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.2rc1.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.2rc1.dist-info/RECORD +0 -1042
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3rc1.dist-info}/LICENSE +0 -0
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3rc1.dist-info}/WHEEL +0 -0
- {chia_blockchain-2.5.2rc1.dist-info → chia_blockchain-2.5.3rc1.dist-info}/entry_points.txt +0 -0
chia/full_node/block_store.py
CHANGED
|
@@ -7,15 +7,15 @@ from typing import Optional
|
|
|
7
7
|
|
|
8
8
|
import typing_extensions
|
|
9
9
|
import zstd
|
|
10
|
+
from chia_rs import SubEpochChallengeSegment, SubEpochSegments
|
|
11
|
+
from chia_rs.sized_bytes import bytes32
|
|
12
|
+
from chia_rs.sized_ints import uint32
|
|
10
13
|
|
|
11
14
|
from chia.consensus.block_record import BlockRecord
|
|
12
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
13
15
|
from chia.types.full_block import FullBlock
|
|
14
|
-
from chia.types.weight_proof import SubEpochChallengeSegment, SubEpochSegments
|
|
15
16
|
from chia.util.db_wrapper import DBWrapper2, execute_fetchone
|
|
16
17
|
from chia.util.errors import Err
|
|
17
18
|
from chia.util.full_block_utils import GeneratorBlockInfo, block_info_from_block, generator_from_block
|
|
18
|
-
from chia.util.ints import uint32
|
|
19
19
|
from chia.util.lru_cache import LRUCache
|
|
20
20
|
|
|
21
21
|
log = logging.getLogger(__name__)
|
|
@@ -232,7 +232,7 @@ class BlockStore:
|
|
|
232
232
|
if len(heights) == 0:
|
|
233
233
|
return []
|
|
234
234
|
|
|
235
|
-
formatted_str = f
|
|
235
|
+
formatted_str = f"SELECT block from full_blocks WHERE height in ({'?,' * (len(heights) - 1)}?)"
|
|
236
236
|
async with self.db_wrapper.reader_no_transaction() as conn:
|
|
237
237
|
async with conn.execute(formatted_str, heights) as cursor:
|
|
238
238
|
ret: list[FullBlock] = []
|
|
@@ -294,8 +294,7 @@ class BlockStore:
|
|
|
294
294
|
|
|
295
295
|
generators: dict[uint32, bytes] = {}
|
|
296
296
|
formatted_str = (
|
|
297
|
-
f"SELECT block, height from full_blocks "
|
|
298
|
-
f'WHERE in_main_chain=1 AND height in ({"?," * (len(heights) - 1)}?)'
|
|
297
|
+
f"SELECT block, height from full_blocks WHERE in_main_chain=1 AND height in ({'?,' * (len(heights) - 1)}?)"
|
|
299
298
|
)
|
|
300
299
|
async with self.db_wrapper.reader_no_transaction() as conn:
|
|
301
300
|
async with conn.execute(formatted_str, list(heights)) as cursor:
|
|
@@ -333,7 +332,7 @@ class BlockStore:
|
|
|
333
332
|
async with conn.execute(
|
|
334
333
|
"SELECT header_hash,block_record "
|
|
335
334
|
"FROM full_blocks "
|
|
336
|
-
f
|
|
335
|
+
f"WHERE header_hash in ({'?,' * (len(header_hashes) - 1)}?)",
|
|
337
336
|
header_hashes,
|
|
338
337
|
) as cursor:
|
|
339
338
|
for row in await cursor.fetchall():
|
|
@@ -377,7 +376,7 @@ class BlockStore:
|
|
|
377
376
|
|
|
378
377
|
assert len(header_hashes) < self.db_wrapper.host_parameter_limit
|
|
379
378
|
formatted_str = (
|
|
380
|
-
f
|
|
379
|
+
f"SELECT header_hash, block from full_blocks WHERE header_hash in ({'?,' * (len(header_hashes) - 1)}?)"
|
|
381
380
|
)
|
|
382
381
|
all_blocks: dict[bytes32, bytes] = {}
|
|
383
382
|
async with self.db_wrapper.reader_no_transaction() as conn:
|
|
@@ -405,7 +404,7 @@ class BlockStore:
|
|
|
405
404
|
return []
|
|
406
405
|
|
|
407
406
|
formatted_str = (
|
|
408
|
-
f
|
|
407
|
+
f"SELECT header_hash, block from full_blocks WHERE header_hash in ({'?,' * (len(header_hashes) - 1)}?)"
|
|
409
408
|
)
|
|
410
409
|
all_blocks: dict[bytes32, FullBlock] = {}
|
|
411
410
|
async with self.db_wrapper.reader_no_transaction() as conn:
|
|
@@ -3,9 +3,10 @@ from __future__ import annotations
|
|
|
3
3
|
from collections.abc import Awaitable
|
|
4
4
|
from typing import Callable
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_ints import uint32
|
|
7
|
+
|
|
6
8
|
from chia.consensus.blockchain_interface import BlockchainInterface
|
|
7
9
|
from chia.server.ws_connection import WSChiaConnection
|
|
8
|
-
from chia.util.ints import uint32
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
async def check_fork_next_block(
|
chia/full_node/coin_store.py
CHANGED
|
@@ -9,16 +9,16 @@ from typing import Any, Optional
|
|
|
9
9
|
|
|
10
10
|
import typing_extensions
|
|
11
11
|
from aiosqlite import Cursor
|
|
12
|
+
from chia_rs.sized_bytes import bytes32
|
|
13
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
12
14
|
from clvm.casts import int_from_bytes
|
|
13
15
|
|
|
14
16
|
from chia.protocols.wallet_protocol import CoinState
|
|
15
17
|
from chia.types.blockchain_format.coin import Coin
|
|
16
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
17
18
|
from chia.types.coin_record import CoinRecord
|
|
18
19
|
from chia.types.eligible_coin_spends import UnspentLineageInfo
|
|
19
20
|
from chia.util.batches import to_batches
|
|
20
21
|
from chia.util.db_wrapper import SQLITE_MAX_VARIABLE_NUMBER, DBWrapper2
|
|
21
|
-
from chia.util.ints import uint32, uint64
|
|
22
22
|
from chia.util.lru_cache import LRUCache
|
|
23
23
|
|
|
24
24
|
log = logging.getLogger(__name__)
|
|
@@ -163,7 +163,7 @@ class CoinStore:
|
|
|
163
163
|
await conn.execute(
|
|
164
164
|
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
|
|
165
165
|
f"coin_parent, amount, timestamp FROM coin_record "
|
|
166
|
-
f
|
|
166
|
+
f"WHERE coin_name in ({','.join(['?'] * len(names_db))}) ",
|
|
167
167
|
names_db,
|
|
168
168
|
)
|
|
169
169
|
)
|
|
@@ -271,7 +271,7 @@ class CoinStore:
|
|
|
271
271
|
async with conn.execute(
|
|
272
272
|
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
|
|
273
273
|
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY coin_puzzle_hash "
|
|
274
|
-
f
|
|
274
|
+
f"WHERE puzzle_hash in ({'?,' * (len(puzzle_hashes) - 1)}?) "
|
|
275
275
|
f"AND confirmed_index>=? AND confirmed_index<? "
|
|
276
276
|
f"{'' if include_spent_coins else 'AND spent_index=0'}",
|
|
277
277
|
(*puzzle_hashes_db, start_height, end_height),
|
|
@@ -297,7 +297,7 @@ class CoinStore:
|
|
|
297
297
|
async with conn.execute(
|
|
298
298
|
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
|
|
299
299
|
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY sqlite_autoindex_coin_record_1 "
|
|
300
|
-
f
|
|
300
|
+
f"WHERE coin_name in ({'?,' * (len(names) - 1)}?) "
|
|
301
301
|
f"AND confirmed_index>=? AND confirmed_index<? "
|
|
302
302
|
f"{'' if include_spent_coins else 'AND spent_index=0'}",
|
|
303
303
|
[*names, start_height, end_height],
|
|
@@ -336,7 +336,7 @@ class CoinStore:
|
|
|
336
336
|
async with conn.execute(
|
|
337
337
|
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
|
|
338
338
|
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY coin_puzzle_hash "
|
|
339
|
-
f
|
|
339
|
+
f"WHERE puzzle_hash in ({'?,' * (len(batch.entries) - 1)}?) "
|
|
340
340
|
f"AND (confirmed_index>=? OR spent_index>=?)"
|
|
341
341
|
f"{'' if include_spent_coins else 'AND spent_index=0'}"
|
|
342
342
|
" LIMIT ?",
|
|
@@ -367,7 +367,7 @@ class CoinStore:
|
|
|
367
367
|
parent_ids_db: tuple[Any, ...] = tuple(batch.entries)
|
|
368
368
|
async with conn.execute(
|
|
369
369
|
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, coin_parent, amount, timestamp "
|
|
370
|
-
f
|
|
370
|
+
f"FROM coin_record WHERE coin_parent in ({'?,' * (len(batch.entries) - 1)}?) "
|
|
371
371
|
f"AND confirmed_index>=? AND confirmed_index<? "
|
|
372
372
|
f"{'' if include_spent_coins else 'AND spent_index=0'}",
|
|
373
373
|
(*parent_ids_db, start_height, end_height),
|
|
@@ -401,7 +401,7 @@ class CoinStore:
|
|
|
401
401
|
|
|
402
402
|
async with conn.execute(
|
|
403
403
|
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, coin_parent, amount, timestamp "
|
|
404
|
-
f
|
|
404
|
+
f"FROM coin_record WHERE coin_name in ({'?,' * (len(batch.entries) - 1)}?) "
|
|
405
405
|
f"AND (confirmed_index>=? OR spent_index>=?) {max_height_sql}"
|
|
406
406
|
f"{'' if include_spent_coins else 'AND spent_index=0'}"
|
|
407
407
|
" LIMIT ?",
|
|
@@ -464,7 +464,7 @@ class CoinStore:
|
|
|
464
464
|
cursor = await conn.execute(
|
|
465
465
|
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
|
|
466
466
|
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY coin_puzzle_hash "
|
|
467
|
-
f
|
|
467
|
+
f"WHERE puzzle_hash in ({'?,' * (puzzle_hash_count - 1)}?) "
|
|
468
468
|
f"AND (confirmed_index>=? OR spent_index>=?) "
|
|
469
469
|
f"{height_filter} {amount_filter}"
|
|
470
470
|
f"ORDER BY MAX(confirmed_index, spent_index) ASC "
|
|
@@ -486,7 +486,7 @@ class CoinStore:
|
|
|
486
486
|
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
|
|
487
487
|
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY sqlite_autoindex_coin_record_1 "
|
|
488
488
|
f"WHERE coin_name IN (SELECT coin_id FROM hints "
|
|
489
|
-
f
|
|
489
|
+
f"WHERE hint IN ({'?,' * (puzzle_hash_count - 1)}?)) "
|
|
490
490
|
f"AND (confirmed_index>=? OR spent_index>=?) "
|
|
491
491
|
f"{height_filter} {amount_filter}"
|
|
492
492
|
f"ORDER BY MAX(confirmed_index, spent_index) ASC "
|
chia/full_node/fee_estimate.py
CHANGED
|
@@ -4,8 +4,9 @@ import math
|
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
|
+
from chia_rs.sized_ints import uint64
|
|
8
|
+
|
|
7
9
|
from chia.types.fee_rate import FeeRate, FeeRateV2
|
|
8
|
-
from chia.util.ints import uint64
|
|
9
10
|
from chia.util.streamable import Streamable, streamable
|
|
10
11
|
|
|
11
12
|
|
chia/full_node/fee_estimation.py
CHANGED
|
@@ -3,10 +3,11 @@ from __future__ import annotations
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from datetime import datetime
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
7
|
+
|
|
6
8
|
from chia.types.clvm_cost import CLVMCost
|
|
7
9
|
from chia.types.fee_rate import FeeRate
|
|
8
10
|
from chia.types.mojos import Mojos
|
|
9
|
-
from chia.util.ints import uint32, uint64
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
@dataclass(frozen=True)
|
chia/full_node/fee_estimator.py
CHANGED
|
@@ -3,6 +3,8 @@ from __future__ import annotations
|
|
|
3
3
|
import logging
|
|
4
4
|
from dataclasses import dataclass, field
|
|
5
5
|
|
|
6
|
+
from chia_rs.sized_ints import uint32, uint64
|
|
7
|
+
|
|
6
8
|
from chia.full_node.fee_estimate import FeeEstimate, FeeEstimateGroup, FeeEstimateV2, fee_estimate_v2_to_v1
|
|
7
9
|
from chia.full_node.fee_estimation import FeeMempoolInfo
|
|
8
10
|
from chia.full_node.fee_tracker import (
|
|
@@ -13,7 +15,6 @@ from chia.full_node.fee_tracker import (
|
|
|
13
15
|
get_estimate_time_intervals,
|
|
14
16
|
)
|
|
15
17
|
from chia.types.fee_rate import FeeRate, FeeRateV2
|
|
16
|
-
from chia.util.ints import uint32, uint64
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
# https://github.com/bitcoin/bitcoin/blob/5b6f0f31fa6ce85db3fb7f9823b1bbb06161ae32/src/policy/fees.cpp
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from chia_rs.sized_ints import uint32
|
|
3
4
|
from typing_extensions import Protocol
|
|
4
5
|
|
|
5
6
|
from chia.full_node.fee_estimation import FeeBlockInfo, FeeMempoolInfo, MempoolItemInfo
|
|
6
7
|
from chia.types.clvm_cost import CLVMCost
|
|
7
8
|
from chia.types.fee_rate import FeeRateV2
|
|
8
|
-
from chia.util.ints import uint32
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class FeeEstimatorInterface(Protocol):
|
chia/full_node/fee_history.py
CHANGED
chia/full_node/fee_tracker.py
CHANGED
|
@@ -5,6 +5,8 @@ from bisect import bisect_left
|
|
|
5
5
|
from dataclasses import dataclass
|
|
6
6
|
from typing import Optional
|
|
7
7
|
|
|
8
|
+
from chia_rs.sized_ints import uint8, uint32, uint64
|
|
9
|
+
|
|
8
10
|
from chia.full_node.fee_estimate_store import FeeStore
|
|
9
11
|
from chia.full_node.fee_estimation import MempoolItemInfo
|
|
10
12
|
from chia.full_node.fee_estimator_constants import (
|
|
@@ -27,7 +29,6 @@ from chia.full_node.fee_estimator_constants import (
|
|
|
27
29
|
SUFFICIENT_FEE_TXS,
|
|
28
30
|
)
|
|
29
31
|
from chia.full_node.fee_history import FeeStatBackup, FeeTrackerBackup
|
|
30
|
-
from chia.util.ints import uint8, uint32, uint64
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
@dataclass
|
chia/full_node/full_node.py
CHANGED
|
@@ -18,10 +18,14 @@ from typing import TYPE_CHECKING, Any, Callable, ClassVar, Optional, TextIO, Uni
|
|
|
18
18
|
from chia_rs import (
|
|
19
19
|
AugSchemeMPL,
|
|
20
20
|
BLSCache,
|
|
21
|
+
ConsensusConstants,
|
|
22
|
+
PoolTarget,
|
|
21
23
|
get_flags_for_height_and_constants,
|
|
22
24
|
run_block_generator,
|
|
23
25
|
run_block_generator2,
|
|
24
26
|
)
|
|
27
|
+
from chia_rs.sized_bytes import bytes32
|
|
28
|
+
from chia_rs.sized_ints import uint8, uint32, uint64, uint128
|
|
25
29
|
from packaging.version import Version
|
|
26
30
|
|
|
27
31
|
from chia.consensus.block_body_validation import ForkInfo
|
|
@@ -29,13 +33,13 @@ from chia.consensus.block_creation import unfinished_block_to_full_block
|
|
|
29
33
|
from chia.consensus.block_record import BlockRecord
|
|
30
34
|
from chia.consensus.blockchain import AddBlockResult, Blockchain, BlockchainMutexPriority, StateChangeSummary
|
|
31
35
|
from chia.consensus.blockchain_interface import BlockchainInterface
|
|
32
|
-
from chia.consensus.constants import ConsensusConstants
|
|
33
36
|
from chia.consensus.cost_calculator import NPCResult
|
|
34
37
|
from chia.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty
|
|
35
38
|
from chia.consensus.make_sub_epoch_summary import next_sub_epoch_summary
|
|
36
39
|
from chia.consensus.multiprocess_validation import PreValidationResult, pre_validate_block
|
|
37
40
|
from chia.consensus.pot_iterations import calculate_sp_iters
|
|
38
41
|
from chia.full_node.block_store import BlockStore
|
|
42
|
+
from chia.full_node.check_fork_next_block import check_fork_next_block
|
|
39
43
|
from chia.full_node.coin_store import CoinStore
|
|
40
44
|
from chia.full_node.full_node_api import FullNodeAPI
|
|
41
45
|
from chia.full_node.full_node_store import FullNodeStore, FullNodeStorePeakResult, UnfinishedBlockEntry
|
|
@@ -60,8 +64,6 @@ from chia.server.outbound_message import Message, NodeType, make_msg
|
|
|
60
64
|
from chia.server.server import ChiaServer
|
|
61
65
|
from chia.server.ws_connection import WSChiaConnection
|
|
62
66
|
from chia.types.blockchain_format.classgroup import ClassgroupElement
|
|
63
|
-
from chia.types.blockchain_format.pool_target import PoolTarget
|
|
64
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
65
67
|
from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary
|
|
66
68
|
from chia.types.blockchain_format.vdf import CompressibleVDFField, VDFInfo, VDFProof, validate_vdf
|
|
67
69
|
from chia.types.coin_record import CoinRecord
|
|
@@ -78,14 +80,12 @@ from chia.types.validation_state import ValidationState
|
|
|
78
80
|
from chia.types.weight_proof import WeightProof
|
|
79
81
|
from chia.util.augmented_chain import AugmentedBlockchain
|
|
80
82
|
from chia.util.bech32m import encode_puzzle_hash
|
|
81
|
-
from chia.util.check_fork_next_block import check_fork_next_block
|
|
82
83
|
from chia.util.condition_tools import pkm_pairs
|
|
83
84
|
from chia.util.config import process_config_start_method
|
|
84
85
|
from chia.util.db_synchronous import db_synchronous_on
|
|
85
86
|
from chia.util.db_version import lookup_db_version, set_db_version_async
|
|
86
87
|
from chia.util.db_wrapper import DBWrapper2, manage_connection
|
|
87
88
|
from chia.util.errors import ConsensusError, Err, TimestampError, ValidationError
|
|
88
|
-
from chia.util.ints import uint8, uint32, uint64, uint128
|
|
89
89
|
from chia.util.limited_semaphore import LimitedSemaphore
|
|
90
90
|
from chia.util.network import is_localhost
|
|
91
91
|
from chia.util.path import path_from_root
|
|
@@ -620,6 +620,7 @@ class FullNode:
|
|
|
620
620
|
fork_hash = self.constants.GENESIS_CHALLENGE
|
|
621
621
|
assert fork_hash
|
|
622
622
|
fork_info = ForkInfo(start_height - 1, start_height - 1, fork_hash)
|
|
623
|
+
blockchain = AugmentedBlockchain(self.blockchain)
|
|
623
624
|
for height in range(start_height, target_height, batch_size):
|
|
624
625
|
end_height = min(target_height, height + batch_size)
|
|
625
626
|
request = RequestBlocks(uint32(height), uint32(end_height), True)
|
|
@@ -638,7 +639,7 @@ class FullNode:
|
|
|
638
639
|
)
|
|
639
640
|
vs = ValidationState(ssi, diff, None)
|
|
640
641
|
success, state_change_summary = await self.add_block_batch(
|
|
641
|
-
response.blocks, peer_info, fork_info, vs
|
|
642
|
+
response.blocks, peer_info, fork_info, vs, blockchain
|
|
642
643
|
)
|
|
643
644
|
if not success:
|
|
644
645
|
raise ValueError(f"Error short batch syncing, failed to validate blocks {height}-{end_height}")
|
|
@@ -757,7 +758,7 @@ class FullNode:
|
|
|
757
758
|
# Store this peak/peer combination in case we want to sync to it, and to keep track of peers
|
|
758
759
|
self.sync_store.peer_has_block(request.header_hash, peer.peer_node_id, request.weight, request.height, True)
|
|
759
760
|
|
|
760
|
-
if self.blockchain.contains_block(request.header_hash):
|
|
761
|
+
if self.blockchain.contains_block(request.header_hash, request.height):
|
|
761
762
|
return None
|
|
762
763
|
|
|
763
764
|
# Not interested in less heavy peaks
|
|
@@ -778,7 +779,11 @@ class FullNode:
|
|
|
778
779
|
full_node_protocol.RequestBlock(target_peak.height, False),
|
|
779
780
|
timeout=10,
|
|
780
781
|
)
|
|
781
|
-
if
|
|
782
|
+
if (
|
|
783
|
+
target_peak_response is not None
|
|
784
|
+
and isinstance(target_peak_response, RespondBlock)
|
|
785
|
+
and target_peak_response.block.header_hash == target_peak.header_hash
|
|
786
|
+
):
|
|
782
787
|
self.sync_store.peer_has_block(
|
|
783
788
|
target_peak.header_hash,
|
|
784
789
|
peer.peer_node_id,
|
|
@@ -1022,7 +1027,11 @@ class FullNode:
|
|
|
1022
1027
|
)
|
|
1023
1028
|
)
|
|
1024
1029
|
for i, target_peak_response in enumerate(await asyncio.gather(*coroutines)):
|
|
1025
|
-
if
|
|
1030
|
+
if (
|
|
1031
|
+
target_peak_response is not None
|
|
1032
|
+
and isinstance(target_peak_response, RespondBlock)
|
|
1033
|
+
and target_peak_response.block.header_hash == target_peak.header_hash
|
|
1034
|
+
):
|
|
1026
1035
|
self.sync_store.peer_has_block(
|
|
1027
1036
|
target_peak.header_hash, peers[i].peer_node_id, target_peak.weight, target_peak.height, False
|
|
1028
1037
|
)
|
|
@@ -1240,7 +1249,7 @@ class FullNode:
|
|
|
1240
1249
|
# By setting the next allowed timestamp to now,
|
|
1241
1250
|
# means that any other peer that has waited for
|
|
1242
1251
|
# this will have its next allowed timestamp in
|
|
1243
|
-
# the passed, and be
|
|
1252
|
+
# the passed, and be preferred multiple times
|
|
1244
1253
|
# over this peer.
|
|
1245
1254
|
new_peers_with_peak[idx] = (
|
|
1246
1255
|
new_peers_with_peak[idx][0],
|
|
@@ -1478,13 +1487,13 @@ class FullNode:
|
|
|
1478
1487
|
peer_info: PeerInfo,
|
|
1479
1488
|
fork_info: ForkInfo,
|
|
1480
1489
|
vs: ValidationState, # in-out parameter
|
|
1490
|
+
blockchain: AugmentedBlockchain,
|
|
1481
1491
|
wp_summaries: Optional[list[SubEpochSummary]] = None,
|
|
1482
1492
|
) -> tuple[bool, Optional[StateChangeSummary]]:
|
|
1483
1493
|
# Precondition: All blocks must be contiguous blocks, index i+1 must be the parent of index i
|
|
1484
1494
|
# Returns a bool for success, as well as a StateChangeSummary if the peak was advanced
|
|
1485
1495
|
|
|
1486
1496
|
pre_validate_start = time.monotonic()
|
|
1487
|
-
blockchain = AugmentedBlockchain(self.blockchain)
|
|
1488
1497
|
blocks_to_validate = await self.skip_blocks(blockchain, all_blocks, fork_info, vs)
|
|
1489
1498
|
|
|
1490
1499
|
if len(blocks_to_validate) == 0:
|
|
@@ -2018,7 +2027,7 @@ class FullNode:
|
|
|
2018
2027
|
|
|
2019
2028
|
# Adds the block to seen, and check if it's seen before (which means header is in memory)
|
|
2020
2029
|
header_hash = block.header_hash
|
|
2021
|
-
if self.blockchain.contains_block(header_hash):
|
|
2030
|
+
if self.blockchain.contains_block(header_hash, block.height):
|
|
2022
2031
|
if fork_info is not None:
|
|
2023
2032
|
await self.blockchain.run_single_block(block, fork_info)
|
|
2024
2033
|
return None
|
|
@@ -2092,7 +2101,7 @@ class FullNode:
|
|
|
2092
2101
|
enable_profiler(self.profile_block_validation) as pr,
|
|
2093
2102
|
):
|
|
2094
2103
|
# After acquiring the lock, check again, because another asyncio thread might have added it
|
|
2095
|
-
if self.blockchain.contains_block(header_hash):
|
|
2104
|
+
if self.blockchain.contains_block(header_hash, block.height):
|
|
2096
2105
|
if fork_info is not None:
|
|
2097
2106
|
await self.blockchain.run_single_block(block, fork_info)
|
|
2098
2107
|
return None
|
|
@@ -2280,8 +2289,9 @@ class FullNode:
|
|
|
2280
2289
|
"""
|
|
2281
2290
|
receive_time = time.time()
|
|
2282
2291
|
|
|
2283
|
-
if
|
|
2284
|
-
block.prev_header_hash
|
|
2292
|
+
if (
|
|
2293
|
+
block.prev_header_hash != self.constants.GENESIS_CHALLENGE
|
|
2294
|
+
and self.blockchain.try_block_record(block.prev_header_hash) is None
|
|
2285
2295
|
):
|
|
2286
2296
|
# No need to request the parent, since the peer will send it to us anyway, via NewPeak
|
|
2287
2297
|
self.log.debug("Received a disconnected unfinished block")
|
chia/full_node/full_node_api.py
CHANGED
|
@@ -12,12 +12,18 @@ from typing import TYPE_CHECKING, ClassVar, Optional, cast
|
|
|
12
12
|
import anyio
|
|
13
13
|
from chia_rs import (
|
|
14
14
|
AugSchemeMPL,
|
|
15
|
+
FoliageBlockData,
|
|
16
|
+
FoliageTransactionBlock,
|
|
15
17
|
G1Element,
|
|
16
18
|
G2Element,
|
|
17
19
|
MerkleSet,
|
|
20
|
+
PoolTarget,
|
|
21
|
+
RewardChainBlockUnfinished,
|
|
18
22
|
additions_and_removals,
|
|
19
23
|
get_flags_for_height_and_constants,
|
|
20
24
|
)
|
|
25
|
+
from chia_rs.sized_bytes import bytes32
|
|
26
|
+
from chia_rs.sized_ints import uint8, uint32, uint64, uint128
|
|
21
27
|
from chiabip158 import PyBIP158
|
|
22
28
|
|
|
23
29
|
from chia.consensus.block_creation import create_unfinished_block
|
|
@@ -25,7 +31,6 @@ from chia.consensus.block_record import BlockRecord
|
|
|
25
31
|
from chia.consensus.blockchain import BlockchainMutexPriority
|
|
26
32
|
from chia.consensus.get_block_generator import get_block_generator
|
|
27
33
|
from chia.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters
|
|
28
|
-
from chia.full_node.bundle_tools import simple_solution_generator, simple_solution_generator_backrefs
|
|
29
34
|
from chia.full_node.coin_store import CoinStore
|
|
30
35
|
from chia.full_node.fee_estimate import FeeEstimate, FeeEstimateGroup, fee_rate_v2_to_v1
|
|
31
36
|
from chia.full_node.fee_estimator_interface import FeeEstimatorInterface
|
|
@@ -52,11 +57,7 @@ from chia.server.server import ChiaServer
|
|
|
52
57
|
from chia.server.ws_connection import WSChiaConnection
|
|
53
58
|
from chia.types.block_protocol import BlockInfo
|
|
54
59
|
from chia.types.blockchain_format.coin import Coin, hash_coin_ids
|
|
55
|
-
from chia.types.blockchain_format.foliage import FoliageBlockData, FoliageTransactionBlock
|
|
56
|
-
from chia.types.blockchain_format.pool_target import PoolTarget
|
|
57
60
|
from chia.types.blockchain_format.proof_of_space import verify_and_get_quality_string
|
|
58
|
-
from chia.types.blockchain_format.reward_chain_block import RewardChainBlockUnfinished
|
|
59
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
60
61
|
from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary
|
|
61
62
|
from chia.types.coin_record import CoinRecord
|
|
62
63
|
from chia.types.end_of_slot_bundle import EndOfSubSlotBundle
|
|
@@ -72,7 +73,6 @@ from chia.util.db_wrapper import SQLITE_MAX_VARIABLE_NUMBER
|
|
|
72
73
|
from chia.util.full_block_utils import get_height_and_tx_status_from_block, header_block_from_block
|
|
73
74
|
from chia.util.generator_tools import get_block_header
|
|
74
75
|
from chia.util.hash import std_hash
|
|
75
|
-
from chia.util.ints import uint8, uint32, uint64, uint128
|
|
76
76
|
from chia.util.limited_semaphore import LimitedSemaphoreFullError
|
|
77
77
|
from chia.util.task_referencer import create_referenced_task
|
|
78
78
|
|
|
@@ -96,7 +96,7 @@ class FullNodeAPI:
|
|
|
96
96
|
def __init__(self, full_node: FullNode) -> None:
|
|
97
97
|
self.log = logging.getLogger(__name__)
|
|
98
98
|
self.full_node = full_node
|
|
99
|
-
self.executor = ThreadPoolExecutor(max_workers=1)
|
|
99
|
+
self.executor = ThreadPoolExecutor(max_workers=1, thread_name_prefix="node-api-")
|
|
100
100
|
|
|
101
101
|
@property
|
|
102
102
|
def server(self) -> ChiaServer:
|
|
@@ -285,7 +285,7 @@ class FullNodeAPI:
|
|
|
285
285
|
async def request_proof_of_weight(self, request: full_node_protocol.RequestProofOfWeight) -> Optional[Message]:
|
|
286
286
|
if self.full_node.weight_proof_handler is None:
|
|
287
287
|
return None
|
|
288
|
-
if
|
|
288
|
+
if self.full_node.blockchain.try_block_record(request.tip) is None:
|
|
289
289
|
self.log.error(f"got weight proof request for unknown peak {request.tip}")
|
|
290
290
|
return None
|
|
291
291
|
if request.tip in self.full_node.pow_creation:
|
|
@@ -863,32 +863,12 @@ class FullNodeAPI:
|
|
|
863
863
|
while not curr_l_tb.is_transaction_block:
|
|
864
864
|
curr_l_tb = self.full_node.blockchain.block_record(curr_l_tb.prev_hash)
|
|
865
865
|
try:
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
866
|
+
block = await self.full_node.mempool_manager.create_block_generator(curr_l_tb.header_hash)
|
|
867
|
+
if block is not None:
|
|
868
|
+
block_generator, aggregate_signature, additions = block
|
|
869
869
|
except Exception as e:
|
|
870
870
|
self.log.error(f"Traceback: {traceback.format_exc()}")
|
|
871
871
|
self.full_node.log.error(f"Error making spend bundle {e} peak: {peak}")
|
|
872
|
-
mempool_bundle = None
|
|
873
|
-
if mempool_bundle is not None:
|
|
874
|
-
spend_bundle, additions = mempool_bundle
|
|
875
|
-
removals = spend_bundle.removals()
|
|
876
|
-
self.full_node.log.info(f"Add rem: {len(additions)} {len(removals)}")
|
|
877
|
-
aggregate_signature = spend_bundle.aggregated_signature
|
|
878
|
-
# when the hard fork activates, block generators are
|
|
879
|
-
# allowed to be serialized with the improved CLVM
|
|
880
|
-
# serialization format, supporting back-references
|
|
881
|
-
start_time = time.monotonic()
|
|
882
|
-
if peak.height >= self.full_node.constants.HARD_FORK_HEIGHT:
|
|
883
|
-
block_generator = simple_solution_generator_backrefs(spend_bundle)
|
|
884
|
-
else:
|
|
885
|
-
block_generator = simple_solution_generator(spend_bundle)
|
|
886
|
-
end_time = time.monotonic()
|
|
887
|
-
duration = end_time - start_time
|
|
888
|
-
self.log.log(
|
|
889
|
-
logging.INFO if duration < 1 else logging.WARNING,
|
|
890
|
-
f"serializing block generator took {duration:0.2f} seconds",
|
|
891
|
-
)
|
|
892
872
|
|
|
893
873
|
def get_plot_sig(to_sign: bytes32, _extra: G1Element) -> G2Element:
|
|
894
874
|
if to_sign == request.challenge_chain_sp:
|
|
@@ -1970,7 +1950,7 @@ class FullNodeAPI:
|
|
|
1970
1950
|
hints_db: tuple[bytes, ...] = tuple(batch.entries)
|
|
1971
1951
|
cursor = await conn.execute(
|
|
1972
1952
|
f"SELECT coin_id from hints INDEXED BY hint_index "
|
|
1973
|
-
f
|
|
1953
|
+
f"WHERE hint IN ({'?,' * (len(batch.entries) - 1)}?)",
|
|
1974
1954
|
hints_db,
|
|
1975
1955
|
)
|
|
1976
1956
|
for row in await cursor.fetchall():
|
|
@@ -6,9 +6,12 @@ import logging
|
|
|
6
6
|
import time
|
|
7
7
|
from typing import Optional
|
|
8
8
|
|
|
9
|
+
from chia_rs import ConsensusConstants
|
|
10
|
+
from chia_rs.sized_bytes import bytes32
|
|
11
|
+
from chia_rs.sized_ints import uint8, uint32, uint64, uint128
|
|
12
|
+
|
|
9
13
|
from chia.consensus.block_record import BlockRecord
|
|
10
14
|
from chia.consensus.blockchain_interface import BlockRecordsProtocol
|
|
11
|
-
from chia.consensus.constants import ConsensusConstants
|
|
12
15
|
from chia.consensus.difficulty_adjustment import can_finish_sub_and_full_epoch
|
|
13
16
|
from chia.consensus.make_sub_epoch_summary import make_sub_epoch_summary
|
|
14
17
|
from chia.consensus.multiprocess_validation import PreValidationResult
|
|
@@ -17,12 +20,10 @@ from chia.full_node.signage_point import SignagePoint
|
|
|
17
20
|
from chia.protocols import timelord_protocol
|
|
18
21
|
from chia.server.outbound_message import Message
|
|
19
22
|
from chia.types.blockchain_format.classgroup import ClassgroupElement
|
|
20
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
21
23
|
from chia.types.blockchain_format.vdf import VDFInfo, validate_vdf
|
|
22
24
|
from chia.types.end_of_slot_bundle import EndOfSubSlotBundle
|
|
23
25
|
from chia.types.full_block import FullBlock
|
|
24
26
|
from chia.types.unfinished_block import UnfinishedBlock
|
|
25
|
-
from chia.util.ints import uint8, uint32, uint64, uint128
|
|
26
27
|
from chia.util.lru_cache import LRUCache
|
|
27
28
|
from chia.util.streamable import Streamable, streamable
|
|
28
29
|
|
|
@@ -2,8 +2,9 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import Callable, Optional
|
|
4
4
|
|
|
5
|
+
from chia_rs.sized_bytes import bytes32
|
|
6
|
+
|
|
5
7
|
from chia.consensus.blockchain import StateChangeSummary
|
|
6
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
def get_hints_and_subscription_coin_ids(
|
chia/full_node/hint_store.py
CHANGED
|
@@ -4,8 +4,8 @@ import dataclasses
|
|
|
4
4
|
import logging
|
|
5
5
|
|
|
6
6
|
import typing_extensions
|
|
7
|
+
from chia_rs.sized_bytes import bytes32
|
|
7
8
|
|
|
8
|
-
from chia.types.blockchain_format.sized_bytes import bytes32
|
|
9
9
|
from chia.util.batches import to_batches
|
|
10
10
|
from chia.util.db_wrapper import SQLITE_MAX_VARIABLE_NUMBER, DBWrapper2
|
|
11
11
|
|
|
@@ -46,7 +46,7 @@ class HintStore:
|
|
|
46
46
|
hints_db: tuple[bytes, ...] = tuple(batch.entries)
|
|
47
47
|
cursor = await conn.execute(
|
|
48
48
|
f"SELECT coin_id from hints INDEXED BY hint_index "
|
|
49
|
-
f
|
|
49
|
+
f"WHERE hint IN ({'?,' * (len(batch.entries) - 1)}?) LIMIT ?",
|
|
50
50
|
(*hints_db, max_items),
|
|
51
51
|
)
|
|
52
52
|
rows = await cursor.fetchall()
|
|
@@ -62,7 +62,7 @@ class HintStore:
|
|
|
62
62
|
for batch in to_batches(coin_ids, SQLITE_MAX_VARIABLE_NUMBER):
|
|
63
63
|
coin_ids_db: tuple[bytes32, ...] = tuple(batch.entries)
|
|
64
64
|
cursor = await conn.execute(
|
|
65
|
-
f
|
|
65
|
+
f"SELECT hint from hints WHERE coin_id IN ({'?,' * (len(batch.entries) - 1)}?)",
|
|
66
66
|
coin_ids_db,
|
|
67
67
|
)
|
|
68
68
|
rows = await cursor.fetchall()
|