Skip to content
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

eth_estimateGas not working with non-eoa sender addresses #2609

Closed
servroxsolutions opened this issue Jun 16, 2023 · 2 comments · Fixed by #2814
Closed

eth_estimateGas not working with non-eoa sender addresses #2609

servroxsolutions opened this issue Jun 16, 2023 · 2 comments · Fixed by #2814
Assignees
Labels
bug Something isn't working

Comments

@servroxsolutions
Copy link

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

  • Type of L1 network: Shimmer Testnet
  • Type of Wasp chain: ShimmerEVM Testnet
  • Interaction method: JSON/RPC HTTP
  • Interaction software: curl
  • Version of Wasp: v0.6.1-alpha.17

Additional context
This bug happened while migrating Gnosis Safe to the ShimmerEVM. The sender addresses are Gnosis safe contract addresses.

@servroxsolutions servroxsolutions added the bug Something isn't working label Jun 16, 2023
@servroxsolutions servroxsolutions changed the title eth_estimateGas not working with non-eoa addresses eth_estimateGas not working with non-eoa sender addresses Jun 16, 2023
@luke-thorne luke-thorne self-assigned this Jul 25, 2023
@eGarciaR
Copy link

Hey @servroxsolutions, check if this could be the reason of your error too. Changing low-level calls to interfaces solved the issue for us: #2740

@servroxsolutions
Copy link
Author

Thanks for the answer.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants