How do nodes (not necessarily miners) treat transactions that result in Solidity throw (i.e. Out Of Gas error, transaction reverted)? Such transactions' only effect is gas (ether) transfer from the sender's account to the miner. So miners have incentive to mine them; but do nodes relay them by default?
Yes, nodes relay the transactions by default. Transactions are relayed before they are executed and their gas consumption and behavior is determined. Nodes just do a basic check such as:
- is the signature valid?
- does the sending account have enough Ether to pay for the gas?
- is the gas below the block gas limit?
If the basic checks pass, the node relays the transaction. Miners then perform the relatively expensive job of executing the transaction, and then include it in a block. When a "full node" gets the block, it then executes the transactions in the block to verify the security and integrity of the blockchain that it builds.