Skip to content

Bug: balance check in router fails when providers of account changes during the trade #797

Closed
@dmoka

Description

@dmoka

Issue:

  • 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.

First we need to fix a bug in orml package: open-web3-stack/open-runtime-module-library#986

Cases on prod:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions