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

Allow submitting offences from root #11352

Closed
kianenigma opened this issue May 4, 2022 · 11 comments · Fixed by #11943
Closed

Allow submitting offences from root #11352

kianenigma opened this issue May 4, 2022 · 11 comments · Fixed by #11943
Assignees
Labels
Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@kianenigma
Copy link
Contributor

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 kianenigma added Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. labels May 4, 2022
@kianenigma
Copy link
Contributor Author

cc @georgesdib

@bkchr
Copy link
Member

bkchr commented May 4, 2022

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

I vote for this.

@burdges
Copy link

burdges commented May 4, 2022

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

@omadoyeabraham
Copy link
Contributor

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

@gitwithterrence
Copy link

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

@kianenigma
Copy link
Contributor Author

would be good if this transaction is also moved from system this new pallet:

pub fn fill_block(origin: OriginFor<T>, _ratio: Perbill) -> DispatchResultWithPostInfo {

@Szegoo
Copy link
Contributor

Szegoo commented Jul 4, 2022

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

@Szegoo
Copy link
Contributor

Szegoo commented Jul 30, 2022

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

@KiChjang
Copy link
Contributor

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

@Szegoo
Copy link
Contributor

Szegoo commented Jul 30, 2022

@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
Copy link
Contributor

Szegoo commented Aug 11, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

7 participants