2

I want to know whether the bottom layer of Ethereum requires miners to verify blocks?

The reason for this problem is that I have been thinking about a scenario of blockchain transaction verification recently: If the api provided by chainLink is called in the smart contract, it is necessary that the contract address has enough tokens for payment. When the block containing this transaction is broadcast, other miners will verify the transaction in the block. When the miner verify the transaction in the new coming block, he need to call the smart contract. What if the contract address does not have enough tokens? Will miners continue to verify this transaction?

Hope you can give me some help, thanks!

1

Short answer is no but they do.

See https://ethereum.stackexchange.com/a/45187/405 for a deeper explanation of the process.

But as explained, it is because they would take too many risks not to validate each transaction in a block. It's game theory. If a miner was pushing a block with invalid transactions by not validating them, it would be detected by others and the block would be rejected by the network. The miner would have mined for nothing and mining for nothing is loosing money.

So yes for fun you can try not validating before pushing a block. It seems some do it as they bet on the tx being valid most of the time. But it's dangerous and not worth it IMO as the validating part is clearly not the one that uses a lot of energy (only a few hundreds of milliseconds).

In your case, miner will likely reject the transaction as soon as running it and will raise an error because of the low balance of the address at this block number. Miner will not select the transaction for the new block and will add another one from the pool instead.

6
  • Hello Nicolas! Thanks for your replay. I am confused that why it is easier to verify transactions. If a transaction is to execute a function on a smart contract, the process of verifying the transaction should also use the same input, execute this function and compare the previous results. I don’t know if what I understand is correct. – wei wang Dec 10 '20 at 8:56
  • @weiwang yes that's what happens. But it's a very small part of the computation load to create a block. The most part is dedicated to generating the proof of work mathematical computation. – Nicolas Massart Dec 10 '20 at 8:59
  • Thanks for your answer which benefits me a lot! – wei wang Dec 10 '20 at 10:07
  • @weiwang you can mark it as answer ;) – Nicolas Massart Dec 10 '20 at 11:37
  • Okay, thanks again! – wei wang Dec 10 '20 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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