Enable changing executor params through governance (#6934)

* Add a pallet call to change executor params

* Use `OptionQuery`; Avoid runtime panic

* Move pending executor params to `configuration`

* Move `ExecutorParams` to `HostConfiguration` structure

* Add executor params to the v5 migration

* Add an `ExecutorParams` benchmark

* ".git/.scripts/commands/bench/bench.sh" runtime polkadot runtime_parachains::configuration

* Add to `WeightInfo`

* Add dummy weights to other networks

* ".git/.scripts/commands/bench/bench.sh" runtime kusama runtime_parachains::configuration

* ".git/.scripts/commands/bench/bench.sh" runtime rococo runtime_parachains::configuration

* ".git/.scripts/commands/bench/bench.sh" runtime westend runtime_parachains::configuration

* Use real weight

* Fix comment

---------

Co-authored-by: command-bot <>
This commit is contained in:
s0me0ne-unkn0wn
2023-04-14 13:21:12 +02:00
committed by GitHub
parent f0c507362d
commit 0211c4b2f7
11 changed files with 221 additions and 108 deletions
@@ -28,7 +28,9 @@ use sp_std::vec::Vec;
/// v1-v2: <https://github.com/paritytech/polkadot/pull/4420>
/// v2-v3: <https://github.com/paritytech/polkadot/pull/6091>
/// v3-v4: <https://github.com/paritytech/polkadot/pull/6345>
/// v4-v5: <https://github.com/paritytech/polkadot/pull/6937> + <https://github.com/paritytech/polkadot/pull/6961>
/// v4-v5: <https://github.com/paritytech/polkadot/pull/6937>
/// + <https://github.com/paritytech/polkadot/pull/6961>
/// + <https://github.com/paritytech/polkadot/pull/6934>
pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(5);
pub mod v5 {
@@ -230,6 +232,9 @@ minimum_validation_upgrade_delay : pre.minimum_validation_upgrade_delay,
// Default values are zeroes, thus it's ensured allowed ancestry never crosses the upgrade block.
async_backing_params : AsyncBackingParams { max_candidate_depth: 0, allowed_ancestry_len: 0 },
// Default executor parameters set is empty
executor_params : Default::default(),
}
};
@@ -268,6 +273,7 @@ async_backing_params : AsyncBackingParams { max_candidate_de
mod tests {
use super::*;
use crate::mock::{new_test_ext, Test};
use primitives::ExecutorParams;
#[test]
fn v4_deserialized_from_actual_data() {
@@ -391,6 +397,7 @@ mod tests {
// additional checks for async backing.
assert_eq!(v5.async_backing_params.allowed_ancestry_len, 0);
assert_eq!(v5.async_backing_params.max_candidate_depth, 0);
assert_eq!(v5.executor_params, ExecutorParams::new());
}
});
}