mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Switch to pooling copy-on-write instantiation strategy for WASM (companion for Substrate#11232) (#5337)
* Switch to pooling copy-on-write instantiation strategy for WASM
* Fix compilation of `polkadot-test-service`
* Update comments
* Move `max_memory_size` to `Semantics`
* Rename `WasmInstantiationStrategy` to `WasmtimeInstantiationStrategy`
* Update a safety comment
* update lockfile for {"substrate"}
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -36,10 +36,15 @@ pub fn validate_candidate(
|
||||
|
||||
let blob = prevalidate(&*code)?;
|
||||
let artifact = prepare(blob)?;
|
||||
let tmpdir = tempfile::tempdir()?;
|
||||
let artifact_path = tmpdir.path().join("blob");
|
||||
std::fs::write(&artifact_path, &artifact)?;
|
||||
|
||||
let executor = TaskExecutor::new()?;
|
||||
let result = unsafe {
|
||||
// SAFETY: This is trivially safe since the artifact is obtained by calling `prepare`.
|
||||
execute(&artifact, params, executor)?
|
||||
// SAFETY: This is trivially safe since the artifact is obtained by calling `prepare`
|
||||
// and is written into a temporary directory in an unmodified state.
|
||||
execute(&artifact_path, params, executor)?
|
||||
};
|
||||
|
||||
Ok(result)
|
||||
|
||||
Reference in New Issue
Block a user