[Bug]: Support for Solidity custom error is broken
Describe the bug
After the recent upgrade, the support for Solidity custom error is broken. Previously, it could return the function selector of the custom error that caused the transaction to be reverted when estimating gas/submitting the transaction.
Currently, if the transaction was reverted with a string reason, the error is like
"Failed to submit transaction: cannot estimate gas : [THE STRING ERROR REASON]."
However, for custom errors, the reason is no longer provided.
"Failed to submit transaction: cannot estimate gas."
Steps to reproduce
Call a transaction that will be reverted with Solidity custom errors.
Error messages or log output
{
"code": -32603,
"message": "Internal JSON-RPC error.",
"data": {
"code": 3,
"message": "Failed to submit transaction: cannot estimate gas",
"data": {
"code": 104,
"message": "cannot estimate gas"
}
}
}
Version
10.28.2
Build type
None
Browser
Chrome
Operating system
Windows
Hardware wallet
No response
Additional context
No response
Upon investigating the issue, it appears that the message itself comes from the RPC provider.
I cannot find any existing or previous code that attempts to extract selector of the error and attach it to the message part.
Do you know by any chance what RPC provider were you using when the error was being displayed with the selector?
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.
This issue was closed because there has been no follow up activity in the last 45 days. If you feel this was closed in error, please reopen and provide evidence on the latest release of the extension. Thank you for your contributions.
Closing as lego's PR was merged
@bschorchit Has it been confirmed fixed? I believe it may actually be properly fixed by yet-to-be-merged #11952.