ethereum / ethereumj

DEPRECATED! Java implementation of the Ethereum yellowpaper. For JSON-RPC and other client features check Ethereum Harmony
GNU Lesser General Public License v3.0
2.18k stars 1.09k forks source link

Fixes: REVERT counts code storage gas cost while shouldn't #1270

Closed zilm13 closed 5 years ago

zilm13 commented 5 years ago

Fixes recent conflict on Ropsten. Reference: EIP-140 (REVERT)

The cost of the REVERT instruction equals to that of the RETURN instruction, i.e. the rollback itself does not consume all gas, the contract only has to pay for memory.

In case there is not enough gas left to cover the cost of REVERT or there is a stack underflow, the effect of the REVERT instruction will equal to that of a regular out of gas exception, i.e. it will consume all gas.
coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.02%) to 57.163% when pulling 9c656b71569c94210f4628484e5e8657bba54a4b on fix/ropsten-revert into 0464c1da55d0905df1698a088dbaa77c5803d04b on develop.