@@ -28,15 +28,16 @@ use std::{sync::Arc, time::Duration};
2828use rialto_parachain_runtime:: RuntimeApi ;
2929
3030// Cumulus Imports
31+ use cumulus_client_cli:: CollatorOptions ;
3132use cumulus_client_consensus_aura:: { AuraConsensus , BuildAuraConsensusParams , SlotProportion } ;
3233use cumulus_client_consensus_common:: ParachainConsensus ;
3334use cumulus_client_network:: BlockAnnounceValidator ;
3435use cumulus_client_service:: {
3536 prepare_node_config, start_collator, start_full_node, StartCollatorParams , StartFullNodeParams ,
3637} ;
3738use cumulus_primitives_core:: ParaId ;
38- use cumulus_relay_chain_interface :: RelayChainInterface ;
39- use cumulus_relay_chain_local :: build_relay_chain_interface ;
39+ use cumulus_relay_chain_inprocess_interface :: build_inprocess_relay_chain ;
40+ use cumulus_relay_chain_interface :: { RelayChainError , RelayChainInterface } ;
4041
4142// Substrate Imports
4243use sc_client_api:: ExecutorProvider ;
@@ -45,7 +46,6 @@ use sc_network::NetworkService;
4546use sc_service:: { Configuration , PartialComponents , Role , TFullBackend , TFullClient , TaskManager } ;
4647use sc_telemetry:: { Telemetry , TelemetryHandle , TelemetryWorker , TelemetryWorkerHandle } ;
4748use sp_api:: ConstructRuntimeApi ;
48- use sp_consensus:: SlotData ;
4949use sp_keystore:: SyncCryptoStorePtr ;
5050use sp_runtime:: traits:: BlakeTwo256 ;
5151use substrate_prometheus_endpoint:: Registry ;
@@ -195,6 +195,7 @@ where
195195async fn start_node_impl < RuntimeApi , Executor , RB , BIQ , BIC > (
196196 parachain_config : Configuration ,
197197 polkadot_config : Configuration ,
198+ collator_options : CollatorOptions ,
198199 id : ParaId ,
199200 rpc_ext_builder : RB ,
200201 build_import_queue : BIQ ,
@@ -270,12 +271,16 @@ where
270271 let ( mut telemetry, telemetry_worker_handle) = params. other ;
271272
272273 let mut task_manager = params. task_manager ;
273- let ( relay_chain_interface, collator_key) =
274- build_relay_chain_interface ( polkadot_config, telemetry_worker_handle, & mut task_manager)
275- . map_err ( |e| match e {
276- polkadot_service:: Error :: Sub ( x) => x,
277- s => format ! ( "{}" , s) . into ( ) ,
278- } ) ?;
274+ let ( relay_chain_interface, collator_key) = build_inprocess_relay_chain (
275+ polkadot_config,
276+ & parachain_config,
277+ telemetry_worker_handle,
278+ & mut task_manager,
279+ )
280+ . map_err ( |e| match e {
281+ RelayChainError :: ServiceError ( polkadot_service:: Error :: Sub ( x) ) => x,
282+ s => s. to_string ( ) . into ( ) ,
283+ } ) ?;
279284
280285 let client = params. client . clone ( ) ;
281286 let backend = params. backend . clone ( ) ;
@@ -350,7 +355,7 @@ where
350355 spawner,
351356 parachain_consensus,
352357 import_queue,
353- collator_key,
358+ collator_key : collator_key . expect ( "Command line arguments do not allow this. qed" ) ,
354359 relay_chain_slot_duration,
355360 } ;
356361
@@ -364,6 +369,7 @@ where
364369 relay_chain_interface,
365370 relay_chain_slot_duration,
366371 import_queue,
372+ collator_options,
367373 } ;
368374
369375 start_full_node ( params) ?;
@@ -405,9 +411,9 @@ pub fn parachain_build_import_queue(
405411 let time = sp_timestamp:: InherentDataProvider :: from_system_time ( ) ;
406412
407413 let slot =
408- sp_consensus_aura:: inherents:: InherentDataProvider :: from_timestamp_and_duration (
414+ sp_consensus_aura:: inherents:: InherentDataProvider :: from_timestamp_and_slot_duration (
409415 * time,
410- slot_duration. slot_duration ( ) ,
416+ slot_duration,
411417 ) ;
412418
413419 Ok ( ( time, slot) )
@@ -424,6 +430,7 @@ pub fn parachain_build_import_queue(
424430pub async fn start_node (
425431 parachain_config : Configuration ,
426432 polkadot_config : Configuration ,
433+ collator_options : CollatorOptions ,
427434 id : ParaId ,
428435) -> sc_service:: error:: Result < (
429436 TaskManager ,
@@ -432,6 +439,7 @@ pub async fn start_node(
432439 start_node_impl :: < RuntimeApi , ParachainRuntimeExecutor , _ , _ , _ > (
433440 parachain_config,
434441 polkadot_config,
442+ collator_options,
435443 id,
436444 |deny_unsafe, client, pool| {
437445 use pallet_transaction_payment_rpc:: { TransactionPayment , TransactionPaymentApi } ;
@@ -481,9 +489,9 @@ pub async fn start_node(
481489 ) . await ;
482490 let time = sp_timestamp:: InherentDataProvider :: from_system_time ( ) ;
483491
484- let slot = sp_consensus_aura:: inherents:: InherentDataProvider :: from_timestamp_and_duration (
492+ let slot = sp_consensus_aura:: inherents:: InherentDataProvider :: from_timestamp_and_slot_duration (
485493 * time,
486- slot_duration. slot_duration ( ) ,
494+ slot_duration,
487495 ) ;
488496
489497 let parachain_inherent = parachain_inherent. ok_or_else ( || {
0 commit comments