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

Get slashing status in another module #21988

Closed
dillu24 opened this issue Sep 30, 2024 · 2 comments
Closed

Get slashing status in another module #21988

dillu24 opened this issue Sep 30, 2024 · 2 comments

Comments

@dillu24
Copy link

dillu24 commented Sep 30, 2024

Is there a way for a module’s message server to check whether a validator is slashed in the current block? I was thinking of using ctx.EventManager.Event and check for the Slash event, however, I am not sure if this is determinstic.

@github-actions github-actions bot added the needs-triage Issue that needs to be triaged label Sep 30, 2024
@dillu24
Copy link
Author

dillu24 commented Oct 1, 2024

hmm .. found BeforeValidatorSlashed hook of the staking module. Is this the recommended way?

@tac0turtle tac0turtle added C:x/slashing T:question and removed needs-triage Issue that needs to be triaged labels Oct 2, 2024
@julienrbrt
Copy link
Member

Hey! You should not rely on events for state machine code yes. Hooks are indeed what you should use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

No branches or pull requests

3 participants