Every OP Mainnet transaction has two costs: An L2 (execution) fee and an L1 (security) fee. At a high level, the L2 fee is the cost to execute your transaction in L2 and the L1 fee is the estimated cost to publish your transaction on L1 (in a rollup batch). In contrast to the L1 data price, which is deducted automatically, you can control the parameters for the L2 execution price in the wallet when you submit a transaction.
This price is calculated as (base fee + priority fee)*gas used.
- Base fee. This fee is set to a specific value for all the transactions on a block, so there is no cost of specifying a higher value as acceptable. Transactions with a base fee that is lower than the block base fee and not included in the block.
- Priority fee. This fee is specified by each transaction in the block. Usually, transactions are arranged by priority fee, with the higher priority fee ones being first in the block and the lower priority fee ones being later. If the block gas limit is exceeded, transactions with a lower priority fee don't get included in the block.
- Gas used. This is just the gas used by the transaction.
What fee level to set?
OP Mainnet uses EIP 1559, but with different parameter values. As a result, in every block the base fee can be between 98% and 110% of the previous value. As blocks are produced every two seconds, the base fee can be between 54% and 1,745% of the value a minute earlier.
The base fee you specify in the wallet is not necessarily the base fee you pay, it is an upper limit to the base fee you are willing to pay. It does not hurt you to specify a significantly higher value than the current one, and it might make it possible to include your transaction.
The priority fee, on the other hand, depends on users' choices and you pay all of it. So it makes sense to look in the dashboard and specify a value based on what was in recent transactions.
How do I modify the default gas price?
The exact mechanism to do that depends on your wallet. Here is how you would do it in MetaMask:
- Create the transaction normally.
- When you get to the reject or confirm wallet popup, there is an icon to specify gas price. In MetaMask it is Market.
- Typically you get multiple automatically filled options, and an advanced option where you set the values yourself. Click Advanced.
- Specify a max base fee (0.001 gwei is typically a good choice, because it is extremely rare for the block base fee to get that high) and a priority fee and click Save.
- Click Confirm to send the transaction as you would normally.