-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
A problem that the result return 0x frequently when using contract method with eth_call, such as decimals, balanceOf, and so on. #19186
Comments
anyone help me ? |
I actually ran into this last night independently. Digging in, I've come to believe that the problem is here: https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L749 When you make an RPC call to I want to look around and see if there are other issues related to this, but I may put together a pull request to try to address it. |
Digging deeper, DoCall() is not giving eth_call anything it can use to establish that an error occurred. |
I've made a PR that will cause the 5 second timeout to result in an error, rather than returning a null response. That's not a complete solution, as I think there ought to be room for people running a node to configure the timeout for eth_calls, but at least it won't yield incorrect results. |
I have changed default timeout value, but the request also return 0x0, and the response time only 500ms, so I think some wrong on other place... And I found traceTx cannot work in current master version, "execution timeout" was returned. |
I have the same problem, when the request is run over IPC the result is always as expected. When run over HTTP the response is (sometimes) invalid. An example (rinkeby):
The request in case you want to reply it:
|
It looks like there is a race condition in This method does roughly the following steps:
Deferred methods are relatively slow and sometimes the EVM is able to assemble the result before the context is cancelled and the caller gets the result. Sometimes the context is cancelled before the result is assembled causing the client to receive Two temporary workarounds are calling h.callWG.Wait() after h.handle[Batch|Msg] or switching the order of the lines:
in Don't know what the proper solution is to fix this. Maybe handle[Batch,Msg] should wait till either the callback is executed, or untill some kind of timeout, or untill the root ctx is cancelled before returning. If anyone can give advice what the proper solution would be I can try to create a PR. @fjl ping since git indicates that this was changed in 245f314 although I haven't fully looked into it, so I might be wrong. |
I have the same problem. I have two synchronous machines. The height is similar, but some of the results are different, like this. curl "192.168.1.104:8545" -X POST -H 'content-type: application/json' --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to": "0xffa93aacf49297d51e211817452839052fdfb961","data": "0x70a082310000000000000000000000006642f5281822026ebdf76c06ba062878d8b7b653"},"latest"],"id":1}' I'm confused. |
@qiongxiaoz - Can you add |
Did this bug have been fixed? |
@AusIV |
I experienced many of the problems mentioned in this thread. While there may be some other problem with geth that needs to be addressed, this should be checked if you are having some of the problems mentioned here. For all solc versions, in both geth and parity: So using Solidity 5.7, with geth in that Docker, I set the evmVersion with this:
see the following for full explanation: https://solidity.readthedocs.io/en/v0.5.8/using-the-compiler.html#setting-the-evm-version-to-target |
same issue here with latest geth: v1.8.27 |
Hi there,
I use postman tool to call RPC API:
to query the decimals for BNB contract 0xB8c77482e45F1F44dE1745F52C74426C631bDD52
{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0xB8c77482e45F1F44dE1745F52C74426C631bDD52", "data": "0x313ce567" }, "latest" ], "id": 1 }
The postman return:
{ "jsonrpc": "2.0", "id": 1, "result": "0x" }
or sometimes:
{ "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000012" }
I expect always return:
{ "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000012" }
Geth version:
1.9.0-unstable
OS & Version: Ubuntu
I don't know what is the root cause, please anyone can help me?
Thanks so much.
The text was updated successfully, but these errors were encountered: