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

Geth v1.5.4 JSON RPC behaving incorrectly #3367

Closed
vogelito opened this issue Nov 28, 2016 · 7 comments
Closed

Geth v1.5.4 JSON RPC behaving incorrectly #3367

vogelito opened this issue Nov 28, 2016 · 7 comments

Comments

@vogelito
Copy link

System information

Geth version: geth version

Geth
Version: 1.5.4-stable
Git Commit: b70acf3c5bd335d8dedc2a5aa6eff05c4c32105e
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.7
OS: linux
GOPATH=
GOROOT=/usr/local/go

OS & Version: Linux version 3.13.0-74-generic (buildd@lcy01-07) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015

Expected behaviour

I'm sending the following to geth via the JSONRPC
{"jsonrpc":"2.0","method":"eth_getBalance","params":["29d5527caa78f1946a409fa6acaf14a0a4a0274b","latest"],"id":1}

It comes back with:
{"jsonrpc":"2.0","id":1,"result":"0x295ff8"}

It should either error out (i'm not prefixing the address with "0x") or give the correct response. on v1.5.3 the response is:
{"jsonrpc":"2.0","id":1,"result":"0x50c60ae896b3c90000"}

At the time of writing, that address had 1,490.01 Ether in it.

Actual behaviour

The response is neither an error nor the correct amount.

Steps to reproduce the behaviour

Simply send the command above to the json rpc

Backtrace

none

@obscuren
Copy link
Contributor

Already responded on Skype. The params missed 0x prefix for the hex.

@obscuren
Copy link
Contributor

obscuren commented Nov 28, 2016

Additionally it does respond with 0x missing prefix as error: {"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"missing 0x prefix for hex data"}}

@vogelito
Copy link
Author

Thanks @obscuren I can't reproduce the getting the missing 0x prefix error, which is why I reported it here.

@fjl
Copy link
Contributor

fjl commented Nov 28, 2016

~/d/e/s/g/e/go-ethereum >> curl -X POST http://127.0.0.1:8545 -d '{"jsonrpc":"2.0","method":"web3_clientVersion", "id":1}'
{"jsonrpc":"2.0","id":1,"result":"Geth/v1.5.4-stable-b70acf3c/darwin/go1.7.3"}
~/d/e/s/g/e/go-ethereum >> curl -X POST http://127.0.0.1:8545 -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["29d5527caa78f1946a409fa6acaf14a0a4a0274b","latest"],"id":1}'
{"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"missing 0x prefix for hex data"}}

@vogelito
Copy link
Author

I will close this because I can no longer reproduce the behavior I posted above. I have no idea how or why this was happening

@Bost
Copy link

Bost commented May 16, 2017

The bug is reproducible indeed. I try to follow the article https://goo.gl/0PdBtF and get this bug every time.
Unfortunately the code (in clojure/clojurescript) presented in that that article has some other bugs, too.
And it depends on some slightly out-dated 3th party libraries.
So if by any chance you know some clojure/clojurescript you might want to use the (partially fixed) code from my forks:
https://github.com/Bost/clojurescript-ethereum-example.git
https://github.com/Bost/re-frame-web3-fx.git
https://github.com/Bost/cljs-web3.git

@Bost
Copy link

Bost commented May 16, 2017

Just to clarify: the 1.5.5 is not affected by this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants