laconicd-deprecated/x/feemarket/spec/01_concepts.md
Thomas Nguy a2c26208ed
docs: add spec for feemarket module (#889)
* add spec for feemarket

* update spec from comments

* update spec

* update abstract

* update with grpc query

* add more content for tip section

* update specs with latest behavior

* cleanup unused store prefix

* Update x/feemarket/spec/01_concepts.md

* Apply suggestions from code review

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2022-02-25 12:49:18 +00:00

1.4 KiB

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