Move away from auction to address extreme volatility in gas prices (among other compelling motivations).
baseFeePerGas: Comes from protocol via the previous block's header. Mandatory to pay this. This part of the fee gets burned (
maxPriorityFeePerGas: User sets; additional fee that goes directly to miner to prioritize the transaction.
maxFeePerGas: User sets; the max amount a user is willing to pay for the tx (combines
burned: tx.baseFeePerGas * gasUsed miner: tx.maxPriorityFeePerGas * gasUsed returned: tx.maxFeePerGas * gasUsed - (tx.baseFeePerGas + tx.maxPriorityFeePerGas) * gasUsed
gas_used = prev_block.gas_used gas_target = prev_block.gas_limit / 2 base_fee = prev_block.base_fee_per_gas def calc_base_fee(gas_used, gas_target, base_fee): first block? return 1000000000 gas_used == gas_target return gas_target gas_used > gas_target delta = gas_used - gas_target return base_fee + (base_fee * delta / gas_target / 8) gas_used < gas_target delta = gas_target - gas_used return base_fee + (base_fee * delta / gas_target / 8)
It is recommended that transactions with the same priority fee be sorted by time the transaction was received to protect the network from spamming attacks where the attacker throws a bunch of transactions into the pending pool in order to ensure that at least one lands in a favorable position. Miners should still prefer higher gas premium transactions over those with a lower gas premium, purely from a selfish mining perspective.