What is the definition of max priority fee and max gas fee in EIP-1559 enabled Ethereum?
First, there is a
Base Fee which is the minimum fee a transaction must pay to be a valid transaction. The Base Fee changes per block, depending on how full the previous block is. The Base Fee is burned so the block producer (miner/validator) does not receive any of it.
Priority Fee is what a transaction would pay a block producer when the transaction is included in a block. The
Max Priority Fee is a maximum because the block producer may be paid less. One way this can happen is by specifying a
Max Gas Fee (a.k.a. Max Fee Per Gas), which is the total fee a transaction is willing to pay.
For example, if a transaction specifies
Max Gas Fee = 9 and
Max Priority Fee = 3, if
Base Fee = 8, then
1 would be paid to the block producer (Max Gas Fee - Base Fee), and
8 would be burned (Base Fee). Such a transaction is only valid in a block whose Base Fee reaches 9 or less.
All the fees are per unit of gas, as EIP-1559 specifies:
This is from blocknative's article on EIP1559 gas fees.
The Base Fee, which is determined by the network itself. And is subsequently burned. A Max Priority Fee, which is optional, determined by the user, and is paid directly to miners. The Max Fee Per Gas, which is the absolute maximum you are willing to pay per unit of gas to get your transaction included in a block. For brevity and clarity, we will refer to this as the Max Fee.
You can read more in the link to the full article below