mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +00:00
Use cached session index to obtain executor params (#1190)
* Import changes from archieved repo * Revert erroneous changes * Fix more tests * Resolve discussions * Fix MORE tests * approval-voting: launch_approval better interface (#1355) --------- Co-authored-by: Javier Viola <javier@parity.io> Co-authored-by: ordian <noreply@reusable.software> Co-authored-by: ordian <write@reusable.software>
This commit is contained in:
@@ -164,6 +164,7 @@ async fn run<Context>(
|
||||
CandidateValidationMessage::ValidateFromChainState(
|
||||
candidate_receipt,
|
||||
pov,
|
||||
executor_params,
|
||||
timeout,
|
||||
response_sender,
|
||||
) => {
|
||||
@@ -179,6 +180,7 @@ async fn run<Context>(
|
||||
validation_host,
|
||||
candidate_receipt,
|
||||
pov,
|
||||
executor_params,
|
||||
timeout,
|
||||
&metrics,
|
||||
)
|
||||
@@ -196,23 +198,23 @@ async fn run<Context>(
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
pov,
|
||||
executor_params,
|
||||
timeout,
|
||||
response_sender,
|
||||
) => {
|
||||
let bg = {
|
||||
let mut sender = ctx.sender().clone();
|
||||
let metrics = metrics.clone();
|
||||
let validation_host = validation_host.clone();
|
||||
|
||||
async move {
|
||||
let _timer = metrics.time_validate_from_exhaustive();
|
||||
let res = validate_candidate_exhaustive(
|
||||
&mut sender,
|
||||
validation_host,
|
||||
persisted_validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
pov,
|
||||
executor_params,
|
||||
timeout,
|
||||
&metrics,
|
||||
)
|
||||
@@ -497,6 +499,7 @@ async fn validate_from_chain_state<Sender>(
|
||||
validation_host: ValidationHost,
|
||||
candidate_receipt: CandidateReceipt,
|
||||
pov: Arc<PoV>,
|
||||
executor_params: ExecutorParams,
|
||||
exec_timeout_kind: PvfExecTimeoutKind,
|
||||
metrics: &Metrics,
|
||||
) -> Result<ValidationResult, ValidationFailed>
|
||||
@@ -511,12 +514,12 @@ where
|
||||
};
|
||||
|
||||
let validation_result = validate_candidate_exhaustive(
|
||||
sender,
|
||||
validation_host,
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt.clone(),
|
||||
pov,
|
||||
executor_params,
|
||||
exec_timeout_kind,
|
||||
metrics,
|
||||
)
|
||||
@@ -546,19 +549,16 @@ where
|
||||
validation_result
|
||||
}
|
||||
|
||||
async fn validate_candidate_exhaustive<Sender>(
|
||||
sender: &mut Sender,
|
||||
async fn validate_candidate_exhaustive(
|
||||
mut validation_backend: impl ValidationBackend + Send,
|
||||
persisted_validation_data: PersistedValidationData,
|
||||
validation_code: ValidationCode,
|
||||
candidate_receipt: CandidateReceipt,
|
||||
pov: Arc<PoV>,
|
||||
executor_params: ExecutorParams,
|
||||
exec_timeout_kind: PvfExecTimeoutKind,
|
||||
metrics: &Metrics,
|
||||
) -> Result<ValidationResult, ValidationFailed>
|
||||
where
|
||||
Sender: SubsystemSender<RuntimeApiMessage>,
|
||||
{
|
||||
) -> Result<ValidationResult, ValidationFailed> {
|
||||
let _timer = metrics.time_validate_candidate_exhaustive();
|
||||
|
||||
let validation_code_hash = validation_code.hash();
|
||||
@@ -615,27 +615,6 @@ where
|
||||
relay_parent_storage_root: persisted_validation_data.relay_parent_storage_root,
|
||||
};
|
||||
|
||||
let executor_params = if let Ok(executor_params) =
|
||||
executor_params_at_relay_parent(candidate_receipt.descriptor.relay_parent, sender).await
|
||||
{
|
||||
gum::debug!(
|
||||
target: LOG_TARGET,
|
||||
?validation_code_hash,
|
||||
?para_id,
|
||||
"Acquired executor params for the session: {:?}",
|
||||
executor_params,
|
||||
);
|
||||
executor_params
|
||||
} else {
|
||||
gum::warn!(
|
||||
target: LOG_TARGET,
|
||||
?validation_code_hash,
|
||||
?para_id,
|
||||
"Failed to acquire executor params for the session",
|
||||
);
|
||||
return Ok(ValidationResult::Invalid(InvalidCandidate::BadParent))
|
||||
};
|
||||
|
||||
let result = validation_backend
|
||||
.validate_candidate_with_retry(
|
||||
raw_validation_code.to_vec(),
|
||||
|
||||
@@ -26,37 +26,6 @@ use polkadot_primitives::{HeadData, Id as ParaId, UpwardMessage};
|
||||
use sp_core::testing::TaskExecutor;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
|
||||
fn test_with_executor_params<T: futures::Future<Output = R>, R, M>(
|
||||
mut ctx_handle: test_helpers::TestSubsystemContextHandle<M>,
|
||||
test: impl FnOnce() -> T,
|
||||
) -> R {
|
||||
let test_fut = test();
|
||||
|
||||
let overseer = async move {
|
||||
assert_matches!(
|
||||
ctx_handle.recv().await,
|
||||
AllMessages::RuntimeApi(
|
||||
RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionIndexForChild(tx))
|
||||
) => {
|
||||
tx.send(Ok(1u32.into())).unwrap();
|
||||
}
|
||||
);
|
||||
assert_matches!(
|
||||
ctx_handle.recv().await,
|
||||
AllMessages::RuntimeApi(
|
||||
RuntimeApiMessage::Request(_, RuntimeApiRequest::SessionExecutorParams(_, tx))
|
||||
) => {
|
||||
tx.send(Ok(Some(ExecutorParams::default()))).unwrap();
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
futures::pin_mut!(test_fut);
|
||||
futures::pin_mut!(overseer);
|
||||
let v = executor::block_on(future::join(test_fut, overseer));
|
||||
v.0
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn correctly_checks_included_assumption() {
|
||||
let validation_data: PersistedValidationData = Default::default();
|
||||
@@ -460,23 +429,16 @@ fn candidate_validation_ok_is_ok() {
|
||||
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: commitments.hash() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let metrics = Metrics::default();
|
||||
|
||||
let v = test_with_executor_params(ctx_handle, || {
|
||||
validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)),
|
||||
validation_data.clone(),
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&metrics,
|
||||
)
|
||||
})
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)),
|
||||
validation_data.clone(),
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
))
|
||||
.unwrap();
|
||||
|
||||
assert_matches!(v, ValidationResult::Valid(outputs, used_validation_data) => {
|
||||
@@ -517,27 +479,21 @@ fn candidate_validation_bad_return_is_invalid() {
|
||||
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let metrics = Metrics::default();
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Err(
|
||||
ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout),
|
||||
)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
))
|
||||
.unwrap();
|
||||
|
||||
let v = test_with_executor_params(ctx_handle, || {
|
||||
validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Err(
|
||||
ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout),
|
||||
)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&metrics,
|
||||
)
|
||||
});
|
||||
|
||||
assert_matches!(v, Ok(ValidationResult::Invalid(InvalidCandidate::Timeout)));
|
||||
assert_matches!(v, ValidationResult::Invalid(InvalidCandidate::Timeout));
|
||||
}
|
||||
|
||||
// Test that we vote valid if we get `AmbiguousWorkerDeath`, retry, and then succeed.
|
||||
@@ -588,26 +544,19 @@ fn candidate_validation_one_ambiguous_error_is_valid() {
|
||||
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: commitments.hash() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let metrics = Metrics::default();
|
||||
|
||||
let v = test_with_executor_params(ctx_handle, || {
|
||||
validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result_list(vec![
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
Ok(validation_result),
|
||||
]),
|
||||
validation_data.clone(),
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&metrics,
|
||||
)
|
||||
})
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
MockValidateCandidateBackend::with_hardcoded_result_list(vec![
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
Ok(validation_result),
|
||||
]),
|
||||
validation_data.clone(),
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
))
|
||||
.unwrap();
|
||||
|
||||
assert_matches!(v, ValidationResult::Valid(outputs, used_validation_data) => {
|
||||
@@ -648,26 +597,19 @@ fn candidate_validation_multiple_ambiguous_errors_is_invalid() {
|
||||
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let metrics = Metrics::default();
|
||||
|
||||
let v = test_with_executor_params(ctx_handle, || {
|
||||
validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result_list(vec![
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
]),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&metrics,
|
||||
)
|
||||
})
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
MockValidateCandidateBackend::with_hardcoded_result_list(vec![
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
]),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
))
|
||||
.unwrap();
|
||||
|
||||
assert_matches!(v, ValidationResult::Invalid(InvalidCandidate::ExecutionError(_)));
|
||||
@@ -702,29 +644,22 @@ fn candidate_validation_retry_internal_errors() {
|
||||
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let metrics = Metrics::default();
|
||||
|
||||
let v = test_with_executor_params(ctx_handle, || {
|
||||
validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result_list(vec![
|
||||
Err(InternalValidationError::HostCommunication("foo".into()).into()),
|
||||
// Throw an AWD error, we should still retry again.
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
// Throw another internal error.
|
||||
Err(InternalValidationError::HostCommunication("bar".into()).into()),
|
||||
]),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&metrics,
|
||||
)
|
||||
});
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
MockValidateCandidateBackend::with_hardcoded_result_list(vec![
|
||||
Err(InternalValidationError::HostCommunication("foo".into()).into()),
|
||||
// Throw an AWD error, we should still retry again.
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
// Throw another internal error.
|
||||
Err(InternalValidationError::HostCommunication("bar".into()).into()),
|
||||
]),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
));
|
||||
|
||||
assert_matches!(v, Err(ValidationFailed(s)) if s.contains("bar"));
|
||||
}
|
||||
@@ -758,29 +693,22 @@ fn candidate_validation_retry_panic_errors() {
|
||||
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let metrics = Metrics::default();
|
||||
|
||||
let v = test_with_executor_params(ctx_handle, || {
|
||||
validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result_list(vec![
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::Panic("foo".into()))),
|
||||
// Throw an AWD error, we should still retry again.
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
// Throw another panic error.
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::Panic("bar".into()))),
|
||||
]),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&metrics,
|
||||
)
|
||||
});
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
MockValidateCandidateBackend::with_hardcoded_result_list(vec![
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::Panic("foo".into()))),
|
||||
// Throw an AWD error, we should still retry again.
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::AmbiguousWorkerDeath)),
|
||||
// Throw another panic error.
|
||||
Err(ValidationError::InvalidCandidate(WasmInvalidCandidate::Panic("bar".into()))),
|
||||
]),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
));
|
||||
|
||||
assert_matches!(v, Ok(ValidationResult::Invalid(InvalidCandidate::ExecutionError(s))) if s == "bar".to_string());
|
||||
}
|
||||
@@ -813,25 +741,18 @@ fn candidate_validation_timeout_is_internal_error() {
|
||||
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let metrics = Metrics::default();
|
||||
|
||||
let v = test_with_executor_params(ctx_handle, || {
|
||||
validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Err(
|
||||
ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout),
|
||||
)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&metrics,
|
||||
)
|
||||
});
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Err(
|
||||
ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout),
|
||||
)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
));
|
||||
|
||||
assert_matches!(v, Ok(ValidationResult::Invalid(InvalidCandidate::Timeout)));
|
||||
}
|
||||
@@ -867,23 +788,16 @@ fn candidate_validation_commitment_hash_mismatch_is_invalid() {
|
||||
hrmp_watermark: 12345,
|
||||
};
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let metrics = Metrics::default();
|
||||
|
||||
let result = test_with_executor_params(ctx_handle, || {
|
||||
validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&metrics,
|
||||
)
|
||||
})
|
||||
let result = executor::block_on(validate_candidate_exhaustive(
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
))
|
||||
.unwrap();
|
||||
|
||||
// Ensure `post validation` check on the commitments hash works as expected.
|
||||
@@ -919,11 +833,9 @@ fn candidate_validation_code_mismatch_is_invalid() {
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, _ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let (_ctx, _ctx_handle) = test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Err(
|
||||
ValidationError::InvalidCandidate(WasmInvalidCandidate::HardTimeout),
|
||||
)),
|
||||
@@ -931,6 +843,7 @@ fn candidate_validation_code_mismatch_is_invalid() {
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
))
|
||||
@@ -981,23 +894,16 @@ fn compressed_code_works() {
|
||||
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: commitments.hash() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let metrics = Metrics::default();
|
||||
|
||||
let v = test_with_executor_params(ctx_handle, || {
|
||||
validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&metrics,
|
||||
)
|
||||
});
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
));
|
||||
|
||||
assert_matches!(v, Ok(ValidationResult::Valid(_, _)));
|
||||
}
|
||||
@@ -1037,16 +943,15 @@ fn code_decompression_failure_is_error() {
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, _ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let (_ctx, _ctx_handle) = test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
));
|
||||
@@ -1090,16 +995,15 @@ fn pov_decompression_failure_is_invalid() {
|
||||
let candidate_receipt = CandidateReceipt { descriptor, commitments_hash: Hash::zero() };
|
||||
|
||||
let pool = TaskExecutor::new();
|
||||
let (mut ctx, _ctx_handle) =
|
||||
test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
let (_ctx, _ctx_handle) = test_helpers::make_subsystem_context::<AllMessages, _>(pool.clone());
|
||||
|
||||
let v = executor::block_on(validate_candidate_exhaustive(
|
||||
ctx.sender(),
|
||||
MockValidateCandidateBackend::with_hardcoded_result(Ok(validation_result)),
|
||||
validation_data,
|
||||
validation_code,
|
||||
candidate_receipt,
|
||||
Arc::new(pov),
|
||||
ExecutorParams::default(),
|
||||
PvfExecTimeoutKind::Backing,
|
||||
&Default::default(),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user