Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

try-runtime is executing Wasm Interpreter even with --wasm-execution compiled #13692

Closed
2 tasks done
crystalin opened this issue Mar 23, 2023 · 1 comment · Fixed by #13694
Closed
2 tasks done

try-runtime is executing Wasm Interpreter even with --wasm-execution compiled #13692

crystalin opened this issue Mar 23, 2023 · 1 comment · Fixed by #13694

Comments

@crystalin
Copy link
Contributor

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

When execution try-runtime --wasm-execution compiled on-runtime-upgrade it executes the wasmi.
Here is the call stack showing wasmi execution being originated from the try-runtime:

<sc_executor_wasmi::WasmiInstance as sc_executor_common::wasm_runtime::WasmInstance>::call_with_allocation_stats (\home\crystalin\projects\substrate\client\executor\wasmi\src\lib.rs:588)
sc_executor_common::wasm_runtime::WasmInstance::call (\home\crystalin\projects\substrate\client\executor\common\src\wasm_runtime.rs:84)
sc_executor_common::wasm_runtime::WasmInstance::call_export (\home\crystalin\projects\substrate\client\executor\common\src\wasm_runtime.rs:104)
<sc_executor::native_executor::NativeElseWasmExecutor<D> as sp_core::traits::CodeExecutor>::call::{{closure}}::{{closure}} (\home\crystalin\projects\substrate\client\executor\src\native_executor.rs:489)
std::panicking::try::do_call (@std::thread::local::LocalKey<T>::with:56)
std::panicking::try (@std::thread::local::LocalKey<T>::with:56)
std::panic::catch_unwind (@std::thread::local::LocalKey<T>::with:56)
sc_executor::native_executor::with_externalities_safe::{{closure}} (\home\crystalin\projects\substrate\client\executor\src\native_executor.rs:55)
environmental::using::{{closure}} (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\environmental-1.1.4\src\lib.rs:124)
std::thread::local::LocalKey<T>::try_with (@std::thread::local::LocalKey<T>::with:18)
std::thread::local::LocalKey<T>::with (@std::thread::local::LocalKey<T>::with:13)
environmental::using (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\environmental-1.1.4\src\lib.rs:115)
sp_externalities::scope_limited::ext::using (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\environmental-1.1.4\src\lib.rs:295)
sp_externalities::scope_limited::set_and_run_with_externalities (\home\crystalin\projects\substrate\primitives\externalities\src\scope_limited.rs:31)
sc_executor::native_executor::with_externalities_safe (\home\crystalin\projects\substrate\client\executor\src\native_executor.rs:51)
<sc_executor::native_executor::WasmExecutor<H> as sp_core::traits::CodeExecutor>::call::{{closure}} (\home\crystalin\projects\substrate\client\executor\src\native_executor.rs:346)
sc_executor::native_executor::WasmExecutor<H>::with_instance::{{closure}} (\home\crystalin\projects\substrate\client\executor\src\native_executor.rs:195)
sc_executor::wasm_runtime::VersionedRuntime::with_instance (\home\crystalin\projects\substrate\client\executor\src\wasm_runtime.rs:109)
sc_executor::wasm_runtime::RuntimeCache::with_instance (\home\crystalin\projects\substrate\client\executor\src\wasm_runtime.rs:285)
sc_executor::native_executor::WasmExecutor<H>::with_instance (\home\crystalin\projects\substrate\client\executor\src\native_executor.rs:185)
<sc_executor::native_executor::WasmExecutor<H> as sp_core::traits::CodeExecutor>::call (\home\crystalin\projects\substrate\client\executor\src\native_executor.rs:345)
sp_state_machine::execution::StateMachine<B,H,Exec>::execute_aux (\home\crystalin\projects\substrate\primitives\state-machine\src\lib.rs:405)
sp_state_machine::execution::StateMachine<B,H,Exec>::execute_using_consensus_failure_handler (\home\crystalin\projects\substrate\primitives\state-machine\src\lib.rs:499)
sp_state_machine::execution::StateMachine<B,H,Exec>::execute (\home\crystalin\projects\substrate\primitives\state-machine\src\lib.rs:377)
try_runtime_cli::state_machine_call_with_proof (\home\crystalin\projects\substrate\utils\frame\try-runtime\cli\src\lib.rs:887)
try_runtime_cli::commands::on_runtime_upgrade::on_runtime_upgrade::{{closure}} (\home\crystalin\projects\substrate\utils\frame\try-runtime\cli\src\commands\on_runtime_upgrade.rs:67)
<core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll (@try_runtime_cli::TryRuntimeCmd::run::{{closure}}:203)
try_runtime_cli::TryRuntimeCmd::run::{{closure}} (\home\crystalin\projects\substrate\utils\frame\try-runtime\cli\src\lib.rs:739)
<core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll (@sc_cli::runner::main::{{closure}}::{{closure}}::{{closure}}:19)
<futures_util::future::future::fuse::Fuse<Fut> as core::future::future::Future>::poll (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.25\src\future\future\fuse.rs:86)
<core::pin::Pin<P> as core::future::future::Future>::poll (@sc_cli::runner::main::{{closure}}::{{closure}}::{{closure}}:17)
<core::pin::Pin<P> as core::future::future::Future>::poll (@sc_cli::runner::main::{{closure}}::{{closure}}::{{closure}}:17)
<core::pin::Pin<P> as core::future::future::Future>::poll (@sc_cli::runner::main::{{closure}}::{{closure}}::{{closure}}:17)
futures_util::future::future::FutureExt::poll_unpin (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.25\src\future\future\mod.rs:562)
sc_cli::runner::main::{{closure}}::{{closure}}::{{closure}} (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.25\src\async_await\select_mod.rs:321)
core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut (@<futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll:70)
sc_cli::runner::main::{{closure}}::{{closure}} (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.25\src\async_await\select_mod.rs:321)
<futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-util-0.3.25\src\future\poll_fn.rs:56)
sc_cli::runner::main::{{closure}} (\home\crystalin\projects\substrate\client\cli\src\runner.rs:44)
<core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll (@<core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll:12)
tokio::runtime::park::CachedParkThread::block_on::{{closure}} (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.25.0\src\runtime\park.rs:283)
tokio::runtime::coop::with_budget (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.25.0\src\runtime\coop.rs:102)
tokio::runtime::coop::budget (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.25.0\src\runtime\coop.rs:68)
tokio::runtime::park::CachedParkThread::block_on (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.25.0\src\runtime\park.rs:283)
tokio::runtime::context::BlockingRegionGuard::block_on (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.25.0\src\runtime\context.rs:315)
tokio::runtime::scheduler::multi_thread::MultiThread::block_on (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.25.0\src\runtime\scheduler\multi_thread\mod.rs:66)
tokio::runtime::runtime::Runtime::block_on (\home\crystalin\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-1.25.0\src\runtime\runtime.rs:284)
sc_cli::runner::run_until_exit (\home\crystalin\projects\substrate\client\cli\src\runner.rs:100)
sc_cli::runner::Runner<C>::async_run (\home\crystalin\projects\substrate\client\cli\src\runner.rs:213)
moonbeam_cli::command::run (\home\crystalin\projects\moonbeam-9.39\node\cli\src\command.rs:682)
moonbeam::main (\home\crystalin\projects\moonbeam-9.39\node\src\main.rs:25)
core::ops::function::FnOnce::call_once (@std::sys_common::backtrace::__rust_begin_short_backtrace:6)
std::sys_common::backtrace::__rust_begin_short_backtrace (@std::sys_common::backtrace::__rust_begin_short_backtrace:5)
std::rt::lang_start::{{closure}} (@std::rt::lang_start::{{closure}}:8)
core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once (@std::rt::lang_start_internal:256)
std::panicking::try::do_call (@std::rt::lang_start_internal:255)
std::panicking::try (@std::rt::lang_start_internal:255)
std::panic::catch_unwind (@std::rt::lang_start_internal:255)
std::rt::lang_start_internal::{{closure}} (@std::rt::lang_start_internal:255)
std::panicking::try::do_call (@std::rt::lang_start_internal:255)
std::panicking::try (@std::rt::lang_start_internal:255)
std::panic::catch_unwind (@std::rt::lang_start_internal:255)
std::rt::lang_start_internal (@std::rt::lang_start_internal:255)
main (@main:13)
___lldb_unnamed_symbol3139 (@___lldb_unnamed_symbol3139:29)
__libc_start_main (@__libc_start_main:43)
_start (@_start:15)

The issue seems to come from the try-runtime executor builder:
https://github.com/paritytech/substrate/blob/master/utils/frame/try-runtime/cli/src/lib.rs#L834

Steps to reproduce

No response

@crystalin
Copy link
Contributor Author

Haha @bkchr you went faster than me. I was still testing the change before opening the PR.
Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant