Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pallet-migrations Initial Implementation #527

Merged
merged 84 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
9ecdc74
Add initial migrations pallet sketch
notlesh Jun 21, 2021
e4f15ce
Sketch out Migration impls
notlesh Jun 25, 2021
ca3620e
Make it build
notlesh Jun 25, 2021
cdc042a
Squelch warnings
notlesh Jun 25, 2021
c4204b4
Sketch out process_runtime_upgrades
notlesh Jun 25, 2021
0cc885d
Leave note for reviewers
notlesh Jun 25, 2021
95308a1
Add &self to Migrations trait fns
notlesh Jun 28, 2021
93b96ce
Make it compile
notlesh Jun 28, 2021
275531c
Refactor migrations design to use stepping instead of one-shot
notlesh Jun 28, 2021
d5abf1f
Fix typo/bug
notlesh Jun 28, 2021
d25ffc1
Track overall migration doneness
notlesh Jun 28, 2021
0c9ce74
Optimize when progress remains unchanged
notlesh Jun 28, 2021
23837f8
Resolve compiler warnings
notlesh Jun 29, 2021
85ecaa1
Incremental progress on mock
notlesh Jun 29, 2021
f22ce8d
Mock is getting close
notlesh Jun 29, 2021
d8d2c3c
Make mock build
notlesh Jun 29, 2021
bfd24f6
Plumb genesis building in mock
notlesh Jun 30, 2021
9404fbe
Baby's first tests
notlesh Jun 30, 2021
edee830
Fix events
notlesh Jun 30, 2021
d13a471
Use Vec<u8> instead of String
notlesh Jun 30, 2021
986433e
Make MigrationsList part of pallet config; plumb through Moonbase run…
notlesh Jul 1, 2021
92047ee
Appease the compiler
notlesh Jul 1, 2021
b885fc5
Fix up CommonMigrations list
notlesh Jul 1, 2021
aefb302
Remove comment
notlesh Jul 1, 2021
f9f8a2a
Cargo fmt
notlesh Jul 1, 2021
bc2e538
Per-test MigrationsList
notlesh Jul 1, 2021
19a9912
Attempt at a glue
notlesh Jul 3, 2021
1f70d01
Fix FIXME
notlesh Jul 3, 2021
6e581f3
Getting close
notlesh Jul 3, 2021
2ea1e3b
Sort out lifetimes
notlesh Jul 3, 2021
4afc532
Simplify FnMut arguments/storage
notlesh Jul 6, 2021
85ed484
Clean up, fix FIXMEs
notlesh Jul 6, 2021
e377caf
It works
notlesh Jul 7, 2021
95d6b95
Implement Migrations::on_initialize
notlesh Jul 7, 2021
d5da28a
Resolve compilation warnings, add comments about how mock glue works
notlesh Jul 7, 2021
2c0bfe5
Move migration event impl
notlesh Jul 7, 2021
67bede2
Let tests manage ExtBuilder ... execute_with()
notlesh Jul 8, 2021
f924112
Test that migrations are only run once
notlesh Jul 8, 2021
5022dcc
Remove TODO/comment; events are not cheap and should be used conserva…
notlesh Jul 8, 2021
8a925ac
Merge branch 'master' into notlesh-migration-sketch
notlesh Jul 19, 2021
a2177dd
Post merge-master fixes
notlesh Jul 19, 2021
01727f8
Remove cruft
notlesh Jul 19, 2021
8ed861f
Track some db reads and writes and charge accordingly
notlesh Jul 19, 2021
0785e48
cargo fmt
notlesh Jul 20, 2021
8c444e7
Add failing test about one-migration-at-a-time
notlesh Jul 21, 2021
2e12fd2
Don't start next migration until current is done
notlesh Jul 21, 2021
9a9bfd4
Add notes from meeting
notlesh Jul 22, 2021
2744571
Allow multi-block migrations to be disabled
notlesh Jul 22, 2021
e1f49c6
Add failing test about overweight migrations
notlesh Jul 22, 2021
0684874
Explicitly embrace allowing overweight migrations
notlesh Jul 22, 2021
c19a4a1
cargo fmt
notlesh Jul 22, 2021
7d57a4e
Clean up / add comments
notlesh Jul 26, 2021
3f87f79
Derive block weight from Config (still needs improvement)
notlesh Jul 26, 2021
595e865
Merge branch 'master' into notlesh-migration-sketch
notlesh Jul 26, 2021
8f6e9e5
cargo fmt
notlesh Jul 26, 2021
a4e2acc
Configure all runtimes to include pallet-migrations
notlesh Jul 26, 2021
41e9d0b
Add pallet-migrations genesis to specs
notlesh Jul 26, 2021
0a3ae7e
Update pallets/migrations/src/lib.rs
notlesh Jul 29, 2021
26ef7db
Update pallets/migrations/src/lib.rs
notlesh Jul 29, 2021
e6543e6
First pass at ripping out multi-block migration support
notlesh Aug 13, 2021
01bc09f
Incremental work @ removing multi-block migration support
notlesh Aug 13, 2021
d2e5759
Make migration tests compile (not passing yet)
notlesh Aug 13, 2021
38ee3a4
Clean up runtime to reflect removal of multi-block migrations
notlesh Aug 17, 2021
30033ee
You know your tests are good when they catch a critical refactor mistake
notlesh Aug 17, 2021
dfb6f42
Fix test logic to reflect no multi-block migrations
notlesh Aug 17, 2021
f691977
cargo fmt
notlesh Aug 17, 2021
dc42819
Remove phantomdata field from pallet_migrations::GenesisConfig (#701)
4meta5 Aug 18, 2021
f31807a
Better log statement
notlesh Aug 18, 2021
607e0ee
Use ValueQuery instead of OptionQuery
notlesh Aug 18, 2021
3e9c26b
Merge branch 'master' into notlesh-migration-sketch
notlesh Aug 18, 2021
91f92f7
Update Cargo.lock
notlesh Aug 18, 2021
c0e6167
Manually add back version = 3
notlesh Aug 18, 2021
d9e561b
Make some deps dev-dependencies
notlesh Aug 18, 2021
3722eaf
Merge branch 'master' into notlesh-migration-sketch
notlesh Sep 8, 2021
a585e3c
Fix branch
notlesh Sep 8, 2021
bdafb76
Use hotfix branch in Migrations
notlesh Sep 8, 2021
9d27292
Clean up from merge
notlesh Sep 8, 2021
e346883
cargo fmt
notlesh Sep 8, 2021
3cb8bb4
Remove prior hack in test
notlesh Sep 8, 2021
99ca061
cargo.lock
JoshOrndorff Sep 16, 2021
62eb821
Merge branch 'master' into notlesh-migration-sketch
JoshOrndorff Sep 16, 2021
cf735f9
fix warning
JoshOrndorff Sep 16, 2021
fd0a165
minor cleaning in cargo.toml
JoshOrndorff Sep 16, 2021
3bcfce5
clean up cargo.ttoml
JoshOrndorff Sep 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
'node',
'node/cli',
'node/service',
'pallets/migrations',
'bin/utils/moonkey',
]
exclude = [
Expand Down
1 change: 1 addition & 0 deletions node/service/src/chain_spec/moonbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ pub fn testnet_genesis(
.collect(),
},
treasury: Default::default(),
migrations: Default::default(),
}
}

Expand Down
1 change: 1 addition & 0 deletions node/service/src/chain_spec/moonbeam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ pub fn testnet_genesis(
.collect(),
},
treasury: Default::default(),
migrations: Default::default(),
}
}

Expand Down
1 change: 1 addition & 0 deletions node/service/src/chain_spec/moonriver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ pub fn testnet_genesis(
.collect(),
},
treasury: Default::default(),
migrations: Default::default(),
}
}

Expand Down
1 change: 1 addition & 0 deletions node/service/src/chain_spec/moonshadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ pub fn testnet_genesis(
.collect(),
},
treasury: Default::default(),
migrations: Default::default(),
}
}

Expand Down
29 changes: 29 additions & 0 deletions pallets/migrations/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "pallet-migrations"
version = "0.1.0"
authors = ["PureStake"]
edition = "2018"
description = "migrations management pallet"

[dependencies]
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
log = "0.4"
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
parity-scale-codec = { version = "2.0.0", default-features = false }
environmental = { version = "1.1.2", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false }
notlesh marked this conversation as resolved.
Show resolved Hide resolved

[features]
default = ["std"]
std = [
"frame-support/std",
"frame-system/std",
"sp-std/std",
"sp-runtime/std",
"sp-io/std",
"sp-core/std",
"environmental/std",
]
Loading