Blockchain – How to Stop Miner Who Doesn’t Execute Operations

blockchainminingtransactions

When a miner evaluate operations on VM there might be a case when there is not enough gas to fulfill operation.

In such cases

"The miner will stop processing the transaction, revert any changes it
made, but still include it in the blockchain as a "failed
transaction", collecting the fees for it. This may seem harsh, but
when you realise that the real work for the miner was in performing
the computation, you can see that they will never get those resources
back either. So it's only fair that you pay them for the work they
did, even though your badly designed transaction ran out of gas."

Suppose there is a fraud miner who does not execute operations at all but marks any transaction as failed and takes all the gas.

What stops the miners from such behavior? Mining is faster (because no operations are executed at all), fraud miner took all the gas (and ether).

Could somebody explain or show a place in the docs or client where the case is prevented?

Best Answer

All nodes on the network execute all contract operations in each block to verify that the miner did it correctly.

If miners transmit a block where they did something like you described, it will be considered invalid by all nodes who receive it. They will ignore it and they will not relay it to other nodes. They may even break their connection to the miner and temporarily locally ban their IP.

There isn't a page in the docs about this specific case, because it is part of the general case of invalid blocks. The mechanisms that deal with this are the same ones for when:

  • A miner tries to mint more Ether than is allowed

  • A miner tries to mine an invalid transaction

  • A miner creates a larger block than is allowed

  • A miner transmits a block with an invalid hash

  • etc... (any case in which a block is invalid under the consensus rules)

Related Topic