paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Name standard for pallet's storage migrations functions? #14609

Open flipchan opened 1 year ago

flipchan commented 1 year ago

Is there an existing issue?

Experiencing problems? Have you tried our Stack Exchange first?

Motivation

I'm currently working on a way to "auto find" storage migrations that have already been implemented for pallets. Github issue: https://github.com/uptest-sc/uptest/issues/64

Request

Hello Everyone,

I'm currently trying to make a feature for

It would be amazing if there could be a naming standard or a recommended function name format for storage migrations. As of today their is no "rfc"-like standard for naming the functions that trigger storage migrations. For examples, pallet-balances v0 -> v1: migration_balances_v01.rs

Is their any naming guide lines for naming migration functions at the moment?

Moderator: If this issue belongs more on stackexchange, let me know and I shall move it. I thought this would be best suited to post here.

Thanks

Solution

No response

Are you willing to help with this request?

Yes!

ggwpez commented 1 year ago

What? Old migrations are deleted from the code-base. The way to check if a pallet is migrated to the latest version is to compare its code-version to the on-chain version. If they differ then a migration is missing.
Searching through the source code by grepping strings is not going to do this.