You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in router we still do the balance check, but only check if the user spent at least the amount we calculate for the trade
we use reducible_balance with mode Preservation.Expendable which behaves differently when the system.account.providers of the user account changes
during this trade, the number of providers changes, increased by one, leading to a different behaviour for the balance check, namely an off-by-ED error
Fix would be to always use reducible_balance with Preservation.Preserve so the ED is always deducted from balances, resulting in consistent behaviour.
What happens is that the account of insufficient asset is killed, so the ED (1 HDX) is transferred back to the account. So our ensure_that_user_received_asset_out_at_most balance check fails, as the user have more balance with an ED.
Two solutions I can see:
check if the insufficient asset account is killed, so we can incorporate ED in the balance check
we discard the post balance checks. This might look easier first, but remember we added it back to prevent any issues like we had with stableswap a few weeks ago
Issue:
reducible_balance
with modePreservation.Expendable
which behaves differently when the system.account.providers of the user account changesFix would be to always use reducible_balance with Preservation.Preserve so the ED is always deducted from balances, resulting in consistent behaviour.
First we need to fix a bug in orml package: open-web3-stack/open-runtime-module-library#986
Cases on prod:
The text was updated successfully, but these errors were encountered: