Skip to content

Commit 65b296a

Browse files
authored
Bump SemVer after parallelized remote externality retrieval update (#131)
After #130, docs need to be updated, and the `README` regenerated. This also bumps the version to `0.10.1`
1 parent a490f2f commit 65b296a

4 files changed

Lines changed: 69 additions & 15 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resolver = "2"
44
members = ["cli", "core"]
55

66
[workspace.package]
7-
version = "0.9.1"
7+
version = "0.10.1"
88
authors = ["Parity Technologies <admin@parity.io>"]
99
description = "Substrate's programmatic testing framework."
1010
edition = "2021"

README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Some resources about the above:
2626

2727
The basis of all try-runtime commands is the same: connect to a live node, scrape its *state*
2828
and put it inside a [`TestExternalities`], then call into a *specific runtime-api* using the
29-
given state and some *runtime*.
29+
given state and some *runtime*. Multiple node URIs can be provided to enable parallel state
30+
downloads for improved performance.
3031

3132
Alternatively, the state could come from a snapshot file.
3233

@@ -182,18 +183,35 @@ cargo build --features try-runtime --release && cp target/release/substrate .
182183
* Run the migrations of a given runtime on top of a live state.
183184

184185
```bash
185-
# assuming there's `./substrate --dev --tmp --ws-port 9999` or similar running.
186+
# Assuming local nodes are running (e.g., `./substrate --dev --tmp --ws-port 9999`).
187+
# Multiple --uri flags can be provided for parallel state download.
186188
try-runtime \
187189
--runtime /path-to-substrate/target/release/wbuild/my-runtime.wasm \
188190
on-runtime-upgrade \
189-
# Passing this flag will skip multi-block-migration checks and only run pre_upgrade/post_upgrade checks.
190191
--disable-mbm-checks \
191-
live --uri ws://localhost:9999
192+
live \
193+
--uri ws://localhost:9999 \
194+
--uri ws://localhost:9998
195+
...
196+
```
197+
198+
To speed up state download, you can provide multiple URIs for parallel fetching:
199+
200+
```bash
201+
# assuming multiple substrate nodes running on ports 9999, 9998, 9997
202+
try-runtime \
203+
--runtime /path-to-substrate/target/release/wbuild/my-runtime.wasm \
204+
on-runtime-upgrade \
205+
live \
206+
--uri ws://localhost:9999 \
207+
--uri ws://localhost:9998 \
208+
--uri ws://localhost:9997
192209
```
193210

194211
* Same as the previous example, but run it at specific block number's state and using the live
195212
polkadot network. This means that this block hash's state should not yet have been pruned by
196-
the node running at `rpc.polkadot.io`.
213+
the node running at `rpc.polkadot.io`. Multiple `--uri` flags can be provided for parallel
214+
state download.
197215

198216
```bash
199217
try-runtime \
@@ -207,13 +225,22 @@ try-runtime \
207225
* Now, let's use a snapshot file. First, we create the snapshot:
208226

209227
```bash
210-
try-runtime --runtime existing create-snapshot --uri ws://localhost:9999 my-snapshot.snap
228+
try-runtime --runtime existing create-snapshot --uri ws://localhost:9999 -- my-snapshot.snap
211229
2022-12-13 10:28:17.516 INFO main remote-ext: since no at is provided, setting it to latest finalized head, 0xe7d0b614dfe89af65b33577aae46a6f958c974bf52f8a5e865a0f4faeb578d22
212230
2022-12-13 10:28:17.516 INFO main remote-ext: since no prefix is filtered, the data for all pallets will be downloaded
213231
2022-12-13 10:28:17.550 INFO main remote-ext: writing snapshot of 1611464 bytes to "node-268@latest.snap"
214232
2022-12-13 10:28:17.551 INFO main remote-ext: initialized state externalities with storage root 0x925e4e95de4c08474fb7f976c4472fa9b8a1091619cd7820a793bf796ee6d932 and state_version V1
215233
```
216234

235+
For faster snapshot creation with large state, use multiple RPC endpoints:
236+
237+
```bash
238+
try-runtime --runtime existing create-snapshot \
239+
--uri ws://localhost:9999 \
240+
--uri ws://localhost:9998 \
241+
-- my-snapshot.snap
242+
```
243+
217244
> Note that the snapshot contains the `existing` runtime, which does not have the correct
218245
> `try-runtime` feature. In the following commands, we still need to overwrite the runtime.
219246

cli/main.rs

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
//!
4242
//! The basis of all try-runtime commands is the same: connect to a live node, scrape its *state*
4343
//! and put it inside a [`TestExternalities`], then call into a *specific runtime-api* using the
44-
//! given state and some *runtime*.
44+
//! given state and some *runtime*. Multiple node URIs can be provided to enable parallel state
45+
//! downloads for improved performance.
4546
//!
4647
//! Alternatively, the state could come from a snapshot file.
4748
//!
@@ -198,18 +199,35 @@
198199
//! * Run the migrations of a given runtime on top of a live state.
199200
//!
200201
//! ```bash
201-
//! # assuming there's `./substrate --dev --tmp --ws-port 9999` or similar running.
202+
//! # Assuming local nodes are running (e.g., `./substrate --dev --tmp --ws-port 9999`).
203+
//! # Multiple --uri flags can be provided for parallel state download.
202204
//! try-runtime \
203205
//! --runtime /path-to-substrate/target/release/wbuild/my-runtime.wasm \
204206
//! on-runtime-upgrade \
205-
//! # Passing this flag will skip multi-block-migration checks and only run pre_upgrade/post_upgrade checks.
206207
//! --disable-mbm-checks \
207-
//! live --uri ws://localhost:9999
208+
//! live \
209+
//! --uri ws://localhost:9999 \
210+
//! --uri ws://localhost:9998
211+
//! ...
212+
//! ```
213+
//!
214+
//! To speed up state download, you can provide multiple URIs for parallel fetching:
215+
//!
216+
//! ```bash
217+
//! # assuming multiple substrate nodes running on ports 9999, 9998, 9997
218+
//! try-runtime \
219+
//! --runtime /path-to-substrate/target/release/wbuild/my-runtime.wasm \
220+
//! on-runtime-upgrade \
221+
//! live \
222+
//! --uri ws://localhost:9999 \
223+
//! --uri ws://localhost:9998 \
224+
//! --uri ws://localhost:9997
208225
//! ```
209226
//!
210227
//! * Same as the previous example, but run it at specific block number's state and using the live
211228
//! polkadot network. This means that this block hash's state should not yet have been pruned by
212-
//! the node running at `rpc.polkadot.io`.
229+
//! the node running at `rpc.polkadot.io`. Multiple `--uri` flags can be provided for parallel
230+
//! state download.
213231
//!
214232
//! ```bash
215233
//! try-runtime \
@@ -223,13 +241,22 @@
223241
//! * Now, let's use a snapshot file. First, we create the snapshot:
224242
//!
225243
//! ```bash
226-
//! try-runtime --runtime existing create-snapshot --uri ws://localhost:9999 my-snapshot.snap
244+
//! try-runtime --runtime existing create-snapshot --uri ws://localhost:9999 -- my-snapshot.snap
227245
//! 2022-12-13 10:28:17.516 INFO main remote-ext: since no at is provided, setting it to latest finalized head, 0xe7d0b614dfe89af65b33577aae46a6f958c974bf52f8a5e865a0f4faeb578d22
228246
//! 2022-12-13 10:28:17.516 INFO main remote-ext: since no prefix is filtered, the data for all pallets will be downloaded
229247
//! 2022-12-13 10:28:17.550 INFO main remote-ext: writing snapshot of 1611464 bytes to "node-268@latest.snap"
230248
//! 2022-12-13 10:28:17.551 INFO main remote-ext: initialized state externalities with storage root 0x925e4e95de4c08474fb7f976c4472fa9b8a1091619cd7820a793bf796ee6d932 and state_version V1
231249
//! ```
232250
//!
251+
//! For faster snapshot creation with large state, use multiple RPC endpoints:
252+
//!
253+
//! ```bash
254+
//! try-runtime --runtime existing create-snapshot \
255+
//! --uri ws://localhost:9999 \
256+
//! --uri ws://localhost:9998 \
257+
//! -- my-snapshot.snap
258+
//! ```
259+
//!
233260
//! > Note that the snapshot contains the `existing` runtime, which does not have the correct
234261
//! > `try-runtime` feature. In the following commands, we still need to overwrite the runtime.
235262
//!

0 commit comments

Comments
 (0)