diff --git a/core/application/app_configuration.hpp b/core/application/app_configuration.hpp index baceb292e0..ee4de31db7 100644 --- a/core/application/app_configuration.hpp +++ b/core/application/app_configuration.hpp @@ -236,13 +236,6 @@ namespace kagome::application { virtual RuntimeInterpreter runtimeInterpreter() const = 0; - /** - * A flag marking if we use and store precompiled WAVM runtimes. - * Significantly increases node restart speed. Especially useful when - * debugging. - */ - virtual bool useWavmCache() const = 0; - /** * A flag marking if we must force-purge WAVM runtime cache */ diff --git a/core/application/impl/app_configuration_impl.cpp b/core/application/impl/app_configuration_impl.cpp index 2c21215b2e..e7deeaa327 100644 --- a/core/application/impl/app_configuration_impl.cpp +++ b/core/application/impl/app_configuration_impl.cpp @@ -90,7 +90,6 @@ namespace { kagome::application::AppConfiguration::RuntimeExecutionMethod::Interpret; const auto def_runtime_interpreter = kagome::application::AppConfiguration::RuntimeInterpreter::WasmEdge; - const auto def_use_wavm_cache_ = false; const auto def_purge_wavm_cache_ = false; const auto def_offchain_worker_mode = kagome::application::AppConfiguration::OffchainWorkerMode::WhenValidating; @@ -285,7 +284,6 @@ namespace kagome::application { sync_method_{def_sync_method}, runtime_exec_method_{def_runtime_exec_method}, runtime_interpreter_{def_runtime_interpreter}, - use_wavm_cache_(def_use_wavm_cache_), purge_wavm_cache_(def_purge_wavm_cache_), offchain_worker_mode_{def_offchain_worker_mode}, enable_offchain_indexing_{def_enable_offchain_indexing}, @@ -880,7 +878,6 @@ namespace kagome::application { fmt::format("choose the desired wasm execution method ({})", execution_methods_str).c_str()) ("wasm-interpreter", po::value()->default_value(def_wasm_interpreter), fmt::format("choose the desired wasm interpreter ({})", interpreters_str).c_str()) - ("unsafe-cached-wavm-runtime", "use WAVM runtime cache") ("purge-wavm-cache", "purge WAVM runtime cache") ("parachain-runtime-instance-cache-size", po::value()->default_value(def_parachain_runtime_instance_cache_size), @@ -1465,10 +1462,6 @@ namespace kagome::application { } } - if (vm.count("unsafe-cached-wavm-runtime") > 0) { - use_wavm_cache_ = true; - } - if (vm.count("purge-wavm-cache") > 0) { purge_wavm_cache_ = true; if (fs::exists(runtimeCacheDirPath())) { diff --git a/core/application/impl/app_configuration_impl.hpp b/core/application/impl/app_configuration_impl.hpp index 27053e53fe..d81556cb99 100644 --- a/core/application/impl/app_configuration_impl.hpp +++ b/core/application/impl/app_configuration_impl.hpp @@ -164,9 +164,6 @@ namespace kagome::application { RuntimeInterpreter runtimeInterpreter() const override { return runtime_interpreter_; } - bool useWavmCache() const override { - return use_wavm_cache_; - } bool purgeWavmCache() const override { return purge_wavm_cache_; } @@ -367,7 +364,6 @@ namespace kagome::application { SyncMethod sync_method_; RuntimeExecutionMethod runtime_exec_method_; RuntimeInterpreter runtime_interpreter_; - bool use_wavm_cache_; bool purge_wavm_cache_; OffchainWorkerMode offchain_worker_mode_; bool enable_offchain_indexing_; @@ -387,7 +383,8 @@ namespace kagome::application { uint32_t parachain_precompilation_thread_num_ = std::thread::hardware_concurrency() / 2; bool should_precompile_parachain_modules_{true}; - bool use_pvf_subprocess_{true}; + bool use_pvf_subprocess_{ + false}; // TODO(kamilsa) #2123 set back to true when issue resolved std::chrono::milliseconds pvf_subprocess_deadline_{2000}; bool disable_secure_mode_{false}; std::optional precompile_wasm_; diff --git a/core/injector/application_injector.cpp b/core/injector/application_injector.cpp index 83358e4cef..2fab17d2b1 100644 --- a/core/injector/application_injector.cpp +++ b/core/injector/application_injector.cpp @@ -396,11 +396,9 @@ namespace { module_cache_opt; auto &app_config = injector.template create(); - if (app_config.useWavmCache()) { - module_cache_opt = std::make_shared( - injector.template create>(), - app_config.runtimeCacheDirPath()); - } + module_cache_opt = std::make_shared( + injector.template create>(), + app_config.runtimeCacheDirPath()); return std::make_shared( injector .template create>(), @@ -929,7 +927,7 @@ namespace kagome::injector { KagomeNodeInjector::KagomeNodeInjector( sptr app_config) : pimpl_{std::make_unique( - makeKagomeNodeInjector(app_config))} {} + makeKagomeNodeInjector(app_config))} {} sptr KagomeNodeInjector::injectAppConfig() { return pimpl_->injector_ diff --git a/core/runtime/wasm_edge/memory_impl.cpp b/core/runtime/wasm_edge/memory_impl.cpp index af3e93ab8b..37048a61fb 100644 --- a/core/runtime/wasm_edge/memory_impl.cpp +++ b/core/runtime/wasm_edge/memory_impl.cpp @@ -17,6 +17,7 @@ namespace kagome::runtime::wasm_edge { const MemoryConfig &config) : mem_instance_{mem_instance} { BOOST_ASSERT(mem_instance_ != nullptr); + resize(kInitialMemorySize); SL_DEBUG(logger_, "Created memory wrapper {} for internal instance {}", fmt::ptr(this), diff --git a/test/core/injector/application_injector_test.cpp b/test/core/injector/application_injector_test.cpp index 0404d645f3..14eca0ec0a 100644 --- a/test/core/injector/application_injector_test.cpp +++ b/test/core/injector/application_injector_test.cpp @@ -135,6 +135,11 @@ class KagomeInjectorTest : public test::BaseFS_Test { void SetUp() override { writeKeys(db_path_ / "keys"); config_ = std::make_shared(); + + std::filesystem::path temp_dir = std::filesystem::temp_directory_path(); + EXPECT_CALL(*config_, runtimeCacheDirPath()) + .WillRepeatedly(::testing::Return(temp_dir)); + initConfig(db_path_, *config_); injector_ = std::make_unique(config_); } diff --git a/test/mock/core/application/app_configuration_mock.hpp b/test/mock/core/application/app_configuration_mock.hpp index 53ceacc512..f642cc38fe 100644 --- a/test/mock/core/application/app_configuration_mock.hpp +++ b/test/mock/core/application/app_configuration_mock.hpp @@ -118,8 +118,6 @@ namespace kagome::application { (), (const, override)); - MOCK_METHOD(bool, useWavmCache, (), (const, override)); - MOCK_METHOD(bool, purgeWavmCache, (), (const, override)); MOCK_METHOD(uint32_t, diff --git a/zombienet/old/0007-parachains-disputes-invald/0007-parachains-garbage-candidate.toml b/zombienet/old/0007-parachains-disputes-invald/0007-parachains-garbage-candidate.toml index 793e32f680..f787b13bf9 100644 --- a/zombienet/old/0007-parachains-disputes-invald/0007-parachains-garbage-candidate.toml +++ b/zombienet/old/0007-parachains-disputes-invald/0007-parachains-garbage-candidate.toml @@ -25,7 +25,7 @@ requests = { memory = "2G", cpu = "1" } count = 1 command = "kagome" prometheus_prefix = "kagome" - args = ["--wasm-execution Compiled --unsafe-cached-wavm-runtime"] + args = ["--wasm-execution Compiled"] [[relaychain.node_groups]] name = "malus-validator" diff --git a/zombienet/old/0012-parachains-pvf/0012-parachains-pvf.toml b/zombienet/old/0012-parachains-pvf/0012-parachains-pvf.toml index 9515f7e1e5..98bc7ea578 100644 --- a/zombienet/old/0012-parachains-pvf/0012-parachains-pvf.toml +++ b/zombienet/old/0012-parachains-pvf/0012-parachains-pvf.toml @@ -28,25 +28,25 @@ requests = { memory = "2G", cpu = "1" } [[relaychain.nodes]] name = "ferdie" - command = "kagome --wasm-execution Compiled --unsafe-cached-wavm-runtime" + command = "kagome --wasm-execution Compiled" prometheus_prefix = "kagome" args = [ "--ferdie", "-lparachain=debug", "-lruntime=debug" ] [[relaychain.nodes]] name = "eve" - command = "kagome --wasm-execution Compiled --unsafe-cached-wavm-runtime" + command = "kagome --wasm-execution Compiled" prometheus_prefix = "kagome" args = [ "--eve", "-lparachain=debug", "-lruntime=debug"] [[relaychain.nodes]] name = "one" - command = "kagome --wasm-execution Compiled --unsafe-cached-wavm-runtime" + command = "kagome --wasm-execution Compiled" prometheus_prefix = "kagome" args = [ "--one", "-lparachain=debug", "-lruntime=debug" ] [[relaychain.nodes]] name = "two" - command = "kagome --wasm-execution Compiled --unsafe-cached-wavm-runtime" + command = "kagome --wasm-execution Compiled" prometheus_prefix = "kagome" args = [ "--two", "-lparachain=debug", "-lruntime=debug"]