osmosis-labs / mesh-security

Other
62 stars 8 forks source link

Only slash undelegations that started after the misbehaviour #177

Open maurolacy opened 10 months ago

maurolacy commented 10 months ago

When slashing associated pending undelegations from a validator

https://github.com/osmosis-labs/mesh-security/blob/0b5173e7735f524171222cb75a5f49011dd8f693/contracts/provider/external-staking/src/state.rs#L95-L108

we need to filter out not only those that have already expired (done), but also those that started before the misbehaviour we're now processing.

This is not possible right now because we don't have access to the misbehaviour's height and time. These would need to be sent along with the validators to jail and tombstone.

Not doing this would introduce differences, in some cases, between on-chain slashing and the slashing accounting on the contracts.

maurolacy commented 10 months ago

This is now addressed as part of #179.

What is still missing is sending the proper misbehaviour time from blockchain code. Zero is currently being sent: https://github.com/osmosis-labs/mesh-security-sdk/pull/125.

Will create a follow-up issue in the SDK repo and reference it here.