paras: add governance control dispatchables (#4575)

* paras: add governance control dispatchables

Adds a couple of functions for governance control for the paras module
in the anticipation of PVF pre-checking enabling.

Specifically, this commit adds a function for pre-registering a PVF that
governance trusts enough. This function will come in handy in case there
is a parachain that does not follow the GoAhead signal. That is, does
not include https://github.com/paritytech/cumulus/pull/517.

This may be not an exhaustive list of the functions that may come in
handy. Any suggestions to add more are welcome.

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs

* cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs

Co-authored-by: Parity Bot <admin@parity.io>
This commit is contained in:
Sergei Shulepov
2021-12-29 15:42:10 +01:00
committed by GitHub
parent a44349f652
commit 4bf62d85a6
6 changed files with 373 additions and 47 deletions
@@ -127,6 +127,15 @@ benchmarks! {
assert_last_event::<T>(Event::ActionQueued(para_id, next_session).into());
}
add_trusted_validation_code {
let c in 1 .. MAX_CODE_SIZE;
let new_code = ValidationCode(vec![0; c as usize]);
}: _(RawOrigin::Root, new_code)
poke_unused_validation_code {
let code_hash = [0; 32].into();
}: _(RawOrigin::Root, code_hash)
impl_benchmark_test_suite!(
Pallet,
crate::mock::new_test_ext(Default::default()),