Open shunjizhan opened 1 year ago
Hello, @shunjizhan. Thanks for reporting! I will pass this on to the team.
thank you!
From the codebase I do see this feature disabled for optimism.
I think it's better to be "enabled only to certain networks", instead of current "enabled globally, but only disabled for specific networks".
Thank you for reporting and for your investigation into this. We'll investigate wether this buffer is still needed (it has been introduced very early on when estimations were less accurate) and if not needed, we'll communicate it and remove it across networks. If it's still needed, we'll research a permissionless way for networks to workaround/opt out of this feature.
Describe the bug
when I send erc20 with MM, it uses gasLimit which 50% greater than
eth_estimateGas
return. I did some grep around and it seems to be a "feature". https://github.com/MetaMask/metamask-extension/issues/8771#issuecomment-759243828However this become a bug in our evm network, where gasLimit has some specific encoding, so can't be altered randomly. I hope to make MM use exactly what
eth_estimateGas
return.This 50% increase is a very opinionated operation that's only required for networks that has the gas underestimation issue. So I think there should either be a way to turn it off (make it default behaviour, but optional), or force enable it ONLY for certain networks that really need it.
So my question is:
eth_estimateGas
return when sending erc20"Thanks!
Steps to reproduce
eth_estimateGas
returnsX
X * 1.5
as gasLimitError messages or log output
No response
Version
10.30.4
Build type
None
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
No response