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

Disable pvf subprocess #2126

Merged
merged 7 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
7 changes: 0 additions & 7 deletions core/application/app_configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
7 changes: 0 additions & 7 deletions core/application/impl/app_configuration_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -880,7 +878,6 @@ namespace kagome::application {
fmt::format("choose the desired wasm execution method ({})", execution_methods_str).c_str())
("wasm-interpreter", po::value<std::string>()->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<uint32_t>()->default_value(def_parachain_runtime_instance_cache_size),
Expand Down Expand Up @@ -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())) {
Expand Down
7 changes: 2 additions & 5 deletions core/application/impl/app_configuration_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
}
Expand Down Expand Up @@ -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_;
Expand All @@ -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<PrecompileWasmConfig> precompile_wasm_;
Expand Down
10 changes: 4 additions & 6 deletions core/injector/application_injector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,9 @@ namespace {
module_cache_opt;
auto &app_config =
injector.template create<const application::AppConfiguration &>();
if (app_config.useWavmCache()) {
module_cache_opt = std::make_shared<runtime::wavm::ModuleCache>(
injector.template create<sptr<crypto::Hasher>>(),
app_config.runtimeCacheDirPath());
}
module_cache_opt = std::make_shared<runtime::wavm::ModuleCache>(
injector.template create<sptr<crypto::Hasher>>(),
app_config.runtimeCacheDirPath());
return std::make_shared<runtime::wavm::ModuleFactoryImpl>(
injector
.template create<sptr<runtime::wavm::CompartmentWrapper>>(),
Expand Down Expand Up @@ -929,7 +927,7 @@ namespace kagome::injector {
KagomeNodeInjector::KagomeNodeInjector(
sptr<application::AppConfiguration> app_config)
: pimpl_{std::make_unique<KagomeNodeInjectorImpl>(
makeKagomeNodeInjector(app_config))} {}
makeKagomeNodeInjector(app_config))} {}

sptr<application::AppConfiguration> KagomeNodeInjector::injectAppConfig() {
return pimpl_->injector_
Expand Down
2 changes: 0 additions & 2 deletions test/mock/core/application/app_configuration_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions zombienet/old/0012-parachains-pvf/0012-parachains-pvf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
Loading