From f3da93d3e28e990fc52c5e9d5fb0fac7154d97e4 Mon Sep 17 00:00:00 2001 From: Chris Sosnin <48099298+slumber@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:00:10 +0300 Subject: [PATCH] extend abridged host config (#7659) added asynchronous backing params --- primitives/src/v5/mod.rs | 2 ++ runtime/parachains/src/configuration.rs | 4 ++-- runtime/parachains/src/configuration/tests.rs | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/primitives/src/v5/mod.rs b/primitives/src/v5/mod.rs index 4e107c881d4e..59fb6c927b2d 100644 --- a/primitives/src/v5/mod.rs +++ b/primitives/src/v5/mod.rs @@ -1165,6 +1165,8 @@ pub struct AbridgedHostConfiguration { pub validation_upgrade_cooldown: BlockNumber, /// The delay, in blocks, before a validation upgrade is applied. pub validation_upgrade_delay: BlockNumber, + /// Asynchronous backing parameters. + pub async_backing_params: super::vstaging::AsyncBackingParams, } /// Abridged version of `HrmpChannel` (from the `Hrmp` parachains host runtime module) meant to be diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index 03d1ae420495..accc01a2b180 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -124,13 +124,13 @@ pub struct HostConfiguration { /// /// [#4601]: https://github.com/paritytech/polkadot/issues/4601 pub validation_upgrade_delay: BlockNumber, + /// Asynchronous backing parameters. + pub async_backing_params: AsyncBackingParams, /** * The parameters that are not essential, but still may be of interest for parachains. */ - /// Asynchronous backing parameters. - pub async_backing_params: AsyncBackingParams, /// The maximum POV block size, in bytes. pub max_pov_size: u32, /// The maximum size of a message that can be put in a downward message queue. diff --git a/runtime/parachains/src/configuration/tests.rs b/runtime/parachains/src/configuration/tests.rs index 83de7db932b4..43c03067a9a7 100644 --- a/runtime/parachains/src/configuration/tests.rs +++ b/runtime/parachains/src/configuration/tests.rs @@ -487,7 +487,9 @@ fn verify_externally_accessible() { use primitives::{well_known_keys, AbridgedHostConfiguration}; new_test_ext(Default::default()).execute_with(|| { - let ground_truth = HostConfiguration::default(); + let mut ground_truth = HostConfiguration::default(); + ground_truth.async_backing_params = + AsyncBackingParams { allowed_ancestry_len: 111, max_candidate_depth: 222 }; // Make sure that the configuration is stored in the storage. ActiveConfig::::put(ground_truth.clone()); @@ -511,6 +513,7 @@ fn verify_externally_accessible() { hrmp_max_message_num_per_candidate: ground_truth.hrmp_max_message_num_per_candidate, validation_upgrade_cooldown: ground_truth.validation_upgrade_cooldown, validation_upgrade_delay: ground_truth.validation_upgrade_delay, + async_backing_params: ground_truth.async_backing_params, }, ); });