1

In a blockchain with a typically small block time such as Polygon (or any other chain in general), what happens if executing of a
a) transaction
b) view function
longs more time than a block time?

Suppose that we are reading some info from blockchain in a view function, is data returned by the function valid in such circumstance?

1 Answer 1

1

This is not possible, because EVM based blockchains are not Turing complete. Any transaction is eventually terminated by exhausting all of its gas.

Transaction maxes out the gas usage as the max gas allocation per block, so a transaction can never exceed available gas allocated for one full block

2
  • 1
    what about view functions? what happens to them if they took longer than block time? Commented Jul 12, 2021 at 8:20
  • 2
    view functions are similarly limited by the gas on eth_call even though gas is never spent. This protects against accidentally (or purposefully) doing a denial-of-service attack against the RPC node. Commented Jul 12, 2021 at 8:45

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.