Does every nodes(including non-mining nodes) execute smart contracts? I thought only mining nodes should execute all of contracts, but i heard that even non-mining nodes should execute smart contracts.

Then why should we run non-mining full node if i should run those works without any incentive?


Full nodes, by definition, need to verify the blocks they receive, which means they need to verify 3 things:

  1. That the PoW of the block header is correct

  2. That the accounts have enough ETH to send the transactions in the block

  3. That the state root in the block header matches the actual state after running all the transactions.

Number 3 is really what you're asking about. If full nodes didn't do this, they would have to trust that the miner didn't include invalid transactions in the block. The miner could actually artificially change the state to whatever they want if nodes didn't run the transactions. The miner could give all the ETH to their address if they wanted. If they're okay trusting the miner and the rest of the network to validate blocks, they can always run a light node which only verifies the PoW in the header and requests merkle proofs from lightserve nodes.

Not the answer you're looking for? Browse other questions tagged or ask your own question.