Understanding gas markets in the Molten Network
getMinimumGasPrice
method.
eth_estimateGas
RPC gives a value sufficient to cover the full transaction fee at the given L3 gas price; i.e., the value returned from eth_estimateGas
multiplied by the L3 gas price tells you how much total MOLTEN is required for the transaction to succeed. Note that this means that for a given operation, the value returned by eth_estimateGas
will change over time as the L2 calldata price fluctuates.
currentTime
is the current time, when the batch posting report message arrives at L3updateTime
is the time at which the reported batch was submitted (which will typically be around 20 minutes before currentTime
)lastUpdateTime
is the time at which the previous reported batch was submittedF = (updateTime-lastUpdateTime) / (currentTime-lastUpdateTime)
and allocates a fraction F
of funds in the L2PricerFundsPool to the current report. The pricer similarly allocates a portion of the total data units to the current report.
Now the pricer pays out the allocated funds to cover the rewards due and the amounts due to batch posters, reducing the balance due to each party as a result. If the allocated funds aren’t sufficient to cover everything that is due, some amount due will remain. If all of the amount due can be covered with the allocated funds, any remaining allocated funds are returned to the L2PricerFundsPool.