osmosis-labs / mesh-security

Other
62 stars 8 forks source link

Fix validator withdrawal follow-up #136

Closed maurolacy closed 12 months ago

maurolacy commented 1 year ago

Process jailing and tombstoning events in virtual-staking, adjusting the bonded amounts so that they are consistent with their on-chain slashing.

132 tests can now be extended to these scenarios.

maurolacy commented 12 months ago

I'm guessing this works, but it confuses me a bit. @maurolacy Is the following reasoning correct?

  1. When Alice gets jailed, there might be a bond request coming in and a valset update saying Alice has been jailed, so we want to be on the lookout for that.
  2. On future epochs there will be no bond requests for Alice while she's jailed, so we don't really need to keep track of that.
  3. Eventually, once she's unjailed, bond requests will start coming in again - and that's really how virtual_staking knows she's back in the valset.
  1. and 3. should be no issue IMO. Regarding 1., the impl tries to account for it, but there may be errors, or an incomplete solution. Testing should make this clear. Will do that next.