laconicd-deprecated/x/feemarket/spec/09_antehandlers.md
Loredana Cirstea 046cd00174
feemarket: global MinGasPrice parameter (#1104)
* Add min_gas_price to feemarket params

* Add MinGasPriceDecorators

* feemarket integration tests for MinGasPrice

* Restructure integration tests

* Simplify integration tests context

We use DeliverTx context to set up the app, otherwise not all settings are initialized.
We test CheckTx with `s.app.BaseApp.CheckTx(req)`, which uses the `CheckTx` mode and context.

* Update MinGasPrice spec in feemarket module

* reorder ethermint module order for initializing genesis

* feemarket migrations for adding MinGasPrice param

* update changelog

* Additional unit tests for MinGasPrice = 0, tx gas price > 0 (PR review)

https://github.com/tharsis/ethermint/pull/1104#discussion_r884991661

* Use 0 MinGasPrice for transaction simulations

* Fix duplicate registration of feemarket GenesisState and Params (PR review)

https://github.com/tharsis/ethermint/pull/1104#issuecomment-1141893712
2022-05-31 18:28:46 +02:00

26 lines
1.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
order: 5
-->
# AnteHandlers
The `x/feemarket` module provides `AnteDecorator`s that are recursively chained together into a single [`Antehandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-alpha1/docs/architecture/adr-010-modular-antehandler.md). These decorators perform basic validity checks on an Ethereum or Cosmos SDK transaction, such that it could be thrown out of the transaction Mempool.
Note that the `AnteHandler` is run for every transaction and called on both `CheckTx` and `DeliverTx`.
## Decorators
### `MinGasPriceDecorator`
Rejects Cosmos SDK transactions with transaction fees lower than `MinGasPrice * GasLimit`.
### `EthMinGasPriceDecorator`
Rejects EVM transactions with transactions fees lower than `MinGasPrice * GasLimit`.
- For `LegacyTx` and `AccessListTx`, the `GasPrice * GasLimit` is used.
- For EIP-1559 (*aka.* `DynamicFeeTx`), the `EffectivePrice * GasLimit` is used.
::: tip
**Note**: For dynamic transactions, if the `feemarket` formula results in a `BaseFee` that lowers `EffectivePrice < MinGasPrices`, the users must increase the `GasTipCap` (priority fee) until `EffectivePrice > MinGasPrices`. Transactions with `MinGasPrices * GasLimit < transaction fee < EffectiveFee` are rejected by the `feemarket` `AnteHandle`.
:::