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

🏗️ Release migrations #252

Merged
merged 2 commits into from
Apr 22, 2024
Merged

🏗️ Release migrations #252

merged 2 commits into from
Apr 22, 2024

Conversation

lrazovic
Copy link
Member

@lrazovic lrazovic commented Apr 19, 2024

What?

  • Set the DmpQueue version to latest (2).
  • Remove migrations already released.
  • Bump the spec-version, so we can use the try-runtime-cli to test the new runtimes.

Why?

Testing

[2024-04-19T14:33:35Z INFO  remote-ext] replacing wss:// in uri with https://: "https://rpc.polimec.org:443" (ws is currently unstable for fetching remote storage, for more see https://github.com/paritytech/jsonrpsee/issues/1086)
[2024-04-19T14:33:36Z INFO  remote-ext] since no at is provided, setting it to latest finalized head, 0x332a6845b06275a10e53d99d3bc0e9e25f041cea283f2d613af3ca94c46c4e97
[2024-04-19T14:33:36Z INFO  remote-ext] since no prefix is filtered, the data for all pallets will be downloaded
[2024-04-19T14:33:36Z INFO  remote-ext] scraping key-pairs from remote at block height 0x332a6845b06275a10e53d99d3bc0e9e25f041cea283f2d613af3ca94c46c4e97
✅ Found 6986 keys (0.24s)
[00:00:00] ✅ Downloaded key values 9,611.6312/s [=====================================================================================================] 6986/6986 (0s)
✅ Inserted keys into DB (0.01s)
[2024-04-19T14:33:37Z INFO  remote-ext] adding data for hashed prefix: , took 1.13s
[2024-04-19T14:33:37Z INFO  remote-ext] adding data for hashed key: 3a636f6465
[2024-04-19T14:33:37Z INFO  remote-ext] adding data for hashed key: 26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8
[2024-04-19T14:33:37Z INFO  remote-ext] adding data for hashed key: 26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac
[2024-04-19T14:33:37Z INFO  remote-ext] 👩‍👦 no child roots found to scrape
[2024-04-19T14:33:37Z INFO  remote-ext] initialized state externalities with storage root 0x86883dad7cde00321e404d462da78f9130b3bfedca824588046302110d8975a5 and state_version V1
[2024-04-19T14:33:37Z INFO  try-runtime::cli] Original runtime [Name: RuntimeString::Owned("polimec-mainnet")] [Version: 6000] [Code hash: 0x31e2...058d]
[2024-04-19T14:33:37Z INFO  try-runtime::cli] New runtime      [Name: RuntimeString::Owned("polimec-mainnet")] [Version: 6001] [Code hash: 0xd8da...5ec8]
[2024-04-19T14:33:37Z INFO  try-runtime::cli] 🚀 Speed up your workflow by using snapshots instead of live state. See `try-runtime create-snapshot --help`.
[2024-04-19T14:33:37Z INFO  try_runtime_core::misc] ------------------------------------------------------------------


[2024-04-19T14:33:37Z INFO  try_runtime_core::misc] 🔬 Running TryRuntime_on_runtime_upgrade with checks: PreAndPost


[2024-04-19T14:33:37Z INFO  try_runtime_core::misc] ------------------------------------------------------------------


[2024-04-19T14:33:37Z INFO  polimec_runtime::custom_migrations::init_pallet] DmpQueue migrating from StorageVersion(
        0,
    )
[2024-04-19T14:33:37Z INFO  polimec_runtime::custom_migrations::init_pallet] DmpQueue migrated to StorageVersion(
        2,
    )
[2024-04-19T14:33:37Z INFO  runtime::executive] ✅ Entire runtime state decodes without error. 408348 bytes total.
[2024-04-19T14:33:37Z INFO  try_runtime_core::misc] ------------------------------------------------------------------------------------------------------


[2024-04-19T14:33:37Z INFO  try_runtime_core::misc] 🔬 TryRuntime_on_runtime_upgrade succeeded! Running it again without checks for weight measurements.


[2024-04-19T14:33:37Z INFO  try_runtime_core::misc] ------------------------------------------------------------------------------------------------------


[2024-04-19T14:33:37Z INFO  try_runtime_core::misc] ---------------------------------------------------------------------------------


[2024-04-19T14:33:37Z INFO  try_runtime_core::misc] 🔬 Running TryRuntime_on_runtime_upgrade again to check idempotency: PreAndPost


[2024-04-19T14:33:37Z INFO  try_runtime_core::misc] ---------------------------------------------------------------------------------


[2024-04-19T14:33:37Z INFO  polimec_runtime::custom_migrations::init_pallet] DmpQueue migrating from StorageVersion(
        2,
    )
[2024-04-19T14:33:37Z INFO  polimec_runtime::custom_migrations::init_pallet] DmpQueue migrated to StorageVersion(
        2,
    )
[2024-04-19T14:33:37Z INFO  runtime::executive] ✅ Entire runtime state decodes without error. 408348 bytes total.
[2024-04-19T14:33:37Z INFO  try-runtime::cli] PoV size (zstd-compressed compact proof): 5.4 KB. For parachains, it's your responsibility to verify that a PoV of this size fits within any relaychain constraints.
[2024-04-19T14:33:37Z INFO  try-runtime::cli] Consumed ref_time: 0.000925s (0.19% of max 0.5s)
[2024-04-19T14:33:37Z INFO  try-runtime::cli] ✅ No weight safety issues detected. Please note this does not guarantee a successful runtime upgrade. Always test your runtime upgrade with recent state, and ensure that the weight usage of your migrations will not drastically differ between testing and actual on-chain execution.

@lrazovic lrazovic self-assigned this Apr 19, 2024
Copy link
Contributor

@JuaniRios JuaniRios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If InitializePallet struct doesn't initialize it, but updates the on-chain pallet version then maybe let's rename it?

@lrazovic
Copy link
Member Author

If InitializePallet struct doesn't initialize it, but updates the on-chain pallet version then maybe let's rename it?

I believe the idea behind the struct name is that we should use it every time we add a new pallet with a storage version different from 0. That's why @vstam1 went with "initialize" - but it is just a name, if we think it is not correct we can always change it.

@vstam1
Copy link
Collaborator

vstam1 commented Apr 22, 2024

I don't think we need this anymore after the 1.6 upgrade, as Substrate does the initialisation itself now!

@JuaniRios
Copy link
Contributor

I don't think we need this anymore after the 1.6 upgrade, as Substrate does the initialisation itself now!

We still need it for setting the version to the latest if it wasn't properly set when adding the pallet right?
So maybe we can rename it to SetPalletVersionToLatest or something like that since like you mentioned from now on the setting version on initialization is gonna be done automatically

@vstam1
Copy link
Collaborator

vstam1 commented Apr 22, 2024

I think it should do that as well, if the latest version is defined in the pallet? Maybe not, but we could probably investigate with try-runtime?

Copy link
Contributor

@JuaniRios JuaniRios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave it up to you @lrazovic if you wanna change anything based in our comments. It is already good as is to merge IMO

@JuaniRios JuaniRios merged commit e4f7eaf into main Apr 22, 2024
@JuaniRios JuaniRios deleted the leo/release-migrations branch April 22, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants