Repository: Chia-Network/chia-blockchain
File: chia/protocols/protocol_message_type_to_node_type.py (Python)

Code before:
    ProtocolMessageTypes.respond_transaction: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_proof_of_weight: {NodeType.WALLET, NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_proof_of_weight: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.new_unfinished_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_unfinished_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_unfinished_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.new_signage_point_or_end_of_sub_slot: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_signage_point_or_end_of_sub_slot: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_signage_point: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_end_of_sub_slot: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_mempool_transactions: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_compact_vdf: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_compact_vdf: {NodeType.FULL_NODE},
    ProtocolMessageTypes.new_compact_vdf: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_peers: {NodeType.WALLET, NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_peers: {NodeType.FULL_NODE},
    # TODO: Inspect when enabling none response capability
    ProtocolMessageTypes.none_response: set(),
    ProtocolMessageTypes.new_unfinished_block2: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_unfinished_block2: {NodeType.FULL_NODE},
    # Wallet protocol (wallet <-> full_node)
    ProtocolMessageTypes.request_puzzle_solution: {NodeType.WALLET},
    ProtocolMessageTypes.respond_puzzle_solution: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_puzzle_solution: {NodeType.FULL_NODE},
    ProtocolMessageTypes.send_transaction: {NodeType.WALLET},
    ProtocolMessageTypes.transaction_ack: {NodeType.FULL_NODE},
    ProtocolMessageTypes.new_peak_wallet: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_block_header: {NodeType.WALLET},
    ProtocolMessageTypes.respond_block_header: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_header_request: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_removals: {NodeType.WALLET},
    ProtocolMessageTypes.respond_removals: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_removals_request: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_additions: {NodeType.WALLET},
    ProtocolMessageTypes.respond_additions: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_additions_request: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_header_blocks: {NodeType.WALLET},
    ProtocolMessageTypes.reject_header_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_header_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.coin_state_update: {NodeType.FULL_NODE},
    ProtocolMessageTypes.register_for_ph_updates: {NodeType.WALLET},
    ProtocolMessageTypes.respond_to_ph_updates: {NodeType.FULL_NODE},
    ProtocolMessageTypes.register_for_coin_updates: {NodeType.WALLET},
    ProtocolMessageTypes.respond_to_coin_updates: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_children: {NodeType.WALLET},

Review comment (bug):
a none response means the request failed in some way. I think every node type is allowed to send this

Code after:
    ProtocolMessageTypes.respond_transaction: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_proof_of_weight: {NodeType.WALLET, NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_proof_of_weight: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.new_unfinished_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_unfinished_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_unfinished_block: {NodeType.FULL_NODE},
    ProtocolMessageTypes.new_signage_point_or_end_of_sub_slot: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_signage_point_or_end_of_sub_slot: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_signage_point: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_end_of_sub_slot: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_mempool_transactions: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_compact_vdf: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_compact_vdf: {NodeType.FULL_NODE},
    ProtocolMessageTypes.new_compact_vdf: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_peers: {NodeType.WALLET, NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_peers: {NodeType.FULL_NODE},
    # No one currently sends none responses as it's gated by a capability
    # that is currently disabled. Revisit when the none response capability
    # gets enabled.
    ProtocolMessageTypes.none_response: set(),
    ProtocolMessageTypes.new_unfinished_block2: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_unfinished_block2: {NodeType.FULL_NODE},
    # Wallet protocol (wallet <-> full_node)
    ProtocolMessageTypes.request_puzzle_solution: {NodeType.WALLET},
    ProtocolMessageTypes.respond_puzzle_solution: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_puzzle_solution: {NodeType.FULL_NODE},
    ProtocolMessageTypes.send_transaction: {NodeType.WALLET},
    ProtocolMessageTypes.transaction_ack: {NodeType.FULL_NODE},
    ProtocolMessageTypes.new_peak_wallet: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_block_header: {NodeType.WALLET},
    ProtocolMessageTypes.respond_block_header: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_header_request: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_removals: {NodeType.WALLET},
    ProtocolMessageTypes.respond_removals: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_removals_request: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_additions: {NodeType.WALLET},
    ProtocolMessageTypes.respond_additions: {NodeType.FULL_NODE},
    ProtocolMessageTypes.reject_additions_request: {NodeType.FULL_NODE},
    ProtocolMessageTypes.request_header_blocks: {NodeType.WALLET},
    ProtocolMessageTypes.reject_header_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.respond_header_blocks: {NodeType.FULL_NODE},
    ProtocolMessageTypes.coin_state_update: {NodeType.FULL_NODE},
    ProtocolMessageTypes.register_for_ph_updates: {NodeType.WALLET},
    ProtocolMessageTypes.respond_to_ph_updates: {NodeType.FULL_NODE},
    ProtocolMessageTypes.register_for_coin_updates: {NodeType.WALLET},