-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Network Gas Limit Estimation #5164
Comments
As we are in the era of booming new chains, this capability is crucial for Metamask's adaptability to
|
Hey @kevinnguyen17, thank you for your report. We're currently looking it optimizing our buffering indeed. Could you share more why users need to manually adjust gas limit on every transaction? Is it because with the buffer, the fee exceeds their funds and they have to manually reduce it? |
@bschorchit hello i think the question was directed to me. Similar to ethereum, rpc’s estimate gas and return the amount or gas that the function took to execute, but different computers with different strength of computers or variation of specs may estimate gas differently because of the different node implementations. So its typically recommended to add a little bit of buffer to the gas estimation to guarantee that there is enough gas limit and that the execution does not get reverted. This buffer removes the risk of variation of local estimations by different nodes. Like it can be seen in the function supported network all add a 35% more gas to the estimation returned by the rpc to guarantee that the transaction is successful, but custom network do not add this 35% buffer, because of this the user will experience alot of reverted transactions, so it forces users to add more gas limit everytime they send a transaction manually which is about 3-5 additional clicks. So the proposal is to allow custom networks to configure if they want to add a buffer to the estimation like the officially supported network which is the recommended practice. |
I also wanted to add that if you don’t adjust the estimation and the transaction gets reverted, the fee is still paid by the user even if the transaction is failed which makes the user waste some native currency. (Ex: ETH, BNB, MATIC, which is used to pay for gas fees) Even though buffering may require a bigger native balance (35% more) its better than wasting native token on a reverted transaction, this is especially true for layer 1’s which have higher transaction fees.
Other discussions:
|
Dear MetaMask Team,
I noticed the function getGas:
I appreciate the use of gas buffering in this function as it helps improve the chances of transaction acceptance. However, I noticed that when adding a custom network, there is currently no option to configure a gas buffer or even apply one to the gas limit. This creates challenges for platforms that integrate with MetaMask but don’t estimate gas or add a buffer before sending transactions to the extension. As a result, many integrations fail, leading to a suboptimal user experience.
I believe it would significantly enhance usability if MetaMask allowed users to configure gas buffering as part of the custom network setup. This could be either:
A toggle to enable gas buffering for a specific network in the network setup.
An option in the advanced network settings to apply a configurable buffer multiplier.
I understand that some networks already buffer gas during the estimateGas RPC call, and the behavior can vary between networks. However, enabling this feature at the user or network level would reduce the need for manual gas limit adjustments, saving users 2-3 extra clicks every time they edit the gas limit for transactions, also it can be disabled by default.
I hope you find this feedback constructive and consider introducing these options to further improve the user experience.
Thank you for your time and effort in building an amazing platform. I look forward to seeing how MetaMask continues to evolve!
The text was updated successfully, but these errors were encountered: