mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
pvf: ensure enough stack space (#5712)
* pvf: ensure enough stack space * fix typos Co-authored-by: Andronik <write@reusable.software> * Use rayon to cache the thread Co-authored-by: Andronik <write@reusable.software>
This commit is contained in:
@@ -29,7 +29,7 @@ pub fn validate_candidate(
|
||||
code: &[u8],
|
||||
params: &[u8],
|
||||
) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
|
||||
use crate::executor_intf::{execute, prepare, prevalidate, TaskExecutor};
|
||||
use crate::executor_intf::{prepare, prevalidate, Executor};
|
||||
|
||||
let code = sp_maybe_compressed_blob::decompress(code, 10 * 1024 * 1024)
|
||||
.expect("Decompressing code failed");
|
||||
@@ -40,11 +40,11 @@ pub fn validate_candidate(
|
||||
let artifact_path = tmpdir.path().join("blob");
|
||||
std::fs::write(&artifact_path, &artifact)?;
|
||||
|
||||
let executor = TaskExecutor::new()?;
|
||||
let executor = Executor::new()?;
|
||||
let result = unsafe {
|
||||
// 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)?
|
||||
executor.execute(&artifact_path, params)?
|
||||
};
|
||||
|
||||
Ok(result)
|
||||
|
||||
Reference in New Issue
Block a user