1
// Copyright (C) Moondance Labs Ltd.
2
// This file is part of Tanssi.
3

            
4
// Tanssi is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Tanssi is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Tanssi.  If not, see <http://www.gnu.org/licenses/>.
16

            
17
//! A collection of node-specific RPC methods.
18
//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer
19
//! used by Substrate nodes. This file extends those RPC definitions with
20
//! capabilities that are specific to this project's runtime configuration.
21

            
22
#![warn(missing_docs)]
23

            
24
pub use sc_rpc::SubscriptionTaskExecutor;
25

            
26
use {
27
    container_chain_template_frontier_runtime::{opaque::Block, AccountId, Hash, Index},
28
    core::marker::PhantomData,
29
    cumulus_client_parachain_inherent::ParachainInherentData,
30
    cumulus_primitives_core::{ParaId, PersistedValidationData},
31
    cumulus_test_relay_sproof_builder::RelayStateSproofBuilder,
32
    fc_rpc::{
33
        EthApiServer, EthFilterApiServer, EthPubSubApiServer, EthTask, TxPool, TxPoolApiServer,
34
    },
35
    fc_storage::StorageOverride,
36
    fp_rpc::EthereumRuntimeRPCApi,
37
    frame_support::CloneNoBound,
38
    futures::StreamExt,
39
    jsonrpsee::RpcModule,
40
    manual_xcm_rpc::{ManualXcm, ManualXcmApiServer},
41
    sc_client_api::{
42
        backend::{Backend, StateBackend},
43
        client::BlockchainEvents,
44
        AuxStore, BlockOf, StorageProvider,
45
    },
46
    sc_consensus_manual_seal::rpc::{EngineCommand, ManualSeal, ManualSealApiServer},
47
    sc_network_sync::SyncingService,
48
    sc_service::TaskManager,
49
    sc_transaction_pool_api::TransactionPool,
50
    sp_api::{CallApiAt, ProvideRuntimeApi},
51
    sp_block_builder::BlockBuilder,
52
    sp_blockchain::{
53
        Backend as BlockchainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata,
54
    },
55
    sp_consensus_aura::SlotDuration,
56
    sp_core::H256,
57
    sp_runtime::traits::{BlakeTwo256, Block as BlockT, Header as HeaderT},
58
    std::{
59
        collections::BTreeMap,
60
        sync::{Arc, Mutex},
61
        time::Duration,
62
    },
63
    tc_service_container_chain::service::{ContainerChainClient, MinimalContainerRuntimeApi},
64
};
65

            
66
pub struct DefaultEthConfig<C, BE>(std::marker::PhantomData<(C, BE)>);
67

            
68
impl<C, BE> fc_rpc::EthConfig<Block, C> for DefaultEthConfig<C, BE>
69
where
70
    C: StorageProvider<Block, BE> + Sync + Send + 'static,
71
    BE: Backend<Block> + 'static,
72
{
73
    type EstimateGasAdapter = ();
74
    type RuntimeStorageOverride =
75
        fc_rpc::frontier_backend_client::SystemAccountId20StorageOverride<Block, C, BE>;
76
}
77

            
78
mod eth;
79
pub use eth::*;
80
mod finality;
81

            
82
/// Full client dependencies.
83
pub struct FullDeps<C, P, BE> {
84
    /// The client instance to use.
85
    pub client: Arc<C>,
86
    /// Transaction pool instance.
87
    pub pool: Arc<P>,
88
    /// Graph pool instance.
89
    pub graph: Arc<P>,
90
    /// Network service
91
    pub network: Arc<dyn sc_network::service::traits::NetworkService>,
92
    /// Chain syncing service
93
    pub sync: Arc<SyncingService<Block>>,
94
    /// EthFilterApi pool.
95
    pub filter_pool: Option<FilterPool>,
96
    /// Frontier Backend.
97
    // TODO: log indexer?
98
    pub frontier_backend: Arc<dyn fc_api::Backend<Block>>,
99
    /// Backend.
100
    #[allow(dead_code)] // not used but keep nice type inference
101
    pub backend: Arc<BE>,
102
    /// Maximum number of logs in a query.
103
    pub max_past_logs: u32,
104
    /// Maximum block range in a query.
105
    pub max_block_range: u32,
106
    /// Maximum fee history cache size.
107
    pub fee_history_limit: u64,
108
    /// Fee history cache.
109
    pub fee_history_cache: FeeHistoryCache,
110
    /// Ethereum data access overrides.
111
    pub overrides: Arc<dyn StorageOverride<Block>>,
112
    /// Cache for Ethereum block data.
113
    pub block_data_cache: Arc<EthBlockDataCacheTask<Block>>,
114
    /// The Node authority flag
115
    pub is_authority: bool,
116
    /// Manual seal command sink
117
    pub command_sink: Option<futures::channel::mpsc::Sender<EngineCommand<Hash>>>,
118
    /// Channels for manual xcm messages (downward, hrmp)
119
    pub xcm_senders: Option<(flume::Sender<Vec<u8>>, flume::Sender<(ParaId, Vec<u8>)>)>,
120
}
121

            
122
/// Instantiate all Full RPC extensions.
123
296
pub fn create_full<C, P, BE>(
124
296
    deps: FullDeps<C, P, BE>,
125
296
    subscription_task_executor: SubscriptionTaskExecutor,
126
296
    pubsub_notification_sinks: Arc<
127
296
        fc_mapping_sync::EthereumBlockNotificationSinks<
128
296
            fc_mapping_sync::EthereumBlockNotification<Block>,
129
296
        >,
130
296
    >,
131
296
) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
132
296
where
133
296
    BE: Backend<Block> + 'static,
134
296
    BE::State: StateBackend<BlakeTwo256>,
135
296
    BE::Blockchain: BlockchainBackend<Block>,
136
296
    C: ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + AuxStore,
137
296
    C: BlockchainEvents<Block>,
138
296
    C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,
139
296
    C: CallApiAt<Block>,
140
296
    C: Send + Sync + 'static,
141
296
    C::Api: RuntimeApiCollection,
142
296
    P: TransactionPool<Block = Block, Hash = <Block as BlockT>::Hash> + 'static,
143
296
{
144
    use {
145
        fc_rpc::{Eth, EthFilter, EthPubSub, Net, NetApiServer, Web3, Web3ApiServer},
146
        finality::{FrontierFinality, FrontierFinalityApiServer},
147
        substrate_frame_rpc_system::{System, SystemApiServer},
148
    };
149

            
150
296
    let mut io = RpcModule::new(());
151
296
    let FullDeps {
152
296
        client,
153
296
        pool,
154
296
        graph,
155
296
        network,
156
296
        sync,
157
296
        filter_pool,
158
296
        frontier_backend,
159
296
        backend: _,
160
296
        max_past_logs,
161
296
        max_block_range,
162
296
        fee_history_limit,
163
296
        fee_history_cache,
164
296
        overrides,
165
296
        block_data_cache,
166
296
        is_authority,
167
296
        command_sink,
168
296
        xcm_senders,
169
296
    } = deps;
170
296

            
171
296
    io.merge(System::new(Arc::clone(&client), Arc::clone(&pool)).into_rpc())?;
172

            
173
    // TODO: are we supporting signing?
174
296
    let signers = Vec::new();
175

            
176
    enum Never {}
177
    impl<T> fp_rpc::ConvertTransaction<T> for Never {
178
        fn convert_transaction(&self, _transaction: pallet_ethereum::Transaction) -> T {
179
            // The Never type is not instantiable, but this method requires the type to be
180
            // instantiated to be called (`&self` parameter), so if the code compiles we have the
181
            // guarantee that this function will never be called.
182
            unreachable!()
183
        }
184
    }
185
296
    let convert_transaction: Option<Never> = None;
186
296
    let authorities = vec![tc_consensus::get_aura_id_from_seed("alice")];
187
296
    let authorities_for_cdp = authorities.clone();
188
296

            
189
296
    let pending_create_inherent_data_providers = move |_, ()| {
190
4
        let authorities_for_cidp = authorities.clone();
191

            
192
4
        async move {
193
4
            let mocked_authorities_noting =
194
4
                ccp_authorities_noting_inherent::MockAuthoritiesNotingInherentDataProvider {
195
4
                    current_para_block: 1000,
196
4
                    relay_offset: 1000,
197
4
                    relay_blocks_per_para_block: 2,
198
4
                    orchestrator_para_id: 1000u32.into(),
199
4
                    container_para_id: 2000u32.into(),
200
4
                    authorities: authorities_for_cidp,
201
4
                };
202
4

            
203
4
            let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
204
4
            // Create a dummy parachain inherent data provider which is required to pass
205
4
            // the checks by the para chain system. We use dummy values because in the 'pending context'
206
4
            // neither do we have access to the real values nor do we need them.
207
4
            let (relay_parent_storage_root, relay_chain_state) = RelayStateSproofBuilder {
208
4
                additional_key_values: mocked_authorities_noting.get_key_values(),
209
4
                ..Default::default()
210
4
            }
211
4
            .into_state_root_and_proof();
212
4
            let vfp = PersistedValidationData {
213
4
                // This is a hack to make `cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases`
214
4
                // happy. Relay parent number can't be bigger than u32::MAX.
215
4
                relay_parent_number: u32::MAX,
216
4
                relay_parent_storage_root,
217
4
                ..Default::default()
218
4
            };
219
4
            let parachain_inherent_data = ParachainInherentData {
220
4
                validation_data: vfp,
221
4
                relay_chain_state,
222
4
                downward_messages: Default::default(),
223
4
                horizontal_messages: Default::default(),
224
4
            };
225
4
            Ok((
226
4
                timestamp,
227
4
                parachain_inherent_data,
228
4
                mocked_authorities_noting,
229
4
            ))
230
4
        }
231
4
    };
232

            
233
296
    let pending_consensus_data_provider_frontier: Option<
234
296
        Box<(dyn fc_rpc::pending::ConsensusDataProvider<_>)>,
235
296
    > = Some(Box::new(
236
296
        tc_consensus::ContainerManualSealAuraConsensusDataProvider::new(
237
296
            SlotDuration::from_millis(container_chain_template_frontier_runtime::SLOT_DURATION),
238
296
            authorities_for_cdp,
239
296
        ),
240
296
    ));
241
296

            
242
296
    io.merge(
243
296
        Eth::<_, _, _, _, _, _, DefaultEthConfig<C, BE>>::new(
244
296
            Arc::clone(&client),
245
296
            Arc::clone(&pool),
246
296
            Arc::clone(&graph),
247
296
            convert_transaction,
248
296
            Arc::clone(&sync),
249
296
            signers,
250
296
            Arc::clone(&overrides),
251
296
            Arc::clone(&frontier_backend),
252
296
            is_authority,
253
296
            Arc::clone(&block_data_cache),
254
296
            fee_history_cache,
255
296
            fee_history_limit,
256
296
            10,
257
296
            None,
258
296
            pending_create_inherent_data_providers,
259
296
            pending_consensus_data_provider_frontier,
260
296
        )
261
296
        .into_rpc(),
262
296
    )?;
263

            
264
296
    let tx_pool: TxPool<Block, _, _> = TxPool::new(client.clone(), graph.clone());
265
296
    if let Some(filter_pool) = filter_pool {
266
296
        io.merge(
267
296
            EthFilter::new(
268
296
                client.clone(),
269
296
                frontier_backend.clone(),
270
296
                graph,
271
296
                filter_pool,
272
296
                500_usize, // max stored filters
273
296
                max_past_logs,
274
296
                max_block_range,
275
296
                block_data_cache,
276
296
            )
277
296
            .into_rpc(),
278
296
        )?;
279
    }
280

            
281
296
    io.merge(
282
296
        Net::new(
283
296
            Arc::clone(&client),
284
296
            network,
285
296
            // Whether to format the `peer_count` response as Hex (default) or not.
286
296
            true,
287
296
        )
288
296
        .into_rpc(),
289
296
    )?;
290

            
291
296
    if let Some(command_sink) = command_sink {
292
296
        io.merge(
293
296
            // We provide the rpc handler with the sending end of the channel to allow the rpc
294
296
            // send EngineCommands to the background block authorship task.
295
296
            ManualSeal::new(command_sink).into_rpc(),
296
296
        )?;
297
    };
298

            
299
296
    io.merge(Web3::new(Arc::clone(&client)).into_rpc())?;
300
296
    io.merge(
301
296
        EthPubSub::new(
302
296
            pool,
303
296
            Arc::clone(&client),
304
296
            sync,
305
296
            subscription_task_executor,
306
296
            overrides,
307
296
            pubsub_notification_sinks,
308
296
        )
309
296
        .into_rpc(),
310
296
    )?;
311
296
    io.merge(tx_pool.into_rpc())?;
312

            
313
296
    if let Some((downward_message_channel, hrmp_message_channel)) = xcm_senders {
314
296
        io.merge(
315
296
            ManualXcm {
316
296
                downward_message_channel,
317
296
                hrmp_message_channel,
318
296
            }
319
296
            .into_rpc(),
320
296
        )?;
321
    }
322

            
323
296
    io.merge(FrontierFinality::new(client.clone(), frontier_backend.clone()).into_rpc())?;
324

            
325
296
    Ok(io)
326
296
}
327

            
328
pub struct SpawnTasksParams<'a, B: BlockT, C, BE> {
329
    pub task_manager: &'a TaskManager,
330
    pub client: Arc<C>,
331
    pub substrate_backend: Arc<BE>,
332
    pub frontier_backend: Arc<fc_db::Backend<B, C>>,
333
    pub filter_pool: Option<FilterPool>,
334
    pub overrides: Arc<dyn StorageOverride<B>>,
335
    pub fee_history_limit: u64,
336
    pub fee_history_cache: FeeHistoryCache,
337
    /// Chain syncing service
338
    pub sync_service: Arc<SyncingService<B>>,
339
    /// Chain syncing service
340
    pub pubsub_notification_sinks: Arc<
341
        fc_mapping_sync::EthereumBlockNotificationSinks<
342
            fc_mapping_sync::EthereumBlockNotification<B>,
343
        >,
344
    >,
345
}
346

            
347
use fc_mapping_sync::{kv::MappingSyncWorker, SyncStrategy};
348
/// Spawn the tasks that are required to run Moonbeam.
349
148
pub fn spawn_essential_tasks<B, C, BE>(params: SpawnTasksParams<B, C, BE>)
350
148
where
351
148
    C: ProvideRuntimeApi<B> + BlockOf,
352
148
    C: HeaderBackend<B> + HeaderMetadata<B, Error = BlockChainError> + 'static,
353
148
    C: BlockchainEvents<B> + StorageProvider<B, BE>,
354
148
    C: Send + Sync + 'static,
355
148
    C::Api: EthereumRuntimeRPCApi<B>,
356
148
    C::Api: BlockBuilder<B>,
357
148
    B: BlockT<Hash = H256> + Send + Sync + 'static,
358
148
    B::Header: HeaderT<Number = u32>,
359
148
    BE: Backend<B> + 'static,
360
148
    BE::State: StateBackend<BlakeTwo256>,
361
148
{
362
148
    // Frontier offchain DB task. Essential.
363
148
    // Maps emulated ethereum data to substrate native data.
364
148
    match &*params.frontier_backend {
365
148
        fc_db::Backend::KeyValue(b) => {
366
148
            params.task_manager.spawn_essential_handle().spawn(
367
148
                "frontier-mapping-sync-worker",
368
148
                Some("frontier"),
369
148
                MappingSyncWorker::new(
370
148
                    params.client.import_notification_stream(),
371
148
                    Duration::new(6, 0),
372
148
                    params.client.clone(),
373
148
                    params.substrate_backend.clone(),
374
148
                    params.overrides.clone(),
375
148
                    b.clone(),
376
148
                    3,
377
148
                    0,
378
148
                    SyncStrategy::Parachain,
379
148
                    params.sync_service.clone(),
380
148
                    params.pubsub_notification_sinks.clone(),
381
148
                )
382
6368
                .for_each(|()| futures::future::ready(())),
383
148
            );
384
148
        }
385
        fc_db::Backend::Sql(b) => {
386
            params.task_manager.spawn_essential_handle().spawn_blocking(
387
                "frontier-mapping-sync-worker",
388
                Some("frontier"),
389
                fc_mapping_sync::sql::SyncWorker::run(
390
                    params.client.clone(),
391
                    params.substrate_backend.clone(),
392
                    b.clone(),
393
                    params.client.import_notification_stream(),
394
                    fc_mapping_sync::sql::SyncWorkerConfig {
395
                        read_notification_timeout: Duration::from_secs(10),
396
                        check_indexed_blocks_interval: Duration::from_secs(60),
397
                    },
398
                    fc_mapping_sync::SyncStrategy::Parachain,
399
                    params.sync_service.clone(),
400
                    params.pubsub_notification_sinks.clone(),
401
                ),
402
            );
403
        }
404
    }
405

            
406
    // Frontier `EthFilterApi` maintenance.
407
    // Manages the pool of user-created Filters.
408
148
    if let Some(filter_pool) = params.filter_pool {
409
148
        // Each filter is allowed to stay in the pool for 100 blocks.
410
148
        // TODO: Re-visit this assumption with parathreads, as they
411
148
        // might have a block every good amount of time, and can be abused
412
148
        // likely we will need to implement a time-based filter
413
148
        const FILTER_RETAIN_THRESHOLD: u64 = 100;
414
148
        params.task_manager.spawn_essential_handle().spawn(
415
148
            "frontier-filter-pool",
416
148
            Some("frontier"),
417
148
            EthTask::filter_pool_task(
418
148
                Arc::clone(&params.client),
419
148
                filter_pool,
420
148
                FILTER_RETAIN_THRESHOLD,
421
148
            ),
422
148
        );
423
148
    }
424

            
425
    // Spawn Frontier FeeHistory cache maintenance task.
426
148
    params.task_manager.spawn_essential_handle().spawn(
427
148
        "frontier-fee-history",
428
148
        Some("frontier"),
429
148
        EthTask::fee_history_task(
430
148
            Arc::clone(&params.client),
431
148
            Arc::clone(&params.overrides),
432
148
            params.fee_history_cache,
433
148
            params.fee_history_limit,
434
148
        ),
435
148
    );
436
148
}
437

            
438
/// A set of APIs that polkadot-like runtimes must implement.
439
///
440
/// This trait has no methods or associated type. It is a concise marker for all the trait bounds
441
/// that it contains.
442
pub trait RuntimeApiCollection:
443
    sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
444
    + sp_api::ApiExt<Block>
445
    + sp_block_builder::BlockBuilder<Block>
446
    + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
447
    + sp_api::Metadata<Block>
448
    + sp_offchain::OffchainWorkerApi<Block>
449
    + sp_session::SessionKeys<Block>
450
    + fp_rpc::ConvertTransactionRuntimeApi<Block>
451
    + fp_rpc::EthereumRuntimeRPCApi<Block>
452
    + cumulus_primitives_core::CollectCollationInfo<Block>
453
{
454
}
455

            
456
impl<Api> RuntimeApiCollection for Api where
457
    Api: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
458
        + sp_api::ApiExt<Block>
459
        + sp_block_builder::BlockBuilder<Block>
460
        + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
461
        + sp_api::Metadata<Block>
462
        + sp_offchain::OffchainWorkerApi<Block>
463
        + sp_session::SessionKeys<Block>
464
        + fp_rpc::ConvertTransactionRuntimeApi<Block>
465
        + fp_rpc::EthereumRuntimeRPCApi<Block>
466
        + cumulus_primitives_core::CollectCollationInfo<Block>
467
{
468
}
469

            
470
tp_traits::alias!(
471
    pub trait FrontierRpcRuntimeApi:
472
        MinimalContainerRuntimeApi +
473
        sp_api::ConstructRuntimeApi<
474
            Block,
475
            ContainerChainClient<Self>,
476
            RuntimeApi:
477
                RuntimeApiCollection
478
        >
479
);
480

            
481
#[derive(CloneNoBound)]
482
pub struct GenerateFrontierRpcBuilder<RuntimeApi> {
483
    pub rpc_config: crate::cli::RpcConfig,
484
    pub phantom: PhantomData<RuntimeApi>,
485
}
486

            
487
const _: () = {
488
    use tc_service_container_chain::rpc::generate_rpc_builder::*;
489

            
490
    impl<RuntimeApi: FrontierRpcRuntimeApi> GenerateRpcBuilder<RuntimeApi>
491
        for GenerateFrontierRpcBuilder<RuntimeApi>
492
    {
493
        fn generate(
494
            &self,
495
            GenerateRpcBuilderParams {
496
                backend,
497
                client,
498
                network,
499
                container_chain_config,
500
                prometheus_registry,
501
                sync_service,
502
                task_manager,
503
                transaction_pool,
504
                ..
505
            }: GenerateRpcBuilderParams<RuntimeApi>,
506
        ) -> Result<CompleteRpcBuilder, ServiceError> {
507
            let max_past_logs = self.rpc_config.max_past_logs;
508
            let max_block_range = self.rpc_config.max_block_range;
509

            
510
            // Frontier specific stuff
511
            let filter_pool: Option<FilterPool> = Some(Arc::new(Mutex::new(BTreeMap::new())));
512
            let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new()));
513
            let frontier_backend = Arc::new(fc_db::Backend::KeyValue(
514
                crate::service::open_frontier_backend(client.clone(), container_chain_config)?
515
                    .into(),
516
            ));
517
            let overrides = Arc::new(fc_rpc::StorageOverrideHandler::new(client.clone()));
518
            let fee_history_limit = self.rpc_config.fee_history_limit;
519

            
520
            let pubsub_notification_sinks: fc_mapping_sync::EthereumBlockNotificationSinks<
521
                fc_mapping_sync::EthereumBlockNotification<Block>,
522
            > = Default::default();
523
            let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks);
524

            
525
            spawn_essential_tasks(SpawnTasksParams {
526
                task_manager,
527
                client: client.clone(),
528
                substrate_backend: backend.clone(),
529
                frontier_backend: frontier_backend.clone(),
530
                filter_pool: filter_pool.clone(),
531
                overrides: overrides.clone(),
532
                fee_history_limit,
533
                fee_history_cache: fee_history_cache.clone(),
534
                sync_service: sync_service.clone(),
535
                pubsub_notification_sinks: pubsub_notification_sinks.clone(),
536
            });
537

            
538
            let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new(
539
                task_manager.spawn_handle(),
540
                overrides.clone(),
541
                self.rpc_config.eth_log_block_cache,
542
                self.rpc_config.eth_statuses_cache,
543
                prometheus_registry.clone(),
544
            ));
545

            
546
            Ok(Box::new(move |subscription_task_executor| {
547
                let deps = crate::rpc::FullDeps {
548
                    backend: backend.clone(),
549
                    client: client.clone(),
550
                    filter_pool: filter_pool.clone(),
551
                    frontier_backend: match &*frontier_backend {
552
                        fc_db::Backend::KeyValue(b) => b.clone(),
553
                        fc_db::Backend::Sql(b) => b.clone(),
554
                    },
555
                    graph: transaction_pool.clone(),
556
                    pool: transaction_pool.clone(),
557
                    max_past_logs,
558
                    max_block_range,
559
                    fee_history_limit,
560
                    fee_history_cache: fee_history_cache.clone(),
561
                    network: Arc::new(network.clone()),
562
                    sync: sync_service.clone(),
563
                    block_data_cache: block_data_cache.clone(),
564
                    overrides: overrides.clone(),
565
                    is_authority: false,
566
                    command_sink: None,
567
                    xcm_senders: None,
568
                };
569
                crate::rpc::create_full(
570
                    deps,
571
                    subscription_task_executor,
572
                    pubsub_notification_sinks.clone(),
573
                )
574
                .map_err(Into::into)
575
            }))
576
        }
577
    }
578
};