Introduction
Celo uses a gas market based on EIP-1559. The protocol establishes a gas price minimum that applies to all transactions regardless of which validator processes them. In the Celo protocol, the gas price minimum for the next block is calculated based on the current block. Every transaction is required to pay for gas at or above the gas price minimum to be processed. The required portion of the gas fee, known as the base, is set as base = gas_price_minimum * gas_used
.
Why do I get the null gas price?
Sometimes when you fetch transaction details via API, such as eth_getTransactionByHash
or eth_getTransactionReceipt
, from a full node that's not an archive node, the gas price is unable to be calculated for transactions older than approximately 5 minutes.
This discrepancy arises because the implementation of the EIP-1559 in Celo is based on having the base fee on-chain in the state of the gasPriceMinimum contract. When fetching transaction details, the base fee from the state for the actual block number is used to calculate the gas price. Full nodes maintain the state of the last 64 blocks, which covers the last 5 minutes of transactions. The node cannot calculate the gas price if the transaction is older than that because it lacks the necessary base fee data.
Ethereum does not keep the base fee on-chain but in the block header, which can calculate the gas price without retrieving state data. Celo chose the current approach due to multiple base fees, which is not sustainable to have everything in the header.
How is Celo planning to address this issue?
Celo is aware of this issue and plans to add the base fee to the block header in the following protocol update. This change is expected to take several months to implement and should alleviate this issue.
Comments
0 comments
Article is closed for comments.