Skip to content

Improve Migration Support #353

@apopiak

Description

@apopiak

Teams building chains on Substrate are struggling with migrating their nodes and runtimes. We want to improve the migration experience to reduce necessary effort and time spent as well as reduce the amount of effort it takes to migrate Substrate based chains.

💔 Status Quo

Currently Parity core developers write migrations in Substrate for Kusama and Polkadot. They are then removed within one to a few weeks of being introduced (in order to keep the codebase clean). Chain developers building on Substrate either a) apply these migrations the same way in a timely fashion or b) need to fork Substrate to modify and adjust the migrations or reintroduce them if they have been removed in the meantime.

Substrate users need to go into Substrate's PR listing and filter for runtime migrations in order to find the migrations.

🛑 Current Problems

  • Users are confused about migrations:
    • where to find them (different locations, formatting, buried in history)
    • when to migrate (on new Substrate release? at a fixed interval?)
    • "Will this upgrade work for my chain?"
  • Users need to do lots of manual work for migrations.
    • Especially when deciding to upgrade later than Kusama the manual work compounds with the confusion.
  • Users have trouble testing migrations.
  • Users cannot roll back migrations.

👓 Vision

We want Substrate users to be able to migrate their chains correctly as easily as possible.

As a result, we want migrations to be:

  • Correct: Migrations should leave the chain in a correct state after the migration.
    • Testable: It should be possible to determine whether they run correctly.
    • Composable: Running several migrations one after another should not corrupt state.
  • Discoverable: Migrations should be discoverable when users want to apply them or use them as inspiration for their own migration.
  • Documented: Migrations should list assumptions so that users can verify whether they will work for their chain.
  • Reusable: Migrations (especially simple ones) should be reusable so they can be applied to many chains and don't need to be rewritten.
    • Easy and Automatic: Simple migrations should just work™ without a lot of manual integration.

❎ Non-Goals

Complicated Migrations ≠ Easy and Automatic

We cannot make complicated migrations or migrations affecting many parts of the runtime effortless. There will always be manual work necessary for these cases. We can only provide guidance.

Maintaining Old Migrations

We will not maintain old migrations. Migrations target the transition from one version to another and will thus be outdated once applied. We can only keep documentation and code archives around for (very) old migrations.

✅ Proposed Solutions

Metadata

Metadata

Assignees

No one assigned

    Labels

    I5-enhancementAn additional feature request.I6-metaA specific issue for grouping tasks or bugs of a specific category.T1-FRAMEThis PR/Issue is related to core FRAME, the framework.

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions