Make wasm runtime cache size configurable (#10177)

* Make wasm runtime cache size configurable

* apply review comments

* remove VersionedRuntimeValue

* fix compilation

* VersionedRuntime: replace clone by Arc

* fmt

* fix warnings

* fix tests compilation

* fmt
This commit is contained in:
Éloïs
2021-12-09 16:10:16 +01:00
committed by GitHub
parent 6ce90f583c
commit 3acd335a8d
30 changed files with 139 additions and 79 deletions
+9
View File
@@ -452,6 +452,13 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
Ok(Default::default())
}
/// Get maximum different runtimes in cache
///
/// By default this is `2`.
fn runtime_cache_size(&self) -> Result<u8> {
Ok(2)
}
/// Activate or not the automatic announcing of blocks after import
///
/// By default this is `false`.
@@ -482,6 +489,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
let is_validator = role.is_authority();
let (keystore_remote, keystore) = self.keystore_config(&config_dir)?;
let telemetry_endpoints = self.telemetry_endpoints(&chain_spec)?;
let runtime_cache_size = self.runtime_cache_size()?;
let unsafe_pruning = self.import_params().map(|p| p.unsafe_pruning).unwrap_or(false);
@@ -534,6 +542,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
role,
base_path: Some(base_path),
informant_output_format: Default::default(),
runtime_cache_size,
})
}