EIP-1559 transactions are typed transactions (see EIP-2718), where the type for EIP-1559 transactions is specified as 0x02
. The payload of the EIP-1559 transactions consists of (as JSON):
{
"gas": "0x5208", // = gasLimit
"maxFeePerGas": "0xb2d05e00",
"maxPriorityFeePerGas": "0xb2d05e00",
"input": "0x", // = data
"nonce": "0xa",
"to": "0xc6d5a3c98ec9073b54fa0969957bd582e8d874bf",
"value": "0x0",
"accessList": [],
"chainId": "0x5"
}
Here is an example of the above EIP-1559 transaction on Etherscan (on Goerli): https://goerli.etherscan.io//tx/0xeb403182d4e2f2705d012e864ac5316c54ceddfc0ee583c730c918040520a75a
The raw transaction receipt of this transaction looks like this:
{
"blockHash": "0xee4df7e9d55b56162346fb779c074fe897bc6bb737051ab776a83a2b6f15962d",
"blockNumber": "0x4fef3c",
"contractAddress": null,
"cumulativeGasUsed": "0xa410",
"effectiveGasPrice": "0xb2d05e00",
"from": "0xc6d5a3c98ec9073b54fa0969957bd582e8d874bf",
"gasUsed": "0x5208",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0xc6d5a3c98ec9073b54fa0969957bd582e8d874bf",
"transactionHash": "0xeb403182d4e2f2705d012e864ac5316c54ceddfc0ee583c730c918040520a75a",
"transactionIndex": "0x1",
"type": "0x2"
}
Note that the type is not used as transaction payload itself, but rather specified as the EIP-2718 transaction type (where a transaction consists of TransactionType || TransactionPayload
).
The maxFeePerGas
is the total fee you are willing to pay per unit of gas. maxPriorityFeePerGas
(which is sent to the miner) is the total priority fee you are willing to pay, which should be lower than or equal to the maxFeePerGas
. How much you end up paying is gas × (baseFee + maxPriorityFeePerGas)
, assuming maxFeePerGas
is higher than the current base fee. The difference between the maxFeePerGas
and the actual used gas price is "refunded".
Legacy transactions will still work, but the gasPrice
of legacy transactions will be used as both the maxFeePerGas
and maxPriorityFeePerGas
, so you'll never end up getting a refund. The miner will always take the difference between the base fee and the max fee. To get the full benefit of EIP-1559 it's recommended to set both fields.
For more details on how the max fees should be estimated or how EIP-1559 can be implemented in general, I recommend you check out the EIP-1559 Cheatsheet for Implementers.
The base fee for a transaction is not the block base fee divided by the number of transactions in the block. Each transaction in the block has to pay at least the full base fee for that block, plus an optional tip (priority fee).
To send all Ether from an account, you have to use the same max fee and max priority fee, so that the full difference between the base fee and the max fee will be paid out to the miner as a tip.
For example, if you have 1 Ether in your account, the current base fee is 50 Gwei, and your transaction uses 21,000 gas, you can use a max fee and max priority fee of 60 Gwei (in case the base fee goes up) for a total transaction fee of 0.00126 Ether, and send the remaining 0.99874 Ether.
Best Answer
I don't think has changed much since EIP-1559.
As far as I've understood, transactions stay in the mempool as long as nodes decide to keep them there. Transactions with very low gas price get discarded quickly, since they are just considered as spam. But if the gas price is not super low, there is a chance it will get picked up in near future, so nodes may decide to keep it longer.
Nodes have internal buffers (basically databases) for storing mempool transactions. When that buffer starts to get full, they start to discard transactions, and probably they discard the ones with the lowest gas prices. So it all depends on how big buffers nodes have and what are the given gas prices.
There was a related post a few days ago: I set a 3 gwei for gas price. Now my transaction has been pending for 48+ hours now. But blocks aren't even full!