-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[Light client] NotEnoughBaseGas for RPC without specifying any Gas. #9031
Comments
couldn't reproduce on Kovan and Mainnet on v2.0.1 |
I could reproduce with Parity Ethereum curl --data '{"method":"eth_estimateGas","params":[{"value":"0x0","data":"0x","from":"0x00dfc93112abd2578503b667b95491b101281f2b"}],"id":"c31e5d5f401bea24cf8b40340f532cee","jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{"jsonrpc":"2.0","error":{"code":-32015,"message":"Transaction execution error.","data":"NotEnoughBaseGas { required: 53000, got: 50000 }"},"id":"c31e5d5f401bea24cf8b40340f532cee"} The node with 2018-10-22 20:27:28 TRACE rpc Request: {"method":"eth_estimateGas","params":[{"value":"0x0","data":"0x","from":"0x00dfc93112abd2578503b667b95491b101281f2b"}],"id":"c31e5d5f401bea24cf8b40340f532cee","jsonrpc":"2.0"}.
2018-10-22 20:27:28 DEBUG rpc [Some(Str("c31e5d5f401bea24cf8b40340f532cee"))] Took 231ms
2018-10-22 20:27:28 DEBUG rpc Response: {"jsonrpc":"2.0","error":{"code":-32015,"message":"Transaction execution error.","data":"NotEnoughBaseGas { required: 53000, got: 50000 }"},"id":"c31e5d5f401bea24cf8b40340f532cee"}. |
Yeah, basically we have it hardcoded But, I don't really understand the reason behind it to be honest according to my calculations it should be as follows:
-> The /cc @rphmeier can you confirm if this seems reasonable to you or if I'm wrong?! Thanks |
@niklasad1 I also think it would be a good idea to put the initial gas price a bit up if there is like average operation cost being just a bit higher in most common use case scenario (I am not sure of this value). But there is probably another thing. This code is related to #6155 , from my understanding before #9591 , the gas calculation/estimation for a transaction was running through multiple iterative call to target the right amount (recursive call of the fn and retry with gas * 2 on every failure). I fear that by making the on demand Execute call virtual, this part of the code broke (since it is virtual we no longer have outofgas errors). I am not sure of what should be done, there should be a reason explaining why we went to such costly gas estimation strategy at the time. But I do not really imagine why we couldn't directly use the gas value returned by the virtual execution (maybe with an additional fixed margin) Maybe the issue with this approach is that it does not conform to LES execute (maybe this call should fail when there is not enough gas and we should revert to not running virtual for it). It would mean that this not so good looking gas calculation is here because of the specs. In this case putting the initial value a bit higher would probably be a good idea. But I would rather keep execution virtual and use the gas returned value. |
Thanks, for clarifying those are excellent points and I think you are right. I want to keep these executions What about the handling |
Edit:
I could reproduce with Parity Ethereum
--light
v2.1.3 this call on Kovan and mainner:The node with
rpc
logging:I get the error
NotEnoughBaseGas
when calling:a workaround is to specify the gas, but the default one should be higher.
The text was updated successfully, but these errors were encountered: