evm icon indicating copy to clipboard operation
evm copied to clipboard

Don't ignore gasometer's record_cost() error

Open notlesh opened this issue 4 years ago • 2 comments

This fixes a problem where a precompile that returns gas exceeding the remaining gas is ignored. Instead of getting an OOG error, no gas is recorded -- effectively the precompile invocation is a freebie!

notlesh avatar Apr 23 '21 19:04 notlesh

This may still be wrong because we should consume all remaining gas at this point. It's actually indicative of a poorly designed precompile; the precompile should have estimated gas and done a proper check before attempting an expensive computation.

notlesh avatar Apr 23 '21 19:04 notlesh

Yeah this should actually be an error of Fatal::ConstaintFailed. The interpreter basically doesn't know what to do next and it indicates a logic error.

sorpaas avatar May 28 '21 16:05 sorpaas