Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send misbehaviour time during slashing event #139

Open
maurolacy opened this issue Dec 13, 2023 · 2 comments
Open

Send misbehaviour time during slashing event #139

maurolacy opened this issue Dec 13, 2023 · 2 comments
Assignees
Milestone

Comments

@maurolacy
Copy link
Collaborator

Related to / follow up of #125.

As part of slashing message info to the virtual-staking contract, the infraction time has to be sent as well.

Infraction time is:

  • The current block time for offline misbehaviours.
  • The evidence's infraction time, for double signing misbehaviours.

This is important since the infraction time time is used on the external-staking contract to filter out slashing of un delegations (for pending undelegations that started before the infraction)

See also: osmosis-labs/mesh-security#177

@maurolacy
Copy link
Collaborator Author

maurolacy commented Dec 13, 2023

This hasn't been done yet because the infraction time is not passed to the Slash() handler. So, this requires interfacing with / decorating HandleEquivocationEvidence() (that is, the evidence keeper), where that info is still present.

For offline infractions, the current block time can be sent in place of the evidence historical infraction time. This can (perhaps) be done in the SlashWithInfractionHeight decorator.

@maurolacy
Copy link
Collaborator Author

maurolacy commented Dec 13, 2023

As discussed offline, a good way to do this could be:

Decorating the evidence keeper / HandleEquivocationEvidence, and first calling the real equivocation evidence handler in the decorator.

Then, checking if the validator is now jailed / tombstoned, and building a full slash message for the contracts in case it is.

The good thing about this is that the original evidence handler can be called unmodified. And, that it isn't necessary to reproduce / copy its logic in the decorator.

For robustness, you can check for jailing / slashing before calling the real handler, then check again after calling it, and only generate a slash message if there's a state transition to jailing / tombstoning.

@pinosu pinosu added this to the v0.4.0 milestone Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants