Skip to content

Commit 375dc46

Browse files
PolkadotDomrockbmb
andauthored
Add readme info for calling pre & post checks (#106)
While writing and testing my first migration, it took me a while to realize the hooks for UncheckedOnRuntimeUpgrade::pre_upgrade/post_upgrade weren't running due to the --disable-mbm-checks flag not being set. This PR adds a bit of extra information to the readme that would have been helpful. See code - [flag logic](https://github.com/paritytech/try-runtime-cli/blob/b45be7dfce89fd881be27171d3ea114ef19d832c/core/src/commands/on_runtime_upgrade/mod.rs#L135) Introduced in #90 @liamaharon --------- Co-authored-by: Alexandre R. Baldé <alexandrer_b@outlook.com>
1 parent f3b0c82 commit 375dc46

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ after the migration. [`OnRuntimeUpgrade::pre_upgrade`] returns a [`Vec<u8>`] tha
135135
arbitrary encoded data (usually some pre-upgrade state) which will be passed to
136136
[`OnRuntimeUpgrade::pre_upgrade`] after upgrading and used for post checking.
137137

138+
**Note on Multi-Block Migrations (MBM):** If the runtime uses MBMs, the standard
139+
`pre_upgrade` and `post_upgrade` checks might be skipped by the executive. To
140+
force these hooks to run synchronously for testing, use the `--disable-mbm-checks` flag.
141+
138142
### [`VersionedMigration`]
139143

140144
It is strongly suggested to use [`VersionedMigration`] when writing custom migrations for
@@ -182,6 +186,8 @@ cargo build --features try-runtime --release && cp target/release/substrate .
182186
try-runtime \
183187
--runtime /path-to-substrate/target/release/wbuild/my-runtime.wasm \
184188
on-runtime-upgrade \
189+
# Passing this flag will skip multi-block-migration checks and only run pre_upgrade/post_upgrade checks.
190+
--disable-mbm-checks \
185191
live --uri ws://localhost:9999
186192
```
187193

0 commit comments

Comments
 (0)