From c42114c5167159c6c6230df7c2ee3a37a0e9361e Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:38:16 +0700 Subject: [PATCH] feat: add pov reclaim & xcm migration --- Cargo.lock | 1 + node/src/command.rs | 5 ++++- node/src/service.rs | 3 ++- runtime/devnet/Cargo.toml | 1 + runtime/devnet/src/lib.rs | 2 +- runtime/testnet/Cargo.toml | 2 ++ runtime/testnet/src/lib.rs | 14 ++++++++++++-- 7 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b4fa0877..494f7c9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12211,6 +12211,7 @@ dependencies = [ "cumulus-pallet-xcmp-queue 0.15.0", "cumulus-primitives-aura 0.14.0", "cumulus-primitives-core 0.14.0", + "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility 0.15.0", "enumflags2", "env_logger 0.11.5", diff --git a/node/src/command.rs b/node/src/command.rs index 7916072f..8e0b7bb9 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -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; @@ -265,7 +266,9 @@ pub fn run() -> Result<()> { BenchmarkCmd::Pallet(cmd) => { if cfg!(feature = "runtime-benchmarks") { runner.sync_run(|config| { - cmd.run_with_spec::, ()>(Some(config.chain_spec)) + cmd.run_with_spec::, ReclaimHostFunctions>(Some( + config.chain_spec, + )) }) } else { Err("Benchmarking wasn't enabled when building the node. \ diff --git a/node/src/service.rs b/node/src/service.rs index e3f4ce0c..3eceb62a 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -103,10 +103,11 @@ where .build(); let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::( + sc_service::new_full_parts_record_import::( config, telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), executor, + true, )?; let client = Arc::new(client); diff --git a/runtime/devnet/Cargo.toml b/runtime/devnet/Cargo.toml index dd277c94..b04fb9e3 100644 --- a/runtime/devnet/Cargo.toml +++ b/runtime/devnet/Cargo.toml @@ -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", diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index 2ae74255..d2f1ec13 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -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! { diff --git a/runtime/testnet/Cargo.toml b/runtime/testnet/Cargo.toml index d9dd45a7..fd6a589b 100644 --- a/runtime/testnet/Cargo.toml +++ b/runtime/testnet/Cargo.toml @@ -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 @@ -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", diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index e7bcc4c1..48801ebe 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -109,7 +109,12 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Migrations to apply on runtime upgrade. -pub type Migrations = (pallet_collator_selection::migration::v2::MigrationToV2,); +pub type Migrations = ( + pallet_collator_selection::migration::v2::MigrationToV2, + pallet_contracts::Migration, + cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, + pallet_xcm::migration::MigrateToLatestXcmVersion, +); /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -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! {