When sending a transaction to a contract, what happens if the contract code takes longer to execute than the block takes to mine? Whether it be computational based or static limits. Would this cause any issues?


1 Answer 1


If a transaction takes a long time to execute it will delay mining new blocks.

Like two years ago there was a Denial of Service attacks that used that characteristic. The contracts used cheap opcodes that take a long time to execute. Miners will take a long time verifying new block and that delay mining new blocks.

A first workaround was to reduce the gas limit, meaning fewer of the bad priced opcodes were possible to execute. The definitive solution was to fork so the price of the opcodes was adjusted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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