laconicd/types
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
..
account_test.go evm: change Hook to use tx Receipt (#849) 2022-01-03 17:18:13 +01:00
account.go types, evm: refactor accounts (#884) 2022-01-05 19:18:02 +01:00
account.pb.go proto: v1alpha to v1 (#448) 2021-08-17 15:30:35 +00:00
benchmark_test.go all: add benchmarks to core components (#493) 2021-08-26 08:20:27 +00:00
block.go evm, rpc: fix parameters and block gas limit in getBlockByHeight and getBlockByHash (#312) 2021-07-19 01:52:44 +00:00
chain_id_test.go feat: update chain-id format (#447) 2021-08-17 14:11:26 +00:00
chain_id.go feat: update chain-id format (#447) 2021-08-17 14:11:26 +00:00
codec.go proto: v1alpha to v1 (#448) 2021-08-17 15:30:35 +00:00
coin.go rpc: fix gas price (#568) 2021-09-17 23:47:13 +00:00
errors.go evm: refactor state transition (#41) 2021-06-02 04:52:53 -04:00
gasmeter.go fix: GasMeter reset in AnteHandler EthGasConsumeDecorator (#964) 2022-03-06 15:09:28 +01:00
hdpath.go feat: import ethermint without forking (#378) 2021-07-28 05:47:29 -04:00
protocol.go rpc: protocol version (#575) 2020-12-08 20:51:26 +01:00
validation_test.go evm: check height overflow (#597) 2021-09-28 09:48:11 +00:00
validation.go evm: check height overflow (#597) 2021-09-28 09:48:11 +00:00
web3.pb.go evm: EIP1559 & go-ethereum related updates (#469) 2021-08-25 14:45:51 +00:00