Closed wanderer closed 6 years ago
I think this is a good idea, but would suggest to keep the behaviour as is. Since this issue was opened, the EVM introduced the REVERT
opcode.
Reasoning: revert()
will mark the transaction as reverted and will not charge all the gas. unreachable
then still remains as a second option to abort a transaction.
These two kinds of aborts are utilised by static analysis tools on Ethereum, where revert
usually corresponds to a pre-condition and unreachable
corresponds to an assertion.
I don't think there is any reason to additionally consume remaining gas in case of any kind of failure. If we accept this fact, the only matter that is left is how to report different kinds of failures.
Decision: document that unreachable
results in OOG.
I think it would be more correct to document that a trap results in OOG.
Currently unreachable works just like an invalid opcode in EVM1, but it could provide a nicer way of handling reverts