-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
That is useful for executors like wasmtime which produces compiled code and can actually benefit from caching under some circumstances
@insipx Potentially useful in |
.map_err(|err| format!("cannot write the cache config: {:?}", err))?; | ||
|
||
config | ||
.cache_config_load(cache_config_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read in the docs that this needs a config
feature enabled on wasmtime, but I can't see it anywhere. Am I missing something?
In 0.19 it is not feature gated, in latest (0.21) it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I assume you meant the cache
feature), it is enabled by default as well.
@@ -267,6 +283,7 @@ impl<D: NativeExecutionDispatch> NativeExecutor<D> { | |||
default_heap_pages, | |||
host_functions, | |||
max_runtime_instances, | |||
None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean caching is disabled when running substrate node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I deliberately didn't put it here.
The thing is that this change is dictated by needs of polkadot. I believe it should mitigate the stalls we are seeing there right now. Therefore, it is critical to land it quickly. I figured that we should move the question about the cache out of the way.
bot merge |
Trying merge. |
This PR allows to specify a cache directory when creating a
WasmExecutor
. If specified and wasmtime executor is used, we configure wasmtime to use it to put its compiled artifacts cache there.This change is motivated by the polkadot validation function which has to execute many different wasm blobs as quickly as possible. Right now, the lack of caching leads to severe stalls.
polkadot companion: paritytech/polkadot#2387