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

External operator slashes info pallet #727

Merged
merged 100 commits into from
Nov 5, 2024

Conversation

girazoki
Copy link
Collaborator

@girazoki girazoki commented Oct 22, 2024

It adds the external operator slashes pallet:

Associated config traits:

  • EraIndexProvider: which gives information about active era and when the era started
  • Defer Period: a constant that represents the time that we have to cancel a slash
  • BondingDuration: a constant that represents the time for which we have to maintain certain structures to be able to prove slashes. Obviously slashes are not maintained longer than the bonding duration.

Extrinsics:

  • cancel_deferred_slash: an extrinsic that allows us to cancel an existing slash within the deferred period
  • force_inject_slash: an extrinsic that allows us to forcedly inject a slash without having to verify it. Mostly for testing purposes.

Pallet purpose:

  • Store a mapping between eraIndex -> vec![Slash], where Slash contains information about the percentage to be slashed, the account, etc.

Testing:
Offences are tested by using both babe and grandpa equivocations, both in rust and typescript

pallets/external-validator-slashes/src/lib.rs Outdated Show resolved Hide resolved
pallets/external-validator-slashes/src/mock.rs Outdated Show resolved Hide resolved
pallets/external-validator-slashes/src/lib.rs Outdated Show resolved Hide resolved
pallets/external-validator-slashes/src/lib.rs Outdated Show resolved Hide resolved
pallets/external-validator-slashes/src/lib.rs Outdated Show resolved Hide resolved
pallets/external-validator-slashes/src/lib.rs Outdated Show resolved Hide resolved
Base automatically changed from tomasz-external-validators to master November 4, 2024 09:52
Copy link
Collaborator

@Agusrodri Agusrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@girazoki girazoki merged commit f8b66f3 into master Nov 5, 2024
42 checks passed
@girazoki girazoki deleted the girazoki-validator-era-info-pallet branch November 5, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants