Skip to content

apopiak/substrate-migrations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 

Repository files navigation

Substrate Migrations

A repository of Substrate runtime migrations.

Contributing

Feel free to open PRs to include your own examples of applying Substrate migrations and/or notes.

Links

Relevant PRs


FRAME Migrations

This lists PRs that include or induce storage migrations in FRAME pallets after Substrate 2.0 with some examples of how they were implemented in production chains.

2021-12-18 Add ClassAccount Storage to pallet-uniques

paritytech/substrate#9940

2021-12-11 Preimage Registrar and Scheduler Integration

paritytech/substrate#10356

2021-12-7 Add Storage Deposits in pallet-contracts

paritytech/substrate#10082

2021-09-17 Implement pallet-bags-list and its Interfaces with pallet-staking

paritytech/substrate#9507

Examples

2021-09-06 Remove State Rent in pallet-contracts

paritytech/substrate#9669

2021-07-21 Move PalletVersion Away from Crate Version

Moves from using the Rust crate version to a dedicated version number for the pallet storage version.

paritytech/substrate#9165

See paritytech/substrate#9165 (comment) for how to execute the resulting storage migration.

Examples

2021-06-16 Add Control to Growth of the Staking Pallet

Introduces counts for the nominators and validators.

paritytech/substrate#8920

2021-05-28 Simple MaxBoundedLen Implementations

Two potential reasons for migrations:

  1. The assets and proxy pallets now use BoundedVec, so if the storage contains entries that overshoot the configured StringLimit for assets or MaxProxies for proxy they will need a migration.
  2. The time delayed proxies migration function was removed.

paritytech/substrate#8793

2021-05-13 Contracts: Move Schedule from Storage to Config

Removes the contracts pallet's schedule from storage and puts it in the pallet configuration instead.

paritytech/substrate#8773

2021-05-03 Remove Offence Delay

paritytech/substrate#8414

2021-03-20 Decouple Staking and Election - Part 2.1: Unleash Multi Phase

paritytech/substrate#8113

Examples

2021-03-12 Update Contracts Schedule to v3

paritytech/substrate#8231

2021-03-10 Babe Epoch Configurations

paritytech/substrate#8072

Examples

2021-03-03 Self-Sufficient Ref-Counting

paritytech/substrate#8221

Required for: paritytech/substrate#8220

2021-02-10 Substrate v3.0.0

2021 Migrate FRAME Pallets to Procedural #[pallet] Macro

Using the procedural macro shifts the storage prefix from the decl_storage macro invocation to the pallet instantiation in the construct_runtime macro. As a result migrations to the new macro do not inherently require a migration, but might incidentally create the necessity if care is not taken to make sure that the prefix stays the same.

PRs porting pallets to the new procedural macro that were merged in 2021 are listed here:

2021-01-20 Fix Phragmen and Proxy Issue

paritytech/substrate#7040

Examples

2021-01-20 Nominator Set Kicking & Blocking

paritytech/substrate#7930

2020-10-21 Pallet Storage Versions

Should not require any manual code as the version is updated automatically on every on_runtime_upgrade.

paritytech/substrate#7208

2020-09-24 Time-Delay Proxies Migration Fix

Note: If using the introduced migration function, you should use storage version guards to make sure it only runs once.

paritytech/substrate#7205

2020-09-22 Substrate v2.0.0

Pre 2.0 Migrations

This lists PRs that include or induce storage migrations before Substrate 2.0 with some examples of how they were implemented in production chains.

2020-09-22 Move Account Refcounts from u8 to u32

paritytech/substrate#7164

2020-09-22 Allow Specifying Fixed Index in construct_runtime

paritytech/substrate#6969

Examples

2020-08-23 Time-Delay Proxies

Warning: This migration is missing a storage guard so it might be applied more than once if included in more than one runtime uprade. Use the extracted migration from paritytech/substrate#7205 in combination with a storage guard if running this migration.

paritytech/substrate#6770

2020-07-02 Allow Specifying Dispatch Origin

Note: A migration function is provided, but you will need to manually trigger this migration if it applies to your runtime.

paritytech/substrate#6387

2020-06-17 Next Fee Multiplier

paritytech/substrate#6334

Examples

2020-06-09 Frozen Indices

paritytech/substrate#6307

Examples

2020-06-08 Stacked Filtering

Introduces multisigs pallet.

paritytech/substrate#6273

Examples

2020-06-05 Staking Remove MigrateEra Storage Item

paritytech/substrate#6253

2020-05-15 Democracy Weights

Flips the deposit order of fields.

paritytech/substrate#5828

Examples

2020-04-24 Staking Migration Version Check Fix

paritytech/substrate#5768

2020-04-17 Fee Multiplier

paritytech/substrate#5673

Examples

2020-04-04 Simple Staking Payouts

paritytech/substrate#5406

Examples

2020-03-26 Time Module Usage in Staking

paritytech/substrate#4662

2020-03-26 Scheduler Introduction

and democracy refactoring. No migration in Substrate, but might require one for chains using the pallet.

paritytech/substrate#5412

Examples

2020-03-23 Democracy Prime Member Selection

paritytech/substrate#5346

Examples

2020-03-21 Democracy Redesign

paritytech/substrate#5294

Examples


2020-03-16 Hasher Migration (Iterable Storage Maps)

NOTE: If included will influence how other migrations are run. (Pre-hasher migrations cannot iterate storage easily.)

paritytech/substrate#5226

Examples


2020-03-14 Unique Storage Names

paritytech/substrate#5010

Examples

2020-03-05 Introduce on_runtime_upgrade

paritytech/substrate#5058 (includes balances migration, removed in paritytech/substrate#5224)

2020-03-03 Lazy Payouts

paritytech/substrate#4474

Examples

2020-02-24 Lazy Reaping

paritytech/substrate#4895

Examples

2020-02-14 Composite Accounts

paritytech/substrate#4820) (includes indices migration removed in paritytech/substrate#5870)

Examples

2020-02-01 Balances Refactor

paritytech/substrate#4649

Examples

Removed Migrations

This lists the PRs that removed migration code from Substrate.

2020-06-23

Democracy, Indices, Multisigs, Staking, Transaction Payment

paritytech/substrate#6476

2020-05-03

Democracy, Indices, Offences, Staking, Transaction Payment

paritytech/substrate#5870

2020-03-19

Mostly account/hasher migration, epochs, opaque hashers, grandpa authorities

paritytech/substrate#5291

2020-03-12

Balances

paritytech/substrate#5224


Non-FRAME Migrations

2021-03-07 Put initial data to storage with pallet deployment

Uses PalletVersion to determine that pallet was not present before to do initial migration of data to storage.

2021-03-07 Update storage type from Vec to OrderedSet

Uses PalletVersion

About

A repository of Substrate runtime migrations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published