Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

eth_getStorageAt fails with "parse error" #77

Closed
thomas-nguy opened this issue Jun 7, 2021 · 4 comments · Fixed by #355
Closed

eth_getStorageAt fails with "parse error" #77

thomas-nguy opened this issue Jun 7, 2021 · 4 comments · Fixed by #355
Labels
C:JSON-RPC JSON-RPC client

Comments

@thomas-nguy
Copy link
Contributor

System info:
MacOs

Steps to reproduce:

// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0x0f54f47bf9b8e317b214ccd6a7c3e38b893cd7f0", "0"  "latest"],"id":1}' -H "Content-Type: application/json" http://localhost:8545

Expected behavior:

// Result
{"jsonrpc":"2.0","id":1,"result":"0x0000000000000000000000000000000000000000000000000000000000000000"}

Actual behavior:

{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"parse error"}}

Additional info: [Include gist of relevant config, logs, etc.]

No log, probably the rpc handler is incorrect

@fedekunze fedekunze added C:JSON-RPC JSON-RPC client Type: Bug labels Jun 15, 2021
@fedekunze fedekunze changed the title RPC method "eth_getStorageAt" fails with "parse error" eth_getStorageAt fails with "parse error" Jun 15, 2021
@khoslaventures khoslaventures added this to the Milestone 1: Developer Usability and Testing milestone Jun 23, 2021
@crypto-facs
Copy link
Contributor

When passing a hex param that error is not seen anymore although the endpoint is not working correclty

-H "Content-Type: application/json" \
localhost:8545
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"rpc error: code = NotFound desc = rpc error: code = NotFound desc = contract code not found for given address: key not found"}}```

@fedekunze
Copy link
Contributor

maybe the account storage gets deleted whenever there's a new CreateAccount?

@crypto-facs
Copy link
Contributor

Yeah that could be one reason. I also see that the key / index param doesnt seem to be getting into the ABCI query. Saw that while debugging the application as well.

12:11PM INF ABCIQuery data=0A2A3078383530333230393633656539394541363335626636466237433444333435343130626645653434421242307833363038393461313362613161333231303636376338323834393264623938646361336532303736636333373335613932306133636135303564333832626263 module=rpc path=/ethermint.evm.v1alpha1.Query/Storage result={"code":22,"codespace":"sdk","height":"270","index":"0","info":"","key":null,"log":"rpc error: code = NotFound desc = contract code not found for given address: key not found","proofOps":null,"value":null} t=2021-07-21T12:11:07+0200 lvl=warn msg="Served eth_getStorageAt" conn=127.0.0.1:65304 reqid=0 t="386.368µs" err="rpc error: code = NotFound desc = rpc error: code = NotFound desc = contract code not found for given address: key not found"

@thomas-nguy
Copy link
Contributor Author

@crypto-facs lets close this issue and open a new one for your issue.

The parse error is just a mistake on my side when copy pasting the doc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C:JSON-RPC JSON-RPC client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants