uptest-sc / uptest

"curl" for substrate runtime upgrade testing
7 stars 6 forks source link

[feature]Pallet migration wildsearch #64

Open flipchan opened 1 year ago

flipchan commented 1 year ago

Goal of this is to try to auto detect migrations that already exists in pallets.

Ideas: Git clone and do a wildsearch for "migrations" or "migrate"

Problem: No naming standard for storage migrations

flipchan commented 1 year ago

pallet migration search feature from usage future:

Pallet migration search

Now that we know that a new version of pallet "Scheduler" has been rolled out in the runtime upgrade, we want to see if the new version of the pallet comes with built in migrations:


$ uptest --migration-search Scheduler --migration-branch "polkadot-v0.9.32"
[debug] Searching for pallet Scheduler in https://github.com/paritytech/substrate/ branch polkadot-v0.9.32  
[debug] Found Pallet Scheduler Version: 4.0.0-dev
[debug] Pallet Scheduler contains migration.rs
Uptest found migrations v3 to v4 in Pallet Scheduler```
flipchan commented 1 year ago

spider is wip, will be pushed monday/tuesday

flipchan commented 1 year ago

https://github.com/uptest-sc/uptest/tree/migration_search, todo clean up and create tests

flipchan commented 1 year ago

$ cargo run -p uptest-examples --example migration_search_test

Starting search, looking for pallet-balances
Found crate: "pallet-balances"
Crates version is: 21.0.0
Downloading crate: "pallet-balances" version: "21.0.0"
crate downloaded ok
crate saved as pallet-balances-21.0.0.gzip
unziping file
file downloaded
Glob search with pallet-balances-21.0.0
found match: "fn migrate_v0_to_v1<T: Config<I>, I: 'static>(" in file: pallet-balances-21.0.0/src/migration.rs
All done
flipchan commented 1 year ago

https://github.com/uptest-sc/uptest/pull/66

flipchan commented 1 year ago

merged but not documented