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
A unbonding period was complete and in the EndBlocker of x/stake UnbondAllMatureValidatorQueue was called which completed the unbonding by removing the validator.
This triggered the hook RemoveValidator which is handled by x/distribution. The hook there will delete the validatorDistInfo. There is a sanity check that DelAccum is 0 but the validator still had commission in his distInfo that was unclaimed. When then the DistInfo was deleted the invariant broke because all of the tokens in the distInfo were wiped/burnt but still in the LooseTokens.
Expected behaviour: Either withdraw commission when transitioning bonded->unbonding or withdraw the commission in the ValidatorRemoved hook. Tokens should be withdrawn and not burnt (and if burnt, they should be removed from the LooseTokens).
I think the actual problem already occurred when the unbonding was issued.
We should do the following:
In onDelegationRemoved if the delAddr = valAddr, we have to withdraw the commission as this means that the validator will be jailed/unbonded. Also a sanity check in RemoveValidatorDistInfo would make sense.
That sounds like the best possible patch to me. However that also means we won't be able to live-patch GoS. Also we have to be careful with the fork unless we cleanup the unbondings in postprocessing or fork before the relevant unbonding happened (~ height 300)
What happened is:
A unbonding period was complete and in the
EndBlocker
of x/stakeUnbondAllMatureValidatorQueue
was called which completed the unbonding by removing the validator.This triggered the hook
RemoveValidator
which is handled by x/distribution. The hook there will delete the validatorDistInfo. There is a sanity check that DelAccum is 0 but the validator still had commission in his distInfo that was unclaimed. When then the DistInfo was deleted the invariant broke because all of the tokens in the distInfo were wiped/burnt but still in the LooseTokens.Expected behaviour: Either withdraw commission when transitioning bonded->unbonding or withdraw the commission in the ValidatorRemoved hook. Tokens should be withdrawn and not burnt (and if burnt, they should be removed from the LooseTokens).
I think the actual problem already occurred when the unbonding was issued.
We should do the following:
In
onDelegationRemoved
if the delAddr = valAddr, we have to withdraw the commission as this means that the validator will be jailed/unbonded. Also a sanity check inRemoveValidatorDistInfo
would make sense.That sounds like the best possible patch to me. However that also means we won't be able to live-patch GoS. Also we have to be careful with the fork unless we cleanup the unbondings in postprocessing or fork before the relevant unbonding happened (~ height 300)
Stacktrace:
A unbonding period ended in the said block. Pretty sure this caused the invariant to break.
For Admin Use
The text was updated successfully, but these errors were encountered: