mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 14:01:06 +00:00
PVF: Instantiate wasm in pre-checking (#7246)
* PVF: Instantiate wasm in pre-checking * Move `runtime_construction_check` to prepare thread, use bytes * [minor] Update comment * Fix compile error * Update Cargo.lock * Update docs * Add some missing docs!
This commit is contained in:
@@ -1215,7 +1215,9 @@ pub(crate) mod tests {
|
||||
|
||||
// First, test a simple precheck request.
|
||||
let (result_tx, result_rx) = oneshot::channel();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator(1), result_tx).await.unwrap();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator_precheck(1), result_tx)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// The queue received the prepare request.
|
||||
assert_matches!(
|
||||
@@ -1239,7 +1241,9 @@ pub(crate) mod tests {
|
||||
let mut precheck_receivers = Vec::new();
|
||||
for _ in 0..3 {
|
||||
let (result_tx, result_rx) = oneshot::channel();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator(2), result_tx).await.unwrap();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator_precheck(2), result_tx)
|
||||
.await
|
||||
.unwrap();
|
||||
precheck_receivers.push(result_rx);
|
||||
}
|
||||
// Received prepare request.
|
||||
@@ -1289,7 +1293,9 @@ pub(crate) mod tests {
|
||||
);
|
||||
|
||||
let (result_tx, result_rx) = oneshot::channel();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator(1), result_tx).await.unwrap();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator_precheck(1), result_tx)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// Suppose the preparation failed, the execution queue is empty and both
|
||||
// "clients" receive their results.
|
||||
@@ -1311,7 +1317,9 @@ pub(crate) mod tests {
|
||||
let mut precheck_receivers = Vec::new();
|
||||
for _ in 0..3 {
|
||||
let (result_tx, result_rx) = oneshot::channel();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator(2), result_tx).await.unwrap();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator_precheck(2), result_tx)
|
||||
.await
|
||||
.unwrap();
|
||||
precheck_receivers.push(result_rx);
|
||||
}
|
||||
|
||||
@@ -1357,7 +1365,9 @@ pub(crate) mod tests {
|
||||
|
||||
// Submit a precheck request that fails.
|
||||
let (result_tx, result_rx) = oneshot::channel();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator(1), result_tx).await.unwrap();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator_precheck(1), result_tx)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// The queue received the prepare request.
|
||||
assert_matches!(
|
||||
@@ -1379,7 +1389,7 @@ pub(crate) mod tests {
|
||||
|
||||
// Submit another precheck request.
|
||||
let (result_tx_2, result_rx_2) = oneshot::channel();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator(1), result_tx_2)
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator_precheck(1), result_tx_2)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@@ -1395,7 +1405,7 @@ pub(crate) mod tests {
|
||||
|
||||
// Submit another precheck request.
|
||||
let (result_tx_3, result_rx_3) = oneshot::channel();
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator(1), result_tx_3)
|
||||
host.precheck_pvf(PvfPrepData::from_discriminator_precheck(1), result_tx_3)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ pub use worker_intf::{framed_recv, framed_send, JOB_TIMEOUT_WALL_CLOCK_FACTOR};
|
||||
// Re-export some common types.
|
||||
pub use polkadot_node_core_pvf_common::{
|
||||
error::{InternalValidationError, PrepareError},
|
||||
prepare::PrepareStats,
|
||||
prepare::{PrepareJobKind, PrepareStats},
|
||||
pvf::PvfPrepData,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user