Conversation
There was a problem hiding this comment.
Looks good. Approving modulo the question I've left and your todo.
My view on the questions in the PR description:
should manual_slash accept session instead of an era when the validator was in the active set?
I can't think about a case when we want to slash at a particular session so I'd say this is good.
should the accepted origin be something more than just root?
Maybe we might want to apply a manual slash from AH via XCM, but I wouldn't worry about this right now. I think it's good as it is.
should I adapt this PR also against #6996?
@Ank4n and @kianenigma are doing a lot of changes to the staking pallet here which will be merged in master. I think having your PR merged in master is enough.
* master: pallet-scheduler: Put back postponed tasks into the agenda (#7790) ci: update credentials for command-backport (#7798) [XCM] add generic location to account converter that also works with external ecosystems (#7313) [AHM] Make more stuff public (#7802) Support adding extra request-response protocols to the node (#7708) notifications/tests: Fix tests to avoid overflow on adding duration to instant (#7793) pallet revive: rpc build script should not panic (#7786) pallet-bridge-relayers - migrate benchmarks to v2 (#7531)
Co-authored-by: Tsvetomir Dimitrov <[email protected]>
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
* origin: (325 commits) Add an extra_constant to pallet-treasury (#7918) Bump the ci_dependencies group across 1 directory with 4 updates (#7855) remove compromised action (#7934) Fixing token-economics dead link (#5302) [pallet-revive] Fix pallet-revive-fixtures build.rs (#7928) cumulus: fix pov exporter format (#7923) sp-api: Support `mut` in `impl_runtime_apis!` (#7924) Remove clones from block seal function (#7917) [pallet-revive] precompiles 2->9 (#7810) Use non-native token to benchmark xcm on asset hub (#7893) [CI] bump timeout wait for build in zombienet workflows. (#7871) taplo: split long array line to multiline array (#7905) [pallet-revive] fixture as dev dep (#7844) notifications/libp2p: Punish notification protocol misbehavior on outbound substreams (#7781) [Release|CI/CD] Update version of the cache action in the Publish docker ci (#7892) Remove `pallet::getter` usage from bridges/modules (#7120) [pallet-revive] Support blocktag in eth_getLogs RPC (#7879) Improve error message in benchmark macro (#7873) staking: add `manual_slash` extrinsic (#7805) Remove execute_with_origin implementation in the XCM executor (#7889) ...
This PR adds a convenience extrinsic `manual_slash` for the governance to slash a validator manually. ## Changes * The `on_offence` implementation for the Staking pallet accepts a slice of `OffenceDetails` including the full validator exposure, however, it simply [ignores](https://github.com/paritytech/polkadot-sdk/blob/c8d33396345237c1864dfc0a9b2172b7dfe7ac8f/substrate/frame/staking/src/pallet/impls.rs#L1864) that part. I've extracted the functionality into an inherent `on_offence` method that takes `OffenceDetails` without the full exposure and this is called directly in `manual_slash` * `manual_slash` creates an offence for a validator with a given slash percentange ## Questions - [x] should `manual_slash` accept session instead of an era when the validator was in the active set? staking thinks in terms of eras and we can check out of bounds this way, which is why it was chosen for this implementation, but if there are arguments against, happy to change to session index - [X] should the accepted origin be something more than just root? Changed to `T::AdminOrigin` to align with `cancel_deferred_slash` - [X] should I adapt this PR also against #6996? looking at the changes, it should apply mostly without conflicts --------- Co-authored-by: Tsvetomir Dimitrov <[email protected]> Co-authored-by: Ankan <[email protected]>
This PR adds a convenience extrinsic
manual_slashfor the governance to slash a validator manually.Changes
on_offenceimplementation for the Staking pallet accepts a slice ofOffenceDetailsincluding the full validator exposure, however, it simply ignores that part. I've extracted the functionality into an inherenton_offencemethod that takesOffenceDetailswithout the full exposure and this is called directly inmanual_slashmanual_slashcreates an offence for a validator with a given slash percentangeQuestions
manual_slashaccept session instead of an era when the validator was in the active set? staking thinks in terms of eras and we can check out of bounds this way, which is why it was chosen for this implementation, but if there are arguments against, happy to change to session indexT::AdminOriginto align withcancel_deferred_slash