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

[Improvement] Make sure try-runtime executes migrations and their pre/post checks sequentially. #12295

@ruseinov

Description

@ruseinov

The problem:

When we have several migrations for the same pallet supplied for the runtime - their pre-update checks are being executed before any of the migrations, which means that at least storage version checks are failing. This makes it impossible to test several migrations at a time, which sometimes is a necessity and requires manual intervention.

Code example:

pub type Executive = frame_executive::Executive<
	Runtime,
	Block,
	frame_system::ChainContext<Runtime>,
	Runtime,
	AllPalletsWithSystem,
	(
		pallet_nomination_pools::migration::v3::MigrateToV3<Runtime>,
		pallet_staking::migrations::v11::MigrateToV11<
			Runtime,
			VoterList,
			StakingMigrationV11OldPallet,
		>,
		pallet_staking::migrations::v12::MigrateToV12<Runtime>, // THIS will fail due to failing pre-check, because the actual storage version will still be pre-v11. 
	),
>;

The solution:
We need to somehow make sure that the execution is sequential:

  1. pre-upgrade-v11, upgrade-v11, post-upgrade-v11
  2. pre-upgrade-v12, upgrade-v12, post-upgrade-v12

This needs further investigation to see how to make the scenario possible.

cc @kianenigma

Metadata

Metadata

Assignees

Labels

J0-enhancementAn additional feature request.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions