Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pallet-migrations: try-runtime support, and manage author mapping bla…
…ke2 migration (#796) * Add initial migrations pallet sketch * Sketch out Migration impls * Make it build * Squelch warnings * Sketch out process_runtime_upgrades * Leave note for reviewers * Add &self to Migrations trait fns * Make it compile * Refactor migrations design to use stepping instead of one-shot * Fix typo/bug * Track overall migration doneness * Optimize when progress remains unchanged * Resolve compiler warnings * Incremental progress on mock * Mock is getting close * Make mock build * Plumb genesis building in mock * Baby's first tests * Fix events * Use Vec<u8> instead of String * Make MigrationsList part of pallet config; plumb through Moonbase runtime * Appease the compiler * Fix up CommonMigrations list * Remove comment * Cargo fmt * Per-test MigrationsList * Attempt at a glue * Fix FIXME * Getting close * Sort out lifetimes * Simplify FnMut arguments/storage * Clean up, fix FIXMEs * It works * Implement Migrations::on_initialize * Resolve compilation warnings, add comments about how mock glue works * Move migration event impl * Let tests manage ExtBuilder ... execute_with() * Test that migrations are only run once * Remove TODO/comment; events are not cheap and should be used conservatively * Post merge-master fixes * Remove cruft * Track some db reads and writes and charge accordingly * cargo fmt * Add failing test about one-migration-at-a-time * Don't start next migration until current is done * Add notes from meeting * Allow multi-block migrations to be disabled * Add failing test about overweight migrations * Explicitly embrace allowing overweight migrations * cargo fmt * Clean up / add comments * Derive block weight from Config (still needs improvement) * cargo fmt * Configure all runtimes to include pallet-migrations * Add pallet-migrations genesis to specs * Update pallets/migrations/src/lib.rs Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com> * Update pallets/migrations/src/lib.rs Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com> * First pass at ripping out multi-block migration support * Incremental work @ removing multi-block migration support * Make migration tests compile (not passing yet) * Clean up runtime to reflect removal of multi-block migrations * You know your tests are good when they catch a critical refactor mistake * Fix test logic to reflect no multi-block migrations * cargo fmt * Remove phantomdata field from pallet_migrations::GenesisConfig (#701) * remove phantomdata from pallet migrations genesis config struct * skip migration if no weight available for step * revert * Better log statement Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * Use ValueQuery instead of OptionQuery * Update Cargo.lock * Manually add back version = 3 * Make some deps dev-dependencies * Fix branch * Use hotfix branch in Migrations * Clean up from merge * cargo fmt * Remove prior hack in test * Initial concept of try-runtime support for pallet-migrations * Impl for post_upgrade() * Extend tests to work with pre_ and post_upgrade hooks * Explicitly invoke try-runtime hooks in tests * Leave hint about which migrations are performed for post_upgrade * cargo fmt * Add pallet-migration's try-runtime feature to all runtimes * fix warnings * Move autho mapping migration to dedicated type * brain dump * Make author hasher migration compatible with pallet migrations. * Condense code Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com> * Only run try-runtime tests with --features=try-runtime * Add missing import * Add try-runtime-only imports * Hook AuthorMapping migration up to common migrations * Actually hook it up... also, trait bounds * cargo fmt * Remove accidental .cargo/config.toml addition * better logging * bump spec version for testing purposes * cleanups * line length * std feature Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com> Co-authored-by: Amar Singh <asinghchrony@protonmail.com> Co-authored-by: Joshy Orndorff <admin@joshyorndorff.com> Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
- Loading branch information