-
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
[Bug]: Unexpected gas prices behaviour when one of multiple gas prices is zero #17755
Comments
Zero coins aren't valid. |
I understand, thanks. I just want to point out that as a user this was unexpected behaviour. I can also imagine that there is not a lot of use-cases for setting one of the gas prices to zero. |
Can I ask why you think this is unexpected behavior? If I proceed, for example, to use a mobile money transfer app, and that app requires a fee to use their service, the app wouldn't say "give us zero or more of this". It would either be free or it wouldn't. Similarly, it doesn't make sense to have "zero" of something. You either have it or you don't. In the context of fees, your use case is totally valid, but that's just not the expression you'd use to describe it. Instead, what you'd say is just |
Yeah I guess this can be handled from the application side, perhaps by overriding the |
Is there an existing issue for this?
What happened?
The SDK lets us specify multiple gas prices, to give users the option to pay in one gas price or another. If one of multiple gas prices is set to zero, the assumption here is that the same reasoning applies, and the user will be able to either pay zero in the zeroed gas price, or a non-zero in any of the other gas prices.
For example:
0.025uatom,0uxyz
- I expect to be able to pay zerouxyz
or a non-zero amount ofuatom
.What ends up happening because of the way that the gas price is parsed is that the zero coin gets removed by the sanitization applied by
ParseDecCoins
. This leaves us with just the non-zero token, and thus no option to not pay a fee.Cosmos SDK Version
main
How to reproduce?
Set gas prices to any two unique tokens, one of which is zero.
The text was updated successfully, but these errors were encountered: