Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Slashing should reduce registered amount that is bonded #3088

Closed
Tbaut opened this issue Apr 9, 2019 · 8 comments
Closed

Slashing should reduce registered amount that is bonded #3088

Tbaut opened this issue Apr 9, 2019 · 8 comments
Labels
A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it.

Comments

@Tbaut
Copy link

Tbaut commented Apr 9, 2019

The account 5F7BJL6Z4m8RLtK7nXEqqpEqhBbd535Z3CZeYF6ccvaQAY6N has more DOTs bonded than available in free_balance. Also it has no vesting and no reserved balance.

staking.ledger from its controller:

{
    "stash": "5F7BJL6Z4m8RLtK7nXEqqpEqhBbd535Z3CZeYF6ccvaQAY6N",
    "total": "0x00000000000000000023829049fb9940",
    "active": "0x00000000000000000023829049fb9940",
    "unlocking": []
}

which is ~9,9951×10¹⁵

balances.freeBalance: ~9,9946x10¹⁵

@Tbaut Tbaut changed the title More Dots bounded than available in the balance More DOTs bonded than in free_balance May 8, 2019
@kianenigma
Copy link
Contributor

Interesting. Keeping these two in mind:

I don't see how this account ended up like this. Is this on Alexander?

@jacogr
Copy link
Contributor

jacogr commented May 30, 2019

Alex, yes.

Currently the same account is unlocking (aka entered the 2 year wait), however the same thing now shows slightly differently - the total value being unlocked is now > freeBalance.

@jacogr
Copy link
Contributor

jacogr commented May 30, 2019

This may help as well, only 2 extrinsics on this account - https://polkascan.io/pre/alexander/module/account/5F7BJL6Z4m8RLtK7nXEqqpEqhBbd535Z3CZeYF6ccvaQAY6N

  • staking.setKey
  • staking.bond with 10000000000000000 (10 DOTs)

The controller is here - https://polkascan.io/pre/alexander/module/account/69edffba4af672942bf6f60dfe839a20abf4556bb28a7c470a1778291326c46c (linked from the bond extrinsic)

@kianenigma
Copy link
Contributor

Great example. and now I feel more serious about this. The locks fo this acc seems quite off to me, or am I missing sth? The first two locks both contains an amount which is almost equal to the total bonded amount.

look at this.

Will further investigate this next week.

@Tbaut
Copy link
Author

Tbaut commented Jun 3, 2019

Comment offline from @kianenigma: the original issue that staking.active>freeBalance could be valid if the account has been slashed. So this is actually ok.
I could confirm it on an account that has been slashed (found on Alex) e.g here the total is also higher than the available.

image

I'd suggest to open another issue for the locks that are off.

@gavofyork gavofyork changed the title More DOTs bonded than in free_balance Slashing should reduce registered amount that is bonded Jul 10, 2019
@gavofyork gavofyork transferred this issue from paritytech/polkadot Jul 10, 2019
@kianenigma
Copy link
Contributor

@Tbaut any other strange behavior regarding this? Now, reading the discussion again, I think the original offset was simply because of paying fees.

@kianenigma kianenigma added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Jul 11, 2019
@Tbaut
Copy link
Author

Tbaut commented Jul 12, 2019

It's not about the fee, it's about the registered amount (see this comment) and the new title of this issue.

@Tbaut Tbaut removed the J2-unconfirmed Issue might be valid, but it’s not yet known. label Jul 19, 2019
@kianenigma kianenigma added the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Aug 18, 2020
@kianenigma
Copy link
Contributor

This is fixed already, as we do call update-ledger now with the new amount bonded after the slash.

slashed_imbalance.subsume(imbalance);
if !missing.is_zero() {
// deduct overslash from the reward payout
*reward_payout = reward_payout.saturating_sub(missing);
}
<Module<T>>::update_ledger(&controller, &ledger);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it.
Projects
Status: Done
Development

No branches or pull requests

3 participants