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

deprecate try-runtime feature in favor of new CLI from Parity #770

Merged
merged 15 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH=$PATH:$HOME/.cargo/bin && \
/tmp/init.sh && \
export SUBWASM_VERSION=`/version chevdor subwasm` && \
cargo install --locked --git https://github.com/chevdor/subwasm --tag ${SUBWASM_VERSION}
cargo install --locked --git https://github.com/chevdor/subwasm --tag ${SUBWASM_VERSION} && \
export TRY_RUNTIME_VERSION=`/version paritytech try-runtime-cli` && \
cargo install --locked --git https://github.com/paritytech/try-runtime-cli --tag ${TRY_RUNTIME_VERSION}
1 change: 1 addition & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile
25 changes: 13 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,23 @@ jobs:
with:
toolchain: ${{ env.toolchain }}
target: ${{ env.target }}
- name: Cache a dir
- name: Build runtime
run: cargo build --release --features=try-runtime -p runtime-eden
- name: Setup cache
uses: actions/cache@v3
id: cachedir
with:
path: snapshots
key: ${{steps.get_version.outputs.eden_rev}}
- name: Cargo build
run: cargo build --release --features=try-runtime --bin nodle-parachain
- name: Fetch snapshot
- name: Ensure cache directory is created
if: steps.cachedir.outputs.cache-hit != 'true'
continue-on-error: true
run: |
install -d snapshots
date > snapshots/created_at
./target/release/nodle-parachain try-runtime --runtime existing -lruntime=debug --chain ${{ env.try-runtime-chain }} create-snapshot "snapshots/eden-snapshot-full" -u ${{ env.try-runtime-uri}}${{ secrets.DWELLIR_API_KEY}}
- name: Try runtime reuse snap
run: |
cat snapshots/created_at
./target/release/nodle-parachain try-runtime --runtime target/release/wbuild/runtime-eden/runtime_eden.wasm -lruntime=debug --chain ${{ env.try-runtime-chain }} on-runtime-upgrade --checks=all snap -s snapshots/eden-snapshot-full
install -d snapshots
date > snapshots/created_at
- name: Run try-runtime
uses: NodleCode/action-try-runtime@62a47e64e789d1c524d6c3e3c6ef36880a76901f
ETeissonniere marked this conversation as resolved.
Show resolved Hide resolved
with:
url: ${{ env.try-runtime-uri}}${{ secrets.DWELLIR_API_KEY}}
snap: snapshots/eden-snapshot-full
runtime: target/release/wbuild/runtime-eden/runtime_eden.wasm
checks: all
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ runtime-benchmarks = [
"runtime-eden/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
]
try-runtime = [
"runtime-eden/try-runtime",
"try-runtime-cli/try-runtime"
]

[dependencies]
clap = { version = "4.1.8", features = ["derive"] }
Expand All @@ -42,7 +38,6 @@ primitives = { version = "2.0.17", path = "../primitives" }
# Substrate Dependencies
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }

pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }

Expand Down
7 changes: 0 additions & 7 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ pub enum Subcommand {
/// The pallet benchmarking moved to the `pallet` sub-command.
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some testing command against a specified runtime state.
#[cfg(feature = "try-runtime")]
TryRuntime(try_runtime_cli::TryRuntimeCmd),
/// Errors since the binary was not build with `--features try-runtime`.
#[cfg(not(feature = "try-runtime"))]
TryRuntime,
}

#[derive(Debug, clap::Parser)]
Expand Down
27 changes: 0 additions & 27 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,33 +247,6 @@ pub fn run() -> Result<()> {
_ => Err("Benchmarking sub-command unsupported".into()),
}
}
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime(cmd)) => {
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
use try_runtime_cli::block_building_info::timestamp_with_aura_info;

let runner = cli.create_runner(cmd)?;
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager = sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry)
.map_err(|e| format!("Error: {:?}", e))?;
type HostFunctionsOf<E> = ExtendedHostFunctions<
sp_io::SubstrateHostFunctions,
<E as NativeExecutionDispatch>::ExtendHostFunctions,
>;

let info_provider = timestamp_with_aura_info(6000);

runner.async_run(|_| {
Ok((
cmd.run::<Block, HostFunctionsOf<TemplateRuntimeExecutor>, _>(Some(info_provider)),
task_manager,
))
})
}
#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \
You can enable it with `--features try-runtime`."
.into()),
Some(Subcommand::Key(cmd)) => Ok(cmd.run(&cli)?),
None => {
let runner = cli.create_runner(&cli.run.normalize())?;
Expand Down