Skip to content

Commit

Permalink
dynamic dispatch fast_forward subcommand (#25)
Browse files Browse the repository at this point in the history
* dynamic dispatch fast_forward

* clippy

* sort dependencies

* simplified inherent providers and add option for on-runtime-upgrade

* fix try_state select name

* improved chain logs and docs
  • Loading branch information
liamaharon authored Aug 29, 2023
1 parent 5b1fdf5 commit c9a41c0
Show file tree
Hide file tree
Showing 14 changed files with 2,373 additions and 530 deletions.
2,264 changes: 1,764 additions & 500 deletions Cargo.lock

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
]

[workspace.package]
version = "0.2.0"
version = "0.3.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Substrate's programmatic testing framework."
edition = "2021"
Expand All @@ -16,17 +16,20 @@ homepage = "https://github.com/paritytech/try-runtime-cli"
repository = "https://github.com/paritytech/try-runtime-cli/"

[workspace.dependencies]
bytesize = { version = "1.2.0" }
assert_cmd = { version = "2.0.10" }
async-trait = { version = "0.1.57" }
bytesize = { version = "1.2.0" }
clap = { version = "4.0.9" }
env_logger = { version = "0.10.0" }
hex = { version = "0.4.3", default-features = false }
itertools = { version = "0.11.0" }
log = { version = "0.4.17" }
parity-scale-codec = { version = "3.6.1" }
regex = { version = "1.7.3" }
serde = { version = "1.0.136" }
serde_json = { version = "1.0.85" }
strum = "0.25"
strum_macros = "0.25"
tempfile = { version = "3.1.0" }
tokio = { version = "1.27.0" }
zstd = { version = "0.11.2", default-features = false }
Expand All @@ -40,21 +43,27 @@ sc-executor = { git = "https://github.com/paritytech/substrate", branch = "maste
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" }

sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-transaction-storage-proof = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-weights = { git = "https://github.com/paritytech/substrate", branch = "master" }

substrate-rpc-client = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-cli-test-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-rpc-client = { git = "https://github.com/paritytech/substrate", branch = "master" }

node-primitives = { git = "https://github.com/paritytech/substrate", branch = "master" }
node-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
node-primitives = { git = "https://github.com/paritytech/substrate", branch = "master" }

# Local
try-runtime-core = { path = "core" }
2 changes: 2 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ parity-scale-codec = { workspace = true, features = ["derive"] }
tokio = { workspace = true, features = ["full"] }

sc-executor = { workspace = true }

sp-io = { workspace = true }
sp-runtime = { workspace = true }

node-executor = { workspace = true }
node-primitives = { workspace = true }

Expand Down
3 changes: 3 additions & 0 deletions cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
//!
//! * [`Action::OnRuntimeUpgrade`]: execute all the [`OnRuntimeUpgrade`] hooks.
//! * [`Action::ExecuteBlock`]: re-execute the given block.
//! * [`Action::FastForward`]: execute [`OnRuntimeUpgrade`] hooks, then fast-forward the chain a
//! given number of blocks while checking try-state invarients.
//! * [`Action::OffchainWorker`]: re-execute the given block's offchain worker code path.
//! * [`Action::FollowChain`]: continuously execute the blocks of a remote chain on top of a given
//! runtime.
Expand Down Expand Up @@ -292,6 +294,7 @@
//! [`Action::ExecuteBlock`]: ../try_runtime_core/commands/enum.Action.html#variant.ExecuteBlock
//! [`Action::OffchainWorker`]: ../try_runtime_core/commands/enum.Action.html#variant.OffchainWorker
//! [`Action::CreateSnapshot`]: ../try_runtime_core/commands/enum.Action.html#variant.CreateSnapshot
//! [`Action::FastForward`]: ../try_runtime_core/commands/enum.Action.html#variant.FastForward
//! [`SharedParams`]: ../try_runtime_core/shared_parameters/struct.SharedParams.html
//! [`SharedParams::runtime`]: ../try_runtime_core/shared_parameters/struct.SharedParams.html#structfield.runtime
//! [`SharedParams::overwrite_state_version`]: ../try_runtime_core/shared_parameters/struct.SharedParams.html#structfield.overwrite_state_version
Expand Down
21 changes: 17 additions & 4 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,40 @@ async-trait = { workspace = true }
bytesize = { workspace = true, features = ["serde"] }
clap = { workspace = true, features = ["derive"] }
hex = { workspace = true }
itertools = { workspace = true }
log = { workspace = true }
parity-scale-codec = { workspace = true, features = ["derive"] }
serde = { workspace = true }
serde_json = { workspace = true }
strum = { workspace = true }
strum_macros = { workspace = true }
zstd = { workspace = true }

frame-remote-externalities = { workspace = true }
frame-try-runtime = { workspace = true, features=["try-runtime"] }

sc-cli = { workspace = true }
sc-executor = { workspace = true }

node-primitives = { workspace = true }

sp-api = { workspace = true }
sp-version = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-consensus-babe = { workspace = true }
sp-core = { workspace = true }
sp-externalities = { workspace = true }
sp-inherents = { workspace = true }
sp-io = { workspace = true }
sp-keystore = { workspace = true }
sp-runtime = { workspace = true }
sp-rpc = { workspace = true }
sp-runtime = { workspace = true }
sp-state-machine = { workspace = true }
sp-std = { workspace = true }
sp-timestamp = { workspace = true }
sp-transaction-storage-proof = { workspace = true }
sp-version = { workspace = true }
sp-weights = { workspace = true }

substrate-rpc-client = { workspace = true }

[dev-dependencies]
Expand All @@ -45,7 +59,6 @@ regex = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true }

sc-service = { workspace = true }
node-primitives = { workspace = true }
node-executor = { workspace = true }
sc-service = { workspace = true }
substrate-cli-test-utils = { workspace = true, features = ["try-runtime"] }
2 changes: 1 addition & 1 deletion core/src/commands/execute_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ where
)
.encode();

let _ = state_machine_call_with_proof::<HostFns>(
let _ = state_machine_call_with_proof::<Block, HostFns>(
&ext,
&executor,
"TryRuntime_execute_block",
Expand Down
Loading

0 comments on commit c9a41c0

Please sign in to comment.