Gas Fees
In Lumia L2, the gas fee is calculated by applying a fixed factor over the L1 gas fee. This price factor is a fixed value that doesn't change often, and its value is based on the rollup's cost to publish transactions to L1. In simple terms, gas prices in L2 will linearly follow gas prices in L1.
The formula for calculating the L2 gas fee is as follows:
where:
𝐿2{𝑔𝑎𝑠_𝑓𝑒𝑒} represents the gas fee on Lumia L2
𝐿1{𝑔𝑎𝑠_𝑓𝑒𝑒} represents the gas fee on the Ethereum L1
𝐹𝑎𝑐𝑡𝑜𝑟 is the fixed value that determines the relationship between L1 and L2 gas fees
The L1 fee will vary depending on the number of transactions on the L1 network. If the timing of your transaction is flexible, you can save costs by submitting transactions during periods of lower gas on the L1 (for example, over the weekend).
In the future, Lumia L2 plans to support a congestion mechanism based on EIP-1559, which will make the L2 gas fee dynamic and more responsive to network conditions.
Fetching Gas Price from Lumia L2 RPC Node
To fetch the current gas price on Lumia L2, you can make the following RPC call to the Lumia L2 Sequencer:
The result of this RPC call will be the hex value of the gas price in wei.
By understanding the relationship between L1 and L2 gas fees and utilizing the provided RPC call, developers and users can make informed decisions about transaction costs and optimize their interactions with the Lumia L2 network.
Last updated