You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
servroxsolutions
changed the title
eth_estimateGas not working with non-eoa addresses
eth_estimateGas not working with non-eoa sender addresses
Jun 16, 2023
Changing the code is not an option for us since we're currently migrating another project (Gnosis Safe) to Shimmer.
Just changing the implementation is no good solution since that would cause additional effort to all projects that already run on another chain and want to migrate to Shimmer. Furthermore, Safe is an open source project and you can't simply change the implementation in the official repository to make it work with another chain.
IMHO, for the Shimmer EVM to succeed it is necessary to run code that is already working on other EVM chains (e.g. Goerli) without any adjustments.
Describe the bug
The eth_estimateGas function is not working for transactions with non-eoa sender addresses.
To Reproduce
The following curl shows the behavior (the 'from' address is a smart contract address, not an eoa):
curl --request POST
--url https://json-rpc.evm.testnet.shimmer.network/
--header 'accept: application/json'
--header 'content-type: application/json'
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0x0E2373eCCAe5A5c898Fe0c6ECa1fd43730b1a4a3",
"to": "0xbe0eb53f46cd790cd13851d5eff43d12404d33e8"
},
"latest"
]
}
'
Response:
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"sender not an eoa: address 0x0E2373eCCAe5A5c898Fe0c6ECa1fd43730b1a4a3, codehash: 0x61a88b77169dae9e1b13117a7abdb1f3c2776e26abd1fae4f2ab88dad90080fa"}}
The same call succeeds in the goerli testnet (sender is also a contract address):
curl --request POST
--url https://eth-goerli.public.blastapi.io
--header 'accept: application/json'
--header 'content-type: application/json'
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0x4344bC938d54cb7cd36EcCd2015b90C3D78D5F67",
"to": "0xbe0eb53f46cd790cd13851d5eff43d12404d33e8"
},
"latest"
]
}
'
Response:
{"jsonrpc":"2.0","id":1,"result":"0x5208"}
Expected behavior
The shimmer rpc endpoint should also return a valid gas estimation.
Network and versioning
Additional context
This bug happened while migrating Gnosis Safe to the ShimmerEVM. The sender addresses are Gnosis safe contract addresses.
The text was updated successfully, but these errors were encountered: