-
Notifications
You must be signed in to change notification settings - Fork 1.7k
eth_call some contract stuck and high CPU #8904
Comments
I don't think that your call is valid, you should pad the function signature to the left to 32 bytes. Just tested a random call:
Result:
|
I try to test whether the contract will respond to some method, all other contracts work as expected only the one I posted stuck. I tried to pad the function signature to 32 bytes, the bug still exists.
|
Could you describe which function you want to call? |
The signature 95d89b41 is ERC20 symbol function, I want to know whether the contract is a valid ERC20 contract with all information. The contract which causes the bug is 0x532975d56cf18f597480e2521246b273ad9ae348 |
I have difficulties to follow you. There is no |
It's not in the standard, but it's how most ERC20 tokens are using it. Almost all ERC20 tokens have a symbol function. Anyway, no matter what the function is, parity should not stuck and consume high CPU. Is parity expected to stuck whenever people call a function not exist in a contract? Isn't it a bug? |
I agree. It's reproducible on 1.11.3 also with |
Can you check whether this is |
@debris had ideas regarding this as it might be related to the way we call functions in the EVM with unlimited gas. |
I don't have geth, but I have called this function to the etherscan API, it
works
…On Thu, Jun 21, 2018, 19:16 Thibaut S ***@***.***> wrote:
@debris <https://github.com/debris> had ideas regarding this as it might
be related to the way we call functions in the EVN with unlimited gas.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8904 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACKgNgPlFlp-dnZyWqaer9ix3YJS_DXHks5t-3J6gaJpZM4Uo1al>
.
|
It does work on Etherscan but doesn't return the appropriate result. Just returns "0x" because the contract runs out of gas. Currently in parity we have effectively unlimited gas for local calls, so if your contract is stuck on some loop it will keep looping "forever" (or just a really long time). I've capped the gas limit to make sure this doesn't happen (#8943). In the meantime you can enforce a gas limit yourself when doing the request:
|
Yes, the gas limit fixes the problem |
Before filing a new issue, please provide the following information.
Your issue description goes here below. Try to include actual vs. expected behavior and steps to reproduce the issue.
curl --data '{"method":"eth_call","params":[{"data":"0x95d89b41","to":"0x532975d56cf18f597480e2521246b273ad9ae348"}],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST http://localhost:8545
This will cause the parity CPU high and never respond. If I run this a few times, the parity won't accept any new RPC calls, I have to restart it.
The text was updated successfully, but these errors were encountered: