diff --git a/Makefile b/Makefile index 301508e333..df1aad7bac 100644 --- a/Makefile +++ b/Makefile @@ -147,6 +147,10 @@ build-bifrost-wasm: build-asgard-wasm: .maintain/build-wasm.sh asgard +.PHONY: check-try-runtime +check-try-runtime: + SKIP_WASM_BUILD= cargo check --features try-runtime --features with-bifrost-runtime + .PHONY: try-bifrost-runtime-upgrade try-bifrost-runtime-upgrade: ./scripts/try-runtime.sh bifrost @@ -168,4 +172,4 @@ keystore: .PHONY: production-release production-release: - .maintain/publish-release.sh \ No newline at end of file + .maintain/publish-release.sh diff --git a/runtime/asgard/src/lib.rs b/runtime/asgard/src/lib.rs index fea44627cd..382b6fb93f 100644 --- a/runtime/asgard/src/lib.rs +++ b/runtime/asgard/src/lib.rs @@ -1981,9 +1981,12 @@ impl_runtime_apis! { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade() -> Result<(Weight, Weight), sp_runtime::RuntimeString> { - let weight = Executive::try_runtime_upgrade()?; - Ok((weight, RuntimeBlockWeights::get().max_block)) + fn on_runtime_upgrade() -> (Weight, Weight) { + let weight = Executive::try_runtime_upgrade().unwrap(); + (weight, RuntimeBlockWeights::get().max_block) + } + fn execute_block_no_check(block: Block) -> Weight { + Executive::execute_block_no_check(block) } } } @@ -2006,7 +2009,8 @@ impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> Weight { log::info!("Asgard `on_runtime_upgrade`..."); let _ = PolkadotXcm::force_default_xcm_version(Origin::root(), Some(2)); - RocksDbWeight::get().writes(1); + log::info!("Asgard `on_runtime_upgrade finished`"); + RocksDbWeight::get().writes(1) } } diff --git a/runtime/bifrost/src/lib.rs b/runtime/bifrost/src/lib.rs index df1d39d730..88f9d9931f 100644 --- a/runtime/bifrost/src/lib.rs +++ b/runtime/bifrost/src/lib.rs @@ -1859,10 +1859,13 @@ impl_runtime_apis! { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade() -> Result<(Weight, Weight), sp_runtime::RuntimeString> { + fn on_runtime_upgrade() -> (Weight, Weight) { log::info!("try-runtime::on_runtime_upgrade bifrost."); - let weight = Executive::try_runtime_upgrade()?; - Ok((weight, RuntimeBlockWeights::get().max_block)) + let weight = Executive::try_runtime_upgrade().unwrap(); + (weight, RuntimeBlockWeights::get().max_block) + } + fn execute_block_no_check(block: Block) -> Weight { + Executive::execute_block_no_check(block) } } } @@ -1883,6 +1886,7 @@ impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> Weight { log::info!("Bifrost `on_runtime_upgrade`..."); let _ = PolkadotXcm::force_default_xcm_version(Origin::root(), Some(2)); + log::info!("Bifrost `on_runtime_upgrade finished`"); RocksDbWeight::get().writes(1) } } diff --git a/scripts/try-runtime.sh b/scripts/try-runtime.sh index 03e893b8b7..e6d66082c9 100755 --- a/scripts/try-runtime.sh +++ b/scripts/try-runtime.sh @@ -2,11 +2,13 @@ chain_type=$1 chain_type="${chain_type:-bifrost}" +echo $chain_type chain_url=$2 -chain_url="${chain_url:-ws://localhost:9944}" +chain_url="${chain_url:-ws://localhost:18848}" +echo $chain_url block_hash=$3 -block_hash="${block_hash:-0xd854e0d78b2bcd9cc56b6b4897f13d937d8ee166f1cda3b6c748ce775c56a87d}" +block_hash="${block_hash:-0x588bc30598fddd228f234b387cf68daa551262a2a17a5dda1199e770aeaffd77}" -cargo run -p node-cli --locked --features with-$chain_type-runtime --features try-runtime -- try-runtime --chain="$chain_type-genesis" --wasm-execution=compiled --url="$chain_url" --block-at="$block_hash" on-runtime-upgrade live -s snapshot.bin \ No newline at end of file +cargo run -p node-cli --locked --features with-$chain_type-runtime --features try-runtime -- try-runtime --chain="$chain_type-local" --wasm-execution=compiled on-runtime-upgrade live --uri=$chain_url --at=$block_hash \ No newline at end of file