I understand how to estimate gas cost for L2s like Arbitrum and Optimism because their documents provide some details, e.g. total gas cost = L1 poster fee + L2 network fee. But I really cannot find documents about how gas cost is calculated / estimated in polygon zk evm. Does it also have 2 components L1 fee and L2 fee? or it's fully EVM-compatible that it's just tx.gasprice * gas usad.
1 Answer
In Polygon zkEVM the gas fee is calculated by applying a fixed factor over L1 gas fee. That price factor is a fixed value and doesn't change often and it's value is based the rollup's cost to publish tx to L1. To simply put, gas prices in L2 will linearly follow gas prices in L1.
L2fee = L1fee * Factor
Polygon zkEVM (and all chains supporting Polygon CDK) do not support EIP1559 yet (Dec 2023).
Read more about fees in Astar zkEVM docs (Built on Polygon CDK).
-
really appreciate your answer. do you happen to know how other L2s like zksync, Scroll, Metis do this?– FelixCommented Dec 5, 2023 at 16:53
-
-