For a miner to decide whether to process a transaction, they may be able to run the byte code of each contract through semantic execution (like KEVM).
If it is possible to prove that whatever the input string is, the execution either/or:
- fails within certain bound of gas spent
- pays gas to the miner
then this transaction is safe to start processing.
If the non-mining nodes perform the same analysis on the contract, and it is possible to prove the above, then the non-mining nodes can distinguish between cases (1) and (2) and therefore help shield miners from invalid transactions