Make ValidationPool accepts execution mode to run custom command or in process validation (#1622)

* Initial commit

Forked at: cc19f13468
Parent branch: origin/master

* Propagate test mode all the way down to ValidationPool

* Update validation/src/validation_service/mod.rs

* Fix test

* WIP

Forked at: cc19f13468
Parent branch: origin/master

* Update service/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Adapt code to review suggestions

* Run validation inside the same process

* Add test

* CLEANUP

Forked at: cc19f13468
Parent branch: origin/master

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Cecile Tonglet
2020-09-09 12:17:22 +02:00
committed by GitHub
parent 4d31f8159d
commit 5338b23ca3
5 changed files with 121 additions and 56 deletions
@@ -35,8 +35,10 @@ use polkadot_primitives::v1::{
ValidationCode, PoV, CandidateDescriptor, ValidationData, PersistedValidationData,
TransientValidationData, OccupiedCoreAssumption, Hash,
};
use polkadot_parachain::wasm_executor::{self, ValidationPool, ExecutionMode, ValidationError,
InvalidCandidate as WasmInvalidCandidate};
use polkadot_parachain::wasm_executor::{
self, ValidationPool, ExecutionMode, ValidationError,
InvalidCandidate as WasmInvalidCandidate, ValidationExecutionMode,
};
use polkadot_parachain::primitives::{ValidationResult as WasmValidationResult, ValidationParams};
use parity_scale_codec::Encode;
@@ -128,7 +130,7 @@ async fn run(
)
-> SubsystemResult<()>
{
let pool = ValidationPool::new();
let pool = ValidationPool::new(ValidationExecutionMode::ExternalProcessSelfHost);
loop {
match ctx.recv().await? {