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

primitives: make async backing params accessible for parachains #7659

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions primitives/src/v5/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems a bit weird that v5 types depend on vstaging types. Also by making this change, shouldn't we bump a version? And stabilize this vstaging type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should bump it along with staging runtime API becoming available. The change from this PR is backwards-compatible -- old AbridgedHostConfig can be decoded from the storage value as well.

}

/// Abridged version of `HrmpChannel` (from the `Hrmp` parachains host runtime module) meant to be
Expand Down
4 changes: 2 additions & 2 deletions runtime/parachains/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ pub struct HostConfiguration<BlockNumber> {
///
/// [#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.
Expand Down
5 changes: 4 additions & 1 deletion runtime/parachains/src/configuration/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Test>::put(ground_truth.clone());
Expand All @@ -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,
},
);
});
Expand Down