substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Allow submitting offences from root

Open kianenigma opened this issue 3 years ago • 10 comments

Would be very helpful for testing if there was a way for root e.g. sudo in a dev-chain to create an offence. This would help you test all sorts of things around the slashing and offence code.

Ideally, this transaction would only accept one parameters: offenders: Vec<(T::AccountId, Perbill)>, and slash each of them with that fraction.

One way to do this would be to add this transaction to the offences pallet. But it won't be able to work with the api above (offences pallet needs FullIdentification), and it would also pollute all runtime with this pallet.

An alternative is to build a custom, minimal pallet that only does this.

This new pallet should strictly depend on pallet-session, pallet-staking, and pallet-offences in its trait Config.

Having all 3 of the above, realizing the interface offenders: Vec<(T::AccountId, Perbill)> should also be possible.

kianenigma avatar May 04 '22 14:05 kianenigma

cc @georgesdib

kianenigma avatar May 04 '22 14:05 kianenigma

An alternative is to build a custom, minimal pallet that only does this.

I vote for this.

bkchr avatar May 04 '22 18:05 bkchr

Can we do this from governance on non-sudo chains?

burdges avatar May 04 '22 21:05 burdges

@kianenigma If it's agreed on that a new pallet should be made for this issue, I would love to work on this

omadoyeabraham avatar May 05 '22 14:05 omadoyeabraham

Hello @kianenigma is this agreed to be worked on now? I'd love to work on this.

gitwithterrence avatar Jun 11 '22 17:06 gitwithterrence

would be good if this transaction is also moved from system this new pallet: https://github.com/paritytech/substrate/blob/48de0a4a6393458f8330c4538fcd182b11a87a07/frame/system/src/lib.rs#L373

kianenigma avatar Jun 16 '22 09:06 kianenigma

@omadoyeabraham @gitwithterrence Are you working on this, or is the issue free to work on?

Szegoo avatar Jul 04 '22 10:07 Szegoo

@kianenigma Could you assign this to me? I am currently working on this.

Szegoo avatar Jul 30 '22 08:07 Szegoo

@Szegoo You might want to consider getting your outstanding PRs to the finish line. As of my typing, you have 4.

KiChjang avatar Jul 30 '22 15:07 KiChjang

@Szegoo You might want to consider getting your outstanding PRs to the finish line. As of my typing, you have 4.

Thanks for reminding me, out of the 4 PRs two of them need to be closed(I closed them now) and for the other two, I am awaiting reviews. So I actually have 2 open PRs.

Szegoo avatar Jul 30 '22 16:07 Szegoo

@kianenigma @bkchr Could you please take a look at my PR?

Szegoo avatar Aug 11 '22 20:08 Szegoo