Skip to content

Commit

Permalink
Missing migrations, dead code removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Aug 8, 2024
1 parent 2dca9d9 commit 16aa6eb
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 90 deletions.
1 change: 0 additions & 1 deletion pallets/unified-accounts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ use sp_std::marker::PhantomData;

pub use pallet::*;

pub mod migration;
pub mod weights;
pub use weights::WeightInfo;

Expand Down
39 changes: 0 additions & 39 deletions pallets/unified-accounts/src/migration.rs

This file was deleted.

16 changes: 10 additions & 6 deletions runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ impl pallet_contracts::Config for Runtime {
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type Debug = ();
type Environment = ();
type Migrations = ();
type Migrations = (pallet_contracts::migration::v16::Migration<Runtime>,);
type Xcm = ();
type UploadOrigin = EnsureSigned<<Self as frame_system::Config>::AccountId>;
type InstantiateOrigin = EnsureSigned<<Self as frame_system::Config>::AccountId>;
Expand Down Expand Up @@ -1025,7 +1025,6 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
| RuntimeCall::XcmpQueue(..)
| RuntimeCall::PolkadotXcm(..)
| RuntimeCall::CumulusXcm(..)
| RuntimeCall::DmpQueue(..)
| RuntimeCall::XcAssetConfig(..)
// Skip entire EVM pallet
// Skip entire Ethereum pallet
Expand Down Expand Up @@ -1226,7 +1225,6 @@ construct_runtime!(
XcmpQueue: cumulus_pallet_xcmp_queue = 50,
PolkadotXcm: pallet_xcm = 51,
CumulusXcm: cumulus_pallet_xcm = 52,
DmpQueue: cumulus_pallet_dmp_queue = 53,
XcAssetConfig: pallet_xc_asset_config = 54,
XTokens: orml_xtokens = 55,
MessageQueue: pallet_message_queue = 56,
Expand Down Expand Up @@ -1297,17 +1295,23 @@ parameter_types! {
];
}

parameter_types! {
pub const DmpQueuePalletName: &'static str = "DmpQueue";
}

/// All migrations that will run on the next runtime upgrade.
///
/// Once done, migrations should be removed from the tuple.
pub type Migrations = (
// permanent migration, do not remove
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
// XCM V3 -> V4
pallet_xc_asset_config::migrations::versioned::V2ToV3<Runtime>,
pallet_identity::migration::versioned::V0ToV1<Runtime, 250>,
// dapp-staking dyn tier threshold migrations
pallet_dapp_staking_v3::migration::versioned_migrations::V7ToV8<Runtime, TierThresholds>,
frame_support::migrations::RemovePallet<
DmpQueuePalletName,
<Runtime as frame_system::Config>::DbWeight,
>,
pallet_contracts::Migration<Runtime>,
);

type EventRecord = frame_system::EventRecord<
Expand Down
13 changes: 0 additions & 13 deletions runtime/astar/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,19 +341,6 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
}

// TODO: This pallet should be removed after the lazy migration is done and
// event `Completed` is emitted.
// https://github.com/paritytech/polkadot-sdk/pull/1246
impl cumulus_pallet_dmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type DmpSink = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
/// The absolute location in perspective of the whole network.
pub AstarLocationAbsolute: Location = Location {
Expand Down
13 changes: 10 additions & 3 deletions runtime/shibuya/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ impl pallet_contracts::Config for Runtime {
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type Debug = ();
type Environment = ();
type Migrations = ();
type Migrations = (pallet_contracts::migration::v16::Migration<Runtime>,);
type Xcm = ();
type UploadOrigin = EnsureSigned<<Self as frame_system::Config>::AccountId>;
type InstantiateOrigin = EnsureSigned<<Self as frame_system::Config>::AccountId>;
Expand Down Expand Up @@ -1058,7 +1058,6 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
| RuntimeCall::XcmpQueue(..)
| RuntimeCall::PolkadotXcm(..)
| RuntimeCall::CumulusXcm(..)
| RuntimeCall::DmpQueue(..)
| RuntimeCall::XcAssetConfig(..)
// Skip entire EVM pallet
// Skip entire Ethereum pallet
Expand Down Expand Up @@ -1549,7 +1548,6 @@ construct_runtime!(
XcmpQueue: cumulus_pallet_xcmp_queue = 50,
PolkadotXcm: pallet_xcm = 51,
CumulusXcm: cumulus_pallet_xcm = 52,
DmpQueue: cumulus_pallet_dmp_queue = 53,
XcAssetConfig: pallet_xc_asset_config = 54,
XTokens: orml_xtokens = 55,
MessageQueue: pallet_message_queue = 56,
Expand Down Expand Up @@ -1638,6 +1636,10 @@ parameter_types! {
];
}

parameter_types! {
pub const DmpQueuePalletName: &'static str = "DmpQueue";
}

/// All migrations that will run on the next runtime upgrade.
///
/// Once done, migrations should be removed from the tuple.
Expand All @@ -1646,6 +1648,11 @@ pub type Migrations = (
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
// dapp-staking dyn tier threshold migrations
pallet_dapp_staking_v3::migration::versioned_migrations::V7ToV8<Runtime, TierThresholds>,
frame_support::migrations::RemovePallet<
DmpQueuePalletName,
<Runtime as frame_system::Config>::DbWeight,
>,
pallet_contracts::Migration<Runtime>,
);

type EventRecord = frame_system::EventRecord<
Expand Down
10 changes: 0 additions & 10 deletions runtime/shibuya/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,6 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type DmpSink = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
/// The absolute location in perspective of the whole network.
pub ShibuyaLocationAbsolute: Location = Location {
Expand Down
18 changes: 10 additions & 8 deletions runtime/shiden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ impl pallet_contracts::Config for Runtime {
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type Debug = ();
type Environment = ();
type Migrations = ();
type Migrations = (pallet_contracts::migration::v16::Migration<Runtime>,);
type Xcm = ();
type UploadOrigin = EnsureSigned<<Self as frame_system::Config>::AccountId>;
type InstantiateOrigin = EnsureSigned<<Self as frame_system::Config>::AccountId>;
Expand Down Expand Up @@ -1024,7 +1024,6 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
| RuntimeCall::XcmpQueue(..)
| RuntimeCall::PolkadotXcm(..)
| RuntimeCall::CumulusXcm(..)
| RuntimeCall::DmpQueue(..)
| RuntimeCall::XcAssetConfig(..)
// Skip entire EVM pallet
// Skip entire Ethereum pallet
Expand Down Expand Up @@ -1225,7 +1224,6 @@ construct_runtime!(
XcmpQueue: cumulus_pallet_xcmp_queue = 50,
PolkadotXcm: pallet_xcm = 51,
CumulusXcm: cumulus_pallet_xcm = 52,
DmpQueue: cumulus_pallet_dmp_queue = 53,
XcAssetConfig: pallet_xc_asset_config = 54,
XTokens: orml_xtokens = 55,
MessageQueue: pallet_message_queue = 56,
Expand Down Expand Up @@ -1297,18 +1295,22 @@ parameter_types! {
];
}

parameter_types! {
pub const DmpQueuePalletName: &'static str = "DmpQueue";
}

/// All migrations that will run on the next runtime upgrade.
///
/// Once done, migrations should be removed from the tuple.
pub type Migrations = (
cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4<Runtime>,
// permanent migration, do not remove
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
// XCM V3 -> V4
pallet_xc_asset_config::migrations::versioned::V2ToV3<Runtime>,
pallet_identity::migration::versioned::V0ToV1<Runtime, 250>,
// dapp-staking dyn tier threshold migrations
pallet_dapp_staking_v3::migration::versioned_migrations::V7ToV8<Runtime, TierThresholds>,
frame_support::migrations::RemovePallet<
DmpQueuePalletName,
<Runtime as frame_system::Config>::DbWeight,
>,
pallet_contracts::Migration<Runtime>,
);

type EventRecord = frame_system::EventRecord<
Expand Down
10 changes: 0 additions & 10 deletions runtime/shiden/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,6 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type DmpSink = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
/// The absolute location in perspective of the whole network.
pub ShidenLocationAbsolute: Location = Location {
Expand Down

0 comments on commit 16aa6eb

Please sign in to comment.