BitCannaGlobal / bcna

BitCanna Blockchain based on Cosmos SDK
https://www.bitcanna.io
Apache License 2.0
51 stars 81 forks source link

Undelegate "invalid shares amount" problem #317

Open atmoner opened 8 months ago

atmoner commented 8 months ago

When i try to undelegate the max, the sdk tells me that the amount is too small and yet, it is the exact amount to be delegated...

Example config My address: bcna13jawsn574rf3f0u5rhu7e8n6sayx5gkwgusz73 Validator delegated: bcnavaloper1xkv494sduqkpadwesqlsp6069yepsj58haejfv Here with an amount: 14.857414 bcna

image

When i try to undelegate, with good amount on console log image

And the return error from SDK: image

Not tested from CLI

RaulBernal commented 8 months ago

It's happening when the "delegation.shares" is different than "balance.amount" telegram-cloud-photo-size-4-5911488558835809921-y

RaulBernal commented 8 months ago

I've tested three times with an account with many delegations. Everything works fine from cli.

Done UNbond:https://testnet.ping.pub/bitcanna/tx/35AE91FEA7B6A8F80F97102AD93EED907946915EF596B86103013D05C043D6A7
NOK cancel-unbond because Validator is jailed
https://testnet.ping.pub/bitcanna/tx/3295EF8578674CA2C23B79ADBDDF065F3716411B695FE67EEE62507B52C25C35

- balance:
    amount: "990000003070"
    denom: ubcna
  delegation:
    delegator_address: bcna1csyzlg52g2kd8e0xd6f6elckydhr93ukc3wmqt
    shares: "1010101010101.010101010101010101"
    validator_address: bcnavaloper16j0mtjwyz6s72q0ftl6fz0ykfp02836m0kp2kl

Done UNBOND
619C6549DC550D13ACFAB0FAA6B48500097F2C989913EFB9DBDBE937306639D0
Done Cancel UNBOND
https://testnet.ping.pub/bitcanna/tx/FE774D1959B21B420F5CF997A629C37B54E2630108218131542BCB021011F92A 
- balance:
    amount: "1372140009897"
    denom: ubcna
  delegation:
    delegator_address: bcna1csyzlg52g2kd8e0xd6f6elckydhr93ukc3wmqt
    shares: "1428425630880.176139975790529457"
    validator_address: bcnavaloper1n24j73stmw4c0crg2kq78ccjfvjqaxt67pnf0t

UNBOND DONE: validator is jailed, I can't Cancel-Unbond
https://testnet.ping.pub/bitcanna/tx/350F5ACE656EE77FBAF8715AB60A85F8B308ACE1A4C39D7F26B7E11EBDA655EC
- balance:
    amount: "200"
    denom: ubcna
  delegation:
    delegator_address: bcna1csyzlg52g2kd8e0xd6f6elckydhr93ukc3wmqt
    shares: "206.126403839306669738"
    validator_address: bcnavaloper1mgvkypq6f2dlpkwpqy076w4j3n5r2z9p3833vk

Please @atmoner provide me the full SDK message (copy and paste here) and we could make some CLI test with your account.

RaulBernal commented 8 months ago

Related with SDK issue (April 2020) https://github.com/cosmos/cosmos-sdk/issues/6063

RaulBernal commented 8 months ago

@atmoner Could you tell me if this validator was jailed in the past?

RaulBernal commented 8 months ago

bcnavaloper1xkv494sduqkpadwesqlsp6069yepsj58haejfv

image

I searched ... no jailed so... more related with this one: https://github.com/cosmos/cosmos-sdk/issues/11084