mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 00:31:07 +00:00
Parachain validation moved to external process (#325)
* Improved execution & tests * Style * Made CLI arg const * Moved Upwards message * CLI subcommand for validation worker * Build halting parachain * Build halting parachain * Made stuff private * Reorganized parachain tests * Comment * Whitespace * Apply suggestions from code review Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Fixed call data size check and introduced an enum * Apply suggestions from code review Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
157cd9a217
commit
f1fdb0cb83
@@ -26,7 +26,7 @@ use polkadot_primitives::{Block, Hash, BlockId, Balance, parachain::{
|
||||
Id as ParaId, Collation, Extrinsic, OutgoingMessage, UpwardMessage, FeeSchedule,
|
||||
}};
|
||||
use runtime_primitives::traits::ProvideRuntimeApi;
|
||||
use parachain::{wasm_executor::{self, ExternalitiesError}, MessageRef, UpwardMessageRef};
|
||||
use parachain::{wasm_executor::{self, ExternalitiesError, ExecutionMode}, MessageRef, UpwardMessageRef};
|
||||
|
||||
use futures::prelude::*;
|
||||
use log::debug;
|
||||
@@ -434,7 +434,7 @@ pub fn validate_collation<P>(
|
||||
fees_charged: 0,
|
||||
};
|
||||
|
||||
match wasm_executor::validate_candidate(&validation_code, params, &mut ext) {
|
||||
match wasm_executor::validate_candidate(&validation_code, params, &mut ext, ExecutionMode::Remote) {
|
||||
Ok(result) => {
|
||||
if result.head_data == collation.receipt.head_data.0 {
|
||||
ext.final_checks(&collation.receipt)
|
||||
|
||||
@@ -75,6 +75,7 @@ pub use self::shared_table::{
|
||||
SharedTable, ParachainWork, PrimedParachainWork, Validated, Statement, SignedStatement,
|
||||
GenericStatement,
|
||||
};
|
||||
pub use parachain::wasm_executor::{run_worker as run_validation_worker};
|
||||
|
||||
mod attestation_service;
|
||||
mod dynamic_inclusion;
|
||||
@@ -450,7 +451,7 @@ pub struct ProposerFactory<C, N, P, SC, TxApi: PoolChainApi> {
|
||||
key: Arc<ed25519::Pair>,
|
||||
_service_handle: ServiceHandle,
|
||||
aura_slot_duration: SlotDuration,
|
||||
select_chain: SC,
|
||||
_select_chain: SC,
|
||||
max_block_data_size: Option<u64>,
|
||||
}
|
||||
|
||||
@@ -469,7 +470,7 @@ impl<C, N, P, SC, TxApi> ProposerFactory<C, N, P, SC, TxApi> where
|
||||
/// Create a new proposer factory.
|
||||
pub fn new(
|
||||
client: Arc<P>,
|
||||
select_chain: SC,
|
||||
_select_chain: SC,
|
||||
network: N,
|
||||
collators: C,
|
||||
transaction_pool: Arc<Pool<TxApi>>,
|
||||
@@ -490,7 +491,7 @@ impl<C, N, P, SC, TxApi> ProposerFactory<C, N, P, SC, TxApi> where
|
||||
|
||||
let service_handle = crate::attestation_service::start(
|
||||
client,
|
||||
select_chain.clone(),
|
||||
_select_chain.clone(),
|
||||
parachain_validation.clone(),
|
||||
thread_pool,
|
||||
key.clone(),
|
||||
@@ -504,7 +505,7 @@ impl<C, N, P, SC, TxApi> ProposerFactory<C, N, P, SC, TxApi> where
|
||||
key,
|
||||
_service_handle: service_handle,
|
||||
aura_slot_duration,
|
||||
select_chain,
|
||||
_select_chain,
|
||||
max_block_data_size,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user