@@ -53,41 +53,41 @@ type GrandpaBlockImport<B, C> =
53
53
sc_consensus_grandpa:: GrandpaBlockImport < FullBackend < B > , B , C , FullSelectChain < B > > ;
54
54
type GrandpaLinkHalf < B , C > = sc_consensus_grandpa:: LinkHalf < B , C , FullSelectChain < B > > ;
55
55
56
- pub fn new_partial < B , RA , HF , BIQ > (
56
+ pub fn new_partial < BIQ > (
57
57
config : & Configuration ,
58
58
eth_config : & EthConfiguration ,
59
59
build_import_queue : BIQ ,
60
60
) -> Result <
61
61
PartialComponents <
62
- FullClient < B , RA , HF > ,
63
- FullBackend < B > ,
64
- FullSelectChain < B > ,
65
- BasicQueue < B > ,
66
- FullPool < B , FullClient < B , RA , HF > > ,
62
+ Client ,
63
+ FullBackend < Block > ,
64
+ FullSelectChain < Block > ,
65
+ BasicQueue < Block > ,
66
+ FullPool < Block , Client > ,
67
67
(
68
68
Option < Telemetry > ,
69
- BoxBlockImport < B > ,
70
- GrandpaLinkHalf < B , FullClient < B , RA , HF > > ,
71
- FrontierBackend < B , FullClient < B , RA , HF > > ,
72
- Arc < dyn StorageOverride < B > > ,
69
+ BoxBlockImport < Block > ,
70
+ GrandpaLinkHalf < Block , Client > ,
71
+ FrontierBackend < Block , Client > ,
72
+ Arc < dyn StorageOverride < Block > > ,
73
73
) ,
74
74
> ,
75
75
ServiceError ,
76
76
>
77
77
where
78
- B : BlockT < Hash = H256 > ,
79
- RA : ConstructRuntimeApi < B , FullClient < B , RA , HF > > ,
80
- RA : Send + Sync + ' static ,
81
- RA :: RuntimeApi : RuntimeApiCollection < B , AuraId , AccountId , Nonce , Balance > ,
82
- HF : HostFunctionsT + ' static ,
78
+ // B: BlockT<Hash = H256>,
79
+ // RA: ConstructRuntimeApi<Block, Client >,
80
+ // RA: Send + Sync + 'static,
81
+ // RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
82
+ // HF: HostFunctionsT + 'static,
83
83
BIQ : FnOnce (
84
- Arc < FullClient < B , RA , HF > > ,
84
+ Arc < Client > ,
85
85
& Configuration ,
86
86
& EthConfiguration ,
87
87
& TaskManager ,
88
88
Option < TelemetryHandle > ,
89
- GrandpaBlockImport < B , FullClient < B , RA , HF > > ,
90
- ) -> Result < ( BasicQueue < B > , BoxBlockImport < B > ) , ServiceError > ,
89
+ GrandpaBlockImport < Block , Client > ,
90
+ ) -> Result < ( BasicQueue < Block > , BoxBlockImport < Block > ) , ServiceError > ,
91
91
{
92
92
let telemetry = config
93
93
. telemetry_endpoints
@@ -100,12 +100,13 @@ where
100
100
} )
101
101
. transpose ( ) ?;
102
102
103
- let executor = sc_service:: new_wasm_executor :: < HostFunctions > ( & config. executor ) ;
104
- let ( client, backend, keystore_container, task_manager) = sc_service:: new_full_parts :: < B , RA , _ > (
105
- config,
106
- telemetry. as_ref ( ) . map ( |( _, telemetry) | telemetry. handle ( ) ) ,
107
- executor,
108
- ) ?;
103
+ let executor = sc_service:: new_wasm_executor ( & config. executor ) ;
104
+ let ( client, backend, keystore_container, task_manager) =
105
+ sc_service:: new_full_parts :: < Block , RuntimeApi , _ > (
106
+ config,
107
+ telemetry. as_ref ( ) . map ( |( _, telemetry) | telemetry. handle ( ) ) ,
108
+ executor,
109
+ ) ?;
109
110
let client = Arc :: new ( client) ;
110
111
111
112
let telemetry = telemetry. map ( |( worker, telemetry) | {
@@ -124,7 +125,7 @@ where
124
125
telemetry. as_ref ( ) . map ( |x| x. handle ( ) ) ,
125
126
) ?;
126
127
127
- let storage_override = Arc :: new ( StorageOverrideHandler :: < B , _ , _ > :: new ( client. clone ( ) ) ) ;
128
+ let storage_override = Arc :: new ( StorageOverrideHandler :: < _ , _ , _ > :: new ( client. clone ( ) ) ) ;
128
129
let frontier_backend = match eth_config. frontier_backend_type {
129
130
BackendType :: KeyValue => FrontierBackend :: KeyValue ( Arc :: new ( fc_db:: kv:: Backend :: open (
130
131
Arc :: clone ( & client) ,
@@ -190,21 +191,21 @@ where
190
191
}
191
192
192
193
/// Build the import queue for the template runtime (aura + grandpa).
193
- pub fn build_aura_grandpa_import_queue < B , RA , HF > (
194
- client : Arc < FullClient < B , RA , HF > > ,
194
+ pub fn build_aura_grandpa_import_queue (
195
+ client : Arc < Client > ,
195
196
config : & Configuration ,
196
197
eth_config : & EthConfiguration ,
197
198
task_manager : & TaskManager ,
198
199
telemetry : Option < TelemetryHandle > ,
199
- grandpa_block_import : GrandpaBlockImport < B , FullClient < B , RA , HF > > ,
200
- ) -> Result < ( BasicQueue < B > , BoxBlockImport < B > ) , ServiceError >
200
+ grandpa_block_import : GrandpaBlockImport < Block , Client > ,
201
+ ) -> Result < ( BasicQueue < Block > , BoxBlockImport < Block > ) , ServiceError >
201
202
where
202
- B : BlockT ,
203
- NumberFor < B > : BlockNumberOps ,
204
- RA : ConstructRuntimeApi < B , FullClient < B , RA , HF > > ,
205
- RA : Send + Sync + ' static ,
206
- RA :: RuntimeApi : RuntimeApiCollection < B , AuraId , AccountId , Nonce , Balance > ,
207
- HF : HostFunctionsT + ' static ,
203
+ // B: BlockT,
204
+ NumberFor < Block > : BlockNumberOps ,
205
+ // RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
206
+ // RA: Send + Sync + 'static,
207
+ // RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
208
+ // HF: HostFunctionsT + 'static,
208
209
{
209
210
let frontier_block_import =
210
211
FrontierBlockImport :: new ( grandpa_block_import. clone ( ) , client. clone ( ) ) ;
@@ -241,20 +242,20 @@ where
241
242
}
242
243
243
244
/// Build the import queue for the template runtime (manual seal).
244
- pub fn build_manual_seal_import_queue < B , RA , HF > (
245
- client : Arc < FullClient < B , RA , HF > > ,
245
+ pub fn build_manual_seal_import_queue (
246
+ client : Arc < Client > ,
246
247
config : & Configuration ,
247
248
_eth_config : & EthConfiguration ,
248
249
task_manager : & TaskManager ,
249
250
_telemetry : Option < TelemetryHandle > ,
250
- _grandpa_block_import : GrandpaBlockImport < B , FullClient < B , RA , HF > > ,
251
- ) -> Result < ( BasicQueue < B > , BoxBlockImport < B > ) , ServiceError >
252
- where
253
- B : BlockT ,
254
- RA : ConstructRuntimeApi < B , FullClient < B , RA , HF > > ,
255
- RA : Send + Sync + ' static ,
256
- RA :: RuntimeApi : RuntimeApiCollection < B , AuraId , AccountId , Nonce , Balance > ,
257
- HF : HostFunctionsT + ' static ,
251
+ _grandpa_block_import : GrandpaBlockImport < Block , Client > ,
252
+ ) -> Result < ( BasicQueue < Block > , BoxBlockImport < Block > ) , ServiceError >
253
+ // where
254
+ // B: BlockT,
255
+ // RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
256
+ // RA: Send + Sync + 'static,
257
+ // RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
258
+ // HF: HostFunctionsT + 'static,
258
259
{
259
260
let frontier_block_import = FrontierBlockImport :: new ( client. clone ( ) , client) ;
260
261
Ok ( (
@@ -268,25 +269,25 @@ where
268
269
}
269
270
270
271
/// Builds a new service for a full client.
271
- pub async fn new_full < B , RA , HF , NB > (
272
+ pub async fn new_full < NB > (
272
273
mut config : Configuration ,
273
274
eth_config : EthConfiguration ,
274
275
sealing : Option < Sealing > ,
275
276
) -> Result < TaskManager , ServiceError >
276
277
where
277
- B : BlockT < Hash = H256 > ,
278
- NumberFor < B > : BlockNumberOps ,
279
- <B as BlockT >:: Header : Unpin ,
280
- RA : ConstructRuntimeApi < B , FullClient < B , RA , HF > > ,
281
- RA : Send + Sync + ' static ,
282
- RA :: RuntimeApi : RuntimeApiCollection < B , AuraId , AccountId , Nonce , Balance > ,
283
- HF : HostFunctionsT + ' static ,
284
- NB : sc_network:: NetworkBackend < B , <B as sp_runtime :: traits :: Block >:: Hash > ,
278
+ // B: BlockT<Hash = H256>,
279
+ NumberFor < Block > : BlockNumberOps ,
280
+ // <B as BlockT>::Header: Unpin,
281
+ // RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
282
+ // RA: Send + Sync + 'static,
283
+ // RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
284
+ // HF: HostFunctionsT + 'static,
285
+ NB : sc_network:: NetworkBackend < Block , <Block as BlockT >:: Hash > ,
285
286
{
286
287
let build_import_queue = if sealing. is_some ( ) {
287
- build_manual_seal_import_queue :: < B , RA , HF >
288
+ build_manual_seal_import_queue
288
289
} else {
289
- build_aura_grandpa_import_queue :: < B , RA , HF >
290
+ build_aura_grandpa_import_queue
290
291
} ;
291
292
292
293
let PartialComponents {
@@ -332,7 +333,7 @@ where
332
333
None
333
334
} else {
334
335
net_config. add_notification_protocol ( grandpa_protocol_config) ;
335
- let warp_sync: Arc < dyn WarpSyncProvider < B > > =
336
+ let warp_sync: Arc < dyn WarpSyncProvider < Block > > =
336
337
Arc :: new ( sc_consensus_grandpa:: warp_proof:: NetworkProvider :: new (
337
338
backend. clone ( ) ,
338
339
grandpa_link. shared_authority_set ( ) . clone ( ) ,
@@ -378,10 +379,11 @@ where
378
379
379
380
let role = config. role ;
380
381
let force_authoring = config. force_authoring ;
381
- let backoff_authoring_blocks = Some ( BackoffAuthoringOnFinalizedHeadLagging :: < NumberFor < B > > {
382
- unfinalized_slack : 6u32 . into ( ) ,
383
- ..Default :: default ( )
384
- } ) ;
382
+ let backoff_authoring_blocks =
383
+ Some ( BackoffAuthoringOnFinalizedHeadLagging :: < NumberFor < Block > > {
384
+ unfinalized_slack : 6u32 . into ( ) ,
385
+ ..Default :: default ( )
386
+ } ) ;
385
387
let name = config. network . node_name . clone ( ) ;
386
388
let frontier_backend = Arc :: new ( frontier_backend) ;
387
389
let enable_grandpa = !config. disable_grandpa && sealing. is_none ( ) ;
@@ -395,7 +397,7 @@ where
395
397
// The MappingSyncWorker sends through the channel on block import and the subscription emits a notification to the subscriber on receiving a message through this channel.
396
398
// This way we avoid race conditions when using native substrate block import notification stream.
397
399
let pubsub_notification_sinks: fc_mapping_sync:: EthereumBlockNotificationSinks <
398
- fc_mapping_sync:: EthereumBlockNotification < B > ,
400
+ fc_mapping_sync:: EthereumBlockNotification < Block > ,
399
401
> = Default :: default ( ) ;
400
402
let pubsub_notification_sinks = Arc :: new ( pubsub_notification_sinks) ;
401
403
@@ -447,7 +449,7 @@ where
447
449
client : client. clone ( ) ,
448
450
pool : pool. clone ( ) ,
449
451
graph : pool. pool ( ) . clone ( ) ,
450
- converter : Some ( TransactionConverter :: < B > :: default ( ) ) ,
452
+ converter : Some ( TransactionConverter :: < Block > :: default ( ) ) ,
451
453
is_authority,
452
454
enable_dev_signer,
453
455
network : network. clone ( ) ,
@@ -640,16 +642,10 @@ pub async fn build_full(
640
642
) -> Result < TaskManager , ServiceError > {
641
643
match config. network . network_backend {
642
644
sc_network:: config:: NetworkBackendType :: Libp2p => {
643
- new_full :: < Block , RuntimeApi , HostFunctions , sc_network:: NetworkWorker < _ , _ > > (
644
- config, eth_config, sealing,
645
- )
646
- . await
645
+ new_full :: < sc_network:: NetworkWorker < _ , _ > > ( config, eth_config, sealing) . await
647
646
}
648
647
sc_network:: config:: NetworkBackendType :: Litep2p => {
649
- new_full :: < Block , RuntimeApi , HostFunctions , sc_network:: Litep2pNetworkBackend > (
650
- config, eth_config, sealing,
651
- )
652
- . await
648
+ new_full :: < sc_network:: NetworkWorker < _ , _ > > ( config, eth_config, sealing) . await
653
649
}
654
650
}
655
651
}
@@ -675,35 +671,31 @@ pub fn new_chain_ops(
675
671
task_manager,
676
672
other,
677
673
..
678
- } = new_partial :: < Block , RuntimeApi , HostFunctions , _ > (
679
- config,
680
- eth_config,
681
- build_aura_grandpa_import_queue,
682
- ) ?;
674
+ } = new_partial ( config, eth_config, build_aura_grandpa_import_queue) ?;
683
675
Ok ( ( client, backend, import_queue, task_manager, other. 3 ) )
684
676
}
685
677
686
678
#[ allow( clippy:: too_many_arguments) ]
687
- fn run_manual_seal_authorship < B , RA , HF > (
679
+ fn run_manual_seal_authorship (
688
680
eth_config : & EthConfiguration ,
689
681
sealing : Sealing ,
690
- client : Arc < FullClient < B , RA , HF > > ,
691
- transaction_pool : Arc < FullPool < B , FullClient < B , RA , HF > > > ,
692
- select_chain : FullSelectChain < B > ,
693
- block_import : BoxBlockImport < B > ,
682
+ client : Arc < Client > ,
683
+ transaction_pool : Arc < FullPool < Block , Client > > ,
684
+ select_chain : FullSelectChain < Block > ,
685
+ block_import : BoxBlockImport < Block > ,
694
686
task_manager : & TaskManager ,
695
687
prometheus_registry : Option < & Registry > ,
696
688
telemetry : Option < & Telemetry > ,
697
689
commands_stream : mpsc:: Receiver <
698
- sc_consensus_manual_seal:: rpc:: EngineCommand < <B as BlockT >:: Hash > ,
690
+ sc_consensus_manual_seal:: rpc:: EngineCommand < <Block as BlockT >:: Hash > ,
699
691
> ,
700
692
) -> Result < ( ) , ServiceError >
701
- where
702
- B : BlockT ,
703
- RA : ConstructRuntimeApi < B , FullClient < B , RA , HF > > ,
704
- RA : Send + Sync + ' static ,
705
- RA :: RuntimeApi : RuntimeApiCollection < B , AuraId , AccountId , Nonce , Balance > ,
706
- HF : HostFunctionsT + ' static ,
693
+ // where
694
+ // B: BlockT,
695
+ // RA: ConstructRuntimeApi<B, FullClient<B, RA, HF>>,
696
+ // RA: Send + Sync + 'static,
697
+ // RA::RuntimeApi: RuntimeApiCollection<B, AuraId, AccountId, Nonce, Balance>,
698
+ // HF: HostFunctionsT + 'static,
707
699
{
708
700
let proposer_factory = sc_basic_authorship:: ProposerFactory :: new (
709
701
task_manager. spawn_handle ( ) ,
0 commit comments