Skip to content

Commit

Permalink
feat: add pov reclaim & xcm migration
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Aug 20, 2024
1 parent dc01992 commit c42114c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{net::SocketAddr, path::PathBuf};

use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::info;
Expand Down Expand Up @@ -265,7 +266,9 @@ pub fn run() -> Result<()> {
BenchmarkCmd::Pallet(cmd) => {
if cfg!(feature = "runtime-benchmarks") {
runner.sync_run(|config| {
cmd.run_with_spec::<HashingFor<Block>, ()>(Some(config.chain_spec))
cmd.run_with_spec::<HashingFor<Block>, ReclaimHostFunctions>(Some(
config.chain_spec,
))
})
} else {
Err("Benchmarking wasn't enabled when building the node. \
Expand Down
3 changes: 2 additions & 1 deletion node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ where
.build();

let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
sc_service::new_full_parts_record_import::<Block, RuntimeApi, _>(
config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
executor,
true,
)?;
let client = Arc::new(client);

Expand Down
1 change: 1 addition & 0 deletions runtime/devnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ std = [
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-utility/std",
"frame-benchmarking/std",
"frame-executive/std",
Expand Down
2 changes: 1 addition & 1 deletion runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
// Limit the number of messages and signals a HRML channel can have at most
type MaxActiveOutboundChannels = ConstU32<128>;
// Limit the number of HRML channels
type MaxPageSize = ConstU32<{ 1 << 16 }>;
type MaxPageSize = ConstU32<{ 103 * 1024 }>;
}

parameter_types! {
Expand Down
2 changes: 2 additions & 0 deletions runtime/testnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ cumulus-pallet-xcm.workspace = true
cumulus-pallet-xcmp-queue.workspace = true
cumulus-primitives-aura.workspace = true
cumulus-primitives-core.workspace = true
cumulus-primitives-storage-weight-reclaim.workspace = true
cumulus-primitives-utility.workspace = true
pallet-collator-selection.workspace = true
parachains-common.workspace = true
Expand All @@ -104,6 +105,7 @@ std = [
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-primitives-utility/std",
"frame-benchmarking/std",
"frame-executive/std",
Expand Down
14 changes: 12 additions & 2 deletions runtime/testnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;

/// Migrations to apply on runtime upgrade.
pub type Migrations = (pallet_collator_selection::migration::v2::MigrationToV2<Runtime>,);
pub type Migrations = (
pallet_collator_selection::migration::v2::MigrationToV2<Runtime>,
pallet_contracts::Migration<Runtime>,
cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5<Runtime>,
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
);

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down Expand Up @@ -423,7 +428,12 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
// Limit the number of messages and signals a HRML channel can have at most
type MaxActiveOutboundChannels = ConstU32<128>;
// Limit the number of HRML channels
type MaxPageSize = ConstU32<{ 1 << 16 }>;
type MaxPageSize = ConstU32<{ 103 * 1024 }>;
}

impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime {
// This must be the same as the `ChannelInfo` from the `Config`:
type ChannelList = ParachainSystem;
}

parameter_types! {
Expand Down

0 comments on commit c42114c

Please sign in to comment.