paritytech / paritytech/try-runtime-cli

`on-runtime-upgrade` does not run neither `pre_upgrade` nor `post_upgrade` without `--disable-mbm-checks`

Open
#109 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Neither of the following examples runs those hooks:
--checks=pre-and-post

try-runtime --runtime ./target/release/wbuild/bridge-hub-westend-runtime/bridge_hub_westend_runtime.compact.compressed.wasm on-runtime-upgrade --disable-spec-version-check --checks=pre-and-post --blocktime 6000 live --uri wss://westend-bridge-hub-rpc.polkadot.io

nor --checks=all

try-runtime --runtime ./target/release/wbuild/bridge-hub-westend-runtime/bridge_hub_westend_runtime.compact.compressed.wasm on-runtime-upgrade --disable-spec-version-check --checks=all --blocktime 6000 live --uri wss://westend-bridge-hub-rpc.polkadot.io

The pre_upgrade nor post_upgrade hooks are only triggered when I add --disable-mbm-checks. It could mean that for MBM migrations we don't check pre_upgrade / post_upgrade - maybe intentional?

But the consequence is that e.g. for polkadot-fellows we just run pre_upgrade / post_upgrade only for Encointer see: https://github.com/polkadot-fellows/runtimes/blob/main/.github/workflows/runtimes-matrix.json#L104.

I think it could be related to the https://github.com/paritytech/try-runtime-cli/blob/main/core/src/commands/on_runtime_upgrade/mod.rs#L135-L139

        let sync_checks = if command.disable_mbm_checks {
            command.checks
        } else {
            UpgradeCheckSelect::None
        };

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in core/src/commands/on_runtime_upgrade/mod.rs around the sync_checks assignment, then trace how --checks=pre-and-post and --checks=all are handled with and without --disable-mbm-checks. Reproduce the two commands against the provided runtime and live URI; done means the expected pre_upgrade and post_upgrade behavior is established and verified for MBM checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.