Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Offence implementations can disable offenders independently from slashing #10201

Merged
merged 10 commits into from
Nov 17, 2021

Conversation

wigy-opensource-developer
Copy link
Contributor

@wigy-opensource-developer wigy-opensource-developer commented Nov 5, 2021

In previous versions any slashed offenders got disabled by every offence. Now pallet developers can decide for each Offence implementation whether to disable them regardless of the slashed amount. Some use-cases would benefit from disabling offenders without slashing, so now they can override Offence::disable_strategy.

Fixes #10037

TODO:

  • Agree with the team on the signature
  • Add tests
  • Does it affect documentation?

skip check-dependent-cumulus

@wigy-opensource-developer wigy-opensource-developer added A0-please_review Pull request needs code review. B7-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. D2-breaksapi labels Nov 5, 2021
primitives/staking/src/offence.rs Outdated Show resolved Hide resolved
primitives/staking/src/offence.rs Outdated Show resolved Hide resolved
frame/staking/src/slashing.rs Outdated Show resolved Hide resolved
frame/staking/src/slashing.rs Outdated Show resolved Hide resolved
frame/staking/src/slashing.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

LGTM; @ordian does this address your issue?

@wigy-opensource-developer wigy-opensource-developer added D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit and removed D2-breaksapi labels Nov 8, 2021
Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

primitives/staking/src/offence.rs Show resolved Hide resolved
frame/offences/src/migration.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

lgtm. just minor nits.

primitives/staking/src/offence.rs Outdated Show resolved Hide resolved
primitives/staking/src/offence.rs Outdated Show resolved Hide resolved
primitives/staking/src/offence.rs Outdated Show resolved Hide resolved
primitives/staking/src/offence.rs Outdated Show resolved Hide resolved
frame/offences/src/migration.rs Show resolved Hide resolved
frame/offences/src/migration.rs Outdated Show resolved Hide resolved
@ordian
Copy link
Member

ordian commented Nov 17, 2021

bot merge

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot
Copy link

Merge cancelled due to error. Error: Checks failed for cd353c8

@ordian
Copy link
Member

ordian commented Nov 17, 2021

bot merge

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot paritytech-processbot bot merged commit 05a6abb into master Nov 17, 2021
@paritytech-processbot paritytech-processbot bot deleted the wigy-offence-disable branch November 17, 2021 14:11
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
…hing (paritytech#10201)

* Offence implementations can disable offenders independently from slashing

* Fix build on CI

* Run cargo fmt

* Fixes based on review comments

* Make parameter naming consistent

* Fix migration and some English

* Fix migration - again

* cargo fmt

* Cover 2 new cases with a test
AurevoirXavier added a commit to darwinia-network/darwinia-common that referenced this pull request Aug 4, 2022
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
…hing (paritytech#10201)

* Offence implementations can disable offenders independently from slashing

* Fix build on CI

* Run cargo fmt

* Fixes based on review comments

* Make parameter naming consistent

* Fix migration and some English

* Fix migration - again

* cargo fmt

* Cover 2 new cases with a test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pallet/offences: allow specifying whether the offenders should be disabled or slashed
5 participants