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

Commit

Permalink
Add MAX_CODE_SIZE to ScheduleConfigUpdate
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez committed Apr 20, 2023
1 parent a17f1e8 commit 7caffb0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,7 @@ pub type Migrations = (

/// Helpers to configure all migrations.
pub mod migrations {
use primitives::MAX_CODE_SIZE;
use runtime_parachains::configuration::migration_ump;

pub const MAX_UPWARD_QUEUE_SIZE: u32 = 4 * 1024 * 1024;
Expand All @@ -1528,6 +1529,7 @@ pub mod migrations {
MAX_UPWARD_QUEUE_COUNT,
MAX_UPWARD_MESSAGE_SIZE,
MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE,
MAX_CODE_SIZE,
>;
}

Expand Down
4 changes: 4 additions & 0 deletions runtime/parachains/src/configuration/migration_ump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub mod latest {
const MAX_UPWARD_QUEUE_COUNT: u32,
const MAX_UPWARD_MESSAGE_SIZE: u32,
const MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE: u32,
const MAX_CODE_SIZE: u32,
>(core::marker::PhantomData<T>);

impl<
Expand All @@ -41,13 +42,15 @@ pub mod latest {
const MAX_UPWARD_QUEUE_COUNT: u32,
const MAX_UPWARD_MESSAGE_SIZE: u32,
const MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE: u32,
const MAX_CODE_SIZE: u32,
> OnRuntimeUpgrade
for ScheduleConfigUpdate<
T,
MAX_UPWARD_QUEUE_SIZE,
MAX_UPWARD_QUEUE_COUNT,
MAX_UPWARD_MESSAGE_SIZE,
MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE,
MAX_CODE_SIZE,
>
{
#[cfg(feature = "try-runtime")]
Expand Down Expand Up @@ -77,6 +80,7 @@ pub mod latest {
cfg.max_upward_queue_count = MAX_UPWARD_QUEUE_COUNT;
cfg.max_upward_message_size = MAX_UPWARD_MESSAGE_SIZE;
cfg.max_upward_message_num_per_candidate = MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE;
cfg.max_code_size = MAX_CODE_SIZE;
}) {
log::error!(
target: LOG_TARGET,
Expand Down
2 changes: 2 additions & 0 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,7 @@ pub type Migrations = (

/// Helpers to configure all migrations.
pub mod migrations {
use primitives::MAX_CODE_SIZE;
use runtime_parachains::configuration::migration_ump;

pub const MAX_UPWARD_QUEUE_SIZE: u32 = 1 * 1024 * 1024;
Expand All @@ -1486,6 +1487,7 @@ pub mod migrations {
MAX_UPWARD_QUEUE_COUNT,
MAX_UPWARD_MESSAGE_SIZE,
MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE,
MAX_CODE_SIZE,
>;
}

Expand Down
2 changes: 2 additions & 0 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,7 @@ pub type Migrations = (

/// Helpers to configure all migrations.
pub mod migrations {
use primitives::MAX_CODE_SIZE;
use runtime_parachains::configuration::migration_ump;

pub const MAX_UPWARD_QUEUE_SIZE: u32 = 8 * 1024 * 1024;
Expand All @@ -1536,6 +1537,7 @@ pub mod migrations {
MAX_UPWARD_QUEUE_COUNT,
MAX_UPWARD_MESSAGE_SIZE,
MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE,
MAX_CODE_SIZE,
>;
}

Expand Down
2 changes: 2 additions & 0 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,7 @@ pub type Migrations = (

/// Helpers to configure all migrations.
pub mod migrations {
use primitives::MAX_CODE_SIZE;
use runtime_parachains::configuration::migration_ump;

pub const MAX_UPWARD_QUEUE_SIZE: u32 = 8 * 1024 * 1024;
Expand All @@ -1285,6 +1286,7 @@ pub mod migrations {
MAX_UPWARD_QUEUE_COUNT,
MAX_UPWARD_MESSAGE_SIZE,
MAX_UPWARD_MESSAGE_NUM_PER_CANDIDATE,
MAX_CODE_SIZE,
>;
}

Expand Down

0 comments on commit 7caffb0

Please sign in to comment.