-
Notifications
You must be signed in to change notification settings - Fork 3.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
Zero gas transactions cause incorrect error #10177
Comments
Thanks for the issue @mvid! You're submitting a tx with no gas, and the node may require a min gas price, so this error seems like the expected behavior to me. What is the expected solution you're thinking of? |
Thanks @AmauryM. I believe that the transaction should fail, but the error message isn't correct. Most obvious is that the error says you have more than the required fee but that is insufficient, which doesn't make sense. Perhaps the transaction should fail before the gas gets multiplied by the gas limit? |
Ah understood. One possible solution could be to just simply require a non-zero GasLimit, e.g. in the Tx.ValidateBasic, which will throw a more human-friendly error before that error. What do you think @mvid ? |
@AmauryM we would like the ability to run 0 fee networks. This path would eliminate that. |
No I dont think so. If the node's minGasPrice is 0, you can still send a tx with 0 fee amount. I'm just saying that maybe gas_limit could be non-zero. |
@AmauryM is correct here. GasLimit should always be positive. We should just enforce this in the ante-handler IMO. Quick fix. Chains that don't want to enforce positive GasLimit can just use their own decorator. |
What would be a case for having a zero |
I will have a look into this issue and try to solve it. |
@alexanderbez am I correct that your PR #12416 closes this issue? |
Woaa didn't even know this existed! Yes, closing :) |
Summary of Bug
When submitting a tx without the gas value set, the AnteHandle function incorrectly multiplies the gas limit by the gas fee, resulting in an error message like this:
insufficient fees; got: 10testunit required: 0testunit: insufficient fee
Codespace: sdk
Version
0.44
Steps to Reproduce
Submit a transaction to a network without calling the WithGas function in the tx factory. The incorrect error should be observable in the logs, or in the response if trace is true.
For Admin Use
The text was updated successfully, but these errors were encountered: