Skip to content
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

Dust amounts cannot be undelegated, range shown from 0.000001 to scientific notation #3009

Closed
D-Nice opened this issue Oct 1, 2019 · 6 comments
Assignees
Labels
bug 🐛 issues related to unhandled errors in the code that need to be fixed

Comments

@D-Nice
Copy link

D-Nice commented Oct 1, 2019

Describe the bug

When you try to unstake from a validator, where there are dust amount of atoms, the transaction dialog fails to proceed, and will either

  • encounter an error at the fee calculation, showing NaN, in the case you used "Set Max" and have a ATOM balance greater than 1.
  • note a range error, denoting the "valid" range between 0.000001 and your delegated amount in scientific notation, however, no numeral between that range or below the scientific notation works.
  • Give a warning that the amount needs to be a numeral, if using "Set Max" when below either 1 atom or 0.000001 (likely the latter).

To Reproduce

Try to unstake from a validator, where you have some dust amount lingering, potentially due to slashing.

Expected behavior

To be able to click "Set Max" on undelegation, and have it undelegate everything from the delegator, so the delegator no longer shows up in the active portfolio list.

Screenshots
If "Set Max" is clicked with dust

photo4942940431059101850

If what should be a valid numeral is entered
photo4942940431059101851

Desktop (please complete the following information):

  • OS: Windows 8
  • Browser: Brave + Ledger
  • Version: Latest

Relevant issues: #2968 #1442

This PR had seen something similar: #912 (comment) and there was mention of a new issue being created to fix some of the bugs within that PR, but I do not see any mention within that PR of any subsequent issues being filed pertaining to it.

@D-Nice D-Nice changed the title Dust amounts unstakable, range shown from 0.000001 to scientific notation Dust amounts cannot be undelegated, range shown from 0.000001 to scientific notation Oct 1, 2019
@jbibla jbibla added the bug 🐛 issues related to unhandled errors in the code that need to be fixed label Oct 1, 2019
@faboweb
Copy link
Collaborator

faboweb commented Oct 2, 2019

Awesome find. Thanks we will take care quickly.

@stale
Copy link

stale bot commented Nov 11, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Nov 11, 2019
@jbibla
Copy link
Collaborator

jbibla commented Nov 11, 2019

let's resolve this! it's annoying. @faboweb what is the proposed solution?

@stale stale bot removed the stale label Nov 11, 2019
@mariopino
Copy link
Contributor

Related problem:

  1. Stake 1 STAKE
  2. Unstake 0,9999999 STAKE
  3. Click NEXT

image

Unstaking 0,999999 STAKE will calculate the fee correctly.

Seems that fee and total have problems to handle numbers with more than 6 decimals.

@mariopino
Copy link
Contributor

mariopino commented Dec 4, 2019

The proposed approach is to filter dust amount delegations in API (don't return them if the amount is smaller than 1e-6 or 0,000001).

Additionally we should validate that entered amounts have 6 max decimal places to be able to calculate transaction fee and total in a safe way.

@mariopino
Copy link
Contributor

@jbibla jbibla closed this as completed Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 issues related to unhandled errors in the code that need to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants