laconicd-deprecated/x/evm
Loredana Cirstea 77d9e29923
fix: GasMeter reset in AnteHandler EthGasConsumeDecorator (#964)
* Fix GasMeter reset in AnteHandler - EthGasConsumeDecorator

Conforming to the spec:
e7066c4271/docs/basics/gas-fees.md
> Set newCtx.GasMeter to 0, with a limit of GasWanted.
> This step is extremely important, as it not only makes sure the transaction cannot consume infinite gas,
> but also that ctx.GasMeter is reset in-between each DeliverTx
> (ctx is set to newCtx after anteHandler is run, and the anteHandler is run each time DeliverTx is called).

* Compute gasWanted in ante handler based on msg gas

* Tests - check gas meter limit after EthGasConsumeDecorator ante handler runs

* Update CHANGELOG.md

* EthGasConsumeDecorator ante handler resets the gas meter only for CheckTx

* Reset the gas meter in Keeper.EthereumTx to an infinite gas meter

* Fix TestOutOfGasWhenDeployContract error check

* Move gas meter reset to the innermost EthAnteHandle

* add NewInfiniteGasMeterWithLimit for setting the user provided gas limit

Fixes block's consumed gas calculation in the block creation phase.

* Fix lint

* Fix lint

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2022-03-06 15:09:28 +01:00
..
atlas docs: banner & other (#607) 2021-09-29 18:15:55 +02:00
client impr: support batch eth txs (#901) 2022-01-14 10:37:33 +01:00
keeper fix: GasMeter reset in AnteHandler EthGasConsumeDecorator (#964) 2022-03-06 15:09:28 +01:00
simulation evm: fixed commented out simulations, pubsub, and handler tests (#655) 2021-10-11 13:09:53 +02:00
spec remove unused parameters from evm spec (#934) 2022-02-11 11:41:20 +01:00
statedb evm: improve test coverage of statedb package (#888) 2022-01-06 18:10:51 +01:00
types evm: add returnValue message on tracing (#962) 2022-03-02 02:14:21 +00:00
genesis_test.go evm: refactor statedb implementation (#729) 2022-01-05 08:28:27 +01:00
genesis.go types, evm: refactor accounts (#884) 2022-01-05 19:18:02 +01:00
handler_test.go evm: refactor statedb implementation (#729) 2022-01-05 08:28:27 +01:00
handler.go evm: rm recover (#542) 2021-09-09 09:10:33 +00:00
module.go feat: store migration setup (#794) 2021-11-29 16:46:20 +01:00