mesh-security icon indicating copy to clipboard operation
mesh-security copied to clipboard

virtual-staking: Unbonding from tombstoned validators

Open maurolacy opened this issue 1 year ago • 0 comments

When unbonding from a tombstoned validator, we need to make sure if there's the need to unbond funds from the blockchain staking module or not. This is because some blockchain implementations may decide to unbond automatically when tombstoning, and after slashing, a validator.

This would require:

  • Knowing that a validator is tombstoned. Currently we have a inactive list in virtual-staking, which doesn't differentiate between jailed, unbonded or tombstoned validators. Let's add a state to the list, so that we can check this. Alternatively, we can simply do the bonded check below for all inactive validators.
  • Checking the bonded amount a tombstoned / inactive validator has. This has to be done against the blockchain, using the StakingQuery::Delegation message (or the query_delegation helper), in order to send an Unbond message only if / when needed.

maurolacy avatar Oct 24 '23 09:10 maurolacy