-
Notifications
You must be signed in to change notification settings - Fork 929
Cannot reserve when (free balance) is lower than (frozen balance) #8099
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
Comments
@bkchr @kianenigma Is there anyone from parity that can have a look at this issue? |
Is In this graph:
This is for But this issue is talking about the reserve API, part of the That said the fungible API might suffer the same issue, but it looks easier to fix. |
The @gui1117, I think all |
Going back to the problem, it does not make sense that I can transfer a given balance amount to other account and not be able to use it for a new |
I see, I confirm the issue |
@gui1117 any updates? Thanks |
I took another look, |
Description
I am creating this issue to confirm if the behaviour reported below is a bug or not. If it is not a bug, the documentation should be updated with an example explaining it.
Recently, for moonbeam, we received a bug report where the user could not
add
a proxy, even though he had enoughusable balance
to pay for the deposit.Based on the documentation, the usable balance is computed with the following formula:
The problem:
If an account's
free balance
is lower thanfrozen balance
, no reserves will be allowed even though theusable balance
is enough to cover the reserve, resulting in the following errorLiquidityRestrictions
.Based on the documentation, this should not happen.
Visual example of how usable balance works:
Based on the account example below, the user should be able to
reserve
an amount of5
tokens.In my understanding, the function below is incorrect, and instead of checking that the new
free
balance is higher or equal to thefrozen
balance, it should make sure thatamount
is less or equal to theusable
balance.polkadot-sdk/substrate/frame/balances/src/impl_currency.rs
Lines 315 to 326 in f9fac6c
If it is confirmed to be a bug, I can work on the fix and open a pull request.
Suggested fix for function
ensure_can_withdraw
:Steps to reproduce
4.1. (But transferring the spendable balance works)
The text was updated successfully, but these errors were encountered: