-
Notifications
You must be signed in to change notification settings - Fork 20.7k
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/api: eth_estimateGas broken for non-contract recipients #2577
Comments
The issue is that estimate gas uses the generic This check was added by @karalabe and assume that it was added for abigen / bindings code. Please elaborate on why this was added so it can be properly addressed when creating the PR to fix this regression. |
I'm not sure if this is a true regression or a change towards the behavior it should have had originally. This change was added by #2496. The rationale was that a lot of different error scenarios were mixed in under the same behavior:
In case of a call, in all of the above cases a native DApp only receives a parse failure from In the case of estimate, the issue is even worse because given that the contract doesn't exist, estimate plain returned 21000 gas (maybe a bit more if input data was also provided). This results is signing transactions that don't have enough gas and will surely go out of gas, taking the associated ether with it. |
I disagree. Doing a call should not result in an error if there was no error to be returned. You're abusing an error field to get an indication whether an execution of the EVM may or may not happen. If you require some indication whether code exists at an address check so in advance of the call and not depend on an error field.
Exactly. Use
Worse? Why would a call go out of gas when performed? The estimate call method's purpose is to estimate the gas, even for non-contract calls. This is a feature and this feature no longer works properly, therefor: regression. |
Additionally if the |
Hmmm, that's a possible interpretation too. In this light estimate is a bit more low level than I'd like, though it could still be made to work a bit higher up with getCode. Though it would need some love to prevent wasting tons of calls constantly verifying code availability. I'll look into fixing this. |
I have coded fonction for payout all user . For me is big regression, i can not payout my users . |
System information
Geth version:
1.4.1
and upwardOS & Version: Windows/Linux/OSX
Expected behaviour
When doing an
eth_estimateCall
to non-contracts I expect it to return the amount of gas required to do the call.Actual behaviour
When doing an
eth_estimateCall
to a non-contract it returns an error telling me that there's no code at the given address (which is true).Steps to reproduce the behaviour
The text was updated successfully, but these errors were encountered: