# zkEVM gas fee feedback & proposal ## L2 gas fee calculation comparison For Polygon zkEVM, there are multiple cases depending on configuration: - With `follower` mode and enabled *effective gas price*, the gas fee is `min(Effective gas price, L2 gas price * L2 gas used)`. Polygon zkEVM mainnet is using this approach. - With `follower` mode and disabled *effective gas price*, the gas fee is `L2 gas price * L2 gas used`. Astar zkEVM would take this approach for testnet. For Optimism, the gas calculation formula is: `[ Fee Scalar * L1 Gas Price * (Calldata + Fixed Overhead) ] + [ L2 Gas Price * L2 Gas Used ]`, which is basically `L1 fee + L2 fee`. - Source: [Transaction fees on OP Mainnet](https://community.optimism.io/docs/developers/build/transaction-fees/#) Arbitrium uses a similar way to Optimism. ## ETH token transfer example Based on tx in live networks: - Ethereum - Total fee: `21,000 * 0.000000008994950479 = 0.000188893960059` ETH. ~$0.3 - Polygon zkEVM - Total fee: `21,000 * 0.000000000339 = 0.000007119` ETH. ~ $0.01 - OP - Total fee: L1 fee + L2 fee = `0.00001210457` ETH. ~ $0.02 - L2 fee `0.000000000127761327 * 21,000 = 0.00000268298` ETH - L2 gas used `21,000` - L2 gas price `0.1278` Gwei - L1 fee `0.000000006778659621 * 1,389.89 = 0.00000942159` ETH - L1 gas used `1,389.89` - L1 gas price `6**.**778659621` Gwei - L1 fee is `3.51x` to L2 fee ## The problem with the current zkEVM gas fee model With current gas fee config options, there is no way to include both L1 fee and L2 fee in the total gas fee. As DA cost makes ~80% of the total cost (according to Polygon's [tweet](https://twitter.com/0xPolygonLabs/status/1660757699733200900?s=20)), it's important to include L1 cost in the gas fee to reflect the real cost. This would help with gas modeling and parameter setting for teams to reach the goal of break-even or profit. As the used gas of transactions doesn't have a strong correlation with tx data size, with the current `L2 gas fee * L2 gas used` formula, the gas fee could deviate a lot from the real cost. ## Solution proposal It would be helpful to introduce another option of the gas fee model similar to Optimism, to include both L1 fee and L2 fee. In addition to reflecting total cost, this gas model can offer more space for how L2 fees are determined. For instance, to not follow L1 gas price, but use a dynamic fee mechanism based on L2 block fullness. Another thing worth mentioning is that Optimism has a [gas oracle](https://optimistic.etherscan.io/address/0x420000000000000000000000000000000000000f#readProxyContract) contract that helps to estimate the total gas fee of a given tx.