laconicd-deprecated/x/feemarket/spec/01_concepts.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

39 lines
2.1 KiB
Markdown

<!--
order: 1
-->
# Concepts
## Base fee
The base fee is a global base fee defined at the consensus level. It is adjusted for each block based on the total gas used in the previous block and gas target (block gas limit divided by elasticity multiplier)
- it increases when blocks are above the gas target
- it decreases when blocks are below the gas target
Unlike the Cosmos SDK local `minimal-gas-prices`, this value is stored as a module parameter which provides a reliable value for validators to agree upon.
## Tip
In EIP-1559, the `tip` is a value that can be added to the `baseFee` in order to incentive transaction prioritization.
The transaction fee in Ethereum is calculated using the following the formula :
`transaction fee = (baseFee + tip) * gas units (limit)`
In Cosmos SDK there is no notion of prioritization, thus the tip for an EIP-1559 transaction in Ethermint should be zero (`MaxPriorityFeePerGas` JSON-RPC endpoint returns `0`)
## EIP-1559
A transaction pricing mechanism introduced in Ethereum that includes fixed-per-block network fee that is burned and dynamically expands/contracts block sizes to deal with transient congestion.
Transactions specify a maximum fee per gas they are willing to pay total (aka: max fee), which covers both the priority fee and the block's network fee per gas (aka: base fee)
Reference: [EIP1559](https://eips.ethereum.org/EIPS/eip-1559)
## Global Minimum Gas Price
The minimum gas price needed for transactions to be processed. It applies to both Cosmos and EVM transactions. Governance can change this `feemarket` module parameter value. If the effective gas price or the minimum gas price is lower than the global `MinGasPrice` (`min-gas-price (local) < MinGasPrice (global) OR EffectiveGasPrice < MinGasPrice`), then `MinGasPrice` is used as a lower bound. If transactions are rejected due to having a gas price lower than `MinGasPrice`, users need to resend the transactions with a gas price higher than `MinGasPrice`. In the case of EIP-1559 (dynamic fee transactions), users must increase the priority fee for their transactions to be valid.