@@ -20,7 +20,6 @@ use futures::FutureExt;
20
20
use minimal_template_runtime:: { interface:: OpaqueBlock as Block , RuntimeApi } ;
21
21
use polkadot_sdk:: {
22
22
sc_client_api:: backend:: Backend ,
23
- sc_consensus_manual_seal:: { seal_block, SealBlockParams } ,
24
23
sc_executor:: WasmExecutor ,
25
24
sc_service:: { error:: Error as ServiceError , Configuration , TaskManager } ,
26
25
sc_telemetry:: { Telemetry , TelemetryWorker } ,
@@ -108,7 +107,7 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
108
107
}
109
108
110
109
/// Builds a new service for a full client.
111
- pub async fn new_full < Network : sc_network:: NetworkBackend < Block , <Block as BlockT >:: Hash > > (
110
+ pub fn new_full < Network : sc_network:: NetworkBackend < Block , <Block as BlockT >:: Hash > > (
112
111
config : Configuration ,
113
112
consensus : Consensus ,
114
113
) -> Result < TaskManager , ServiceError > {
@@ -197,7 +196,7 @@ pub async fn new_full<Network: sc_network::NetworkBackend<Block, <Block as Block
197
196
telemetry : telemetry. as_mut ( ) ,
198
197
} ) ?;
199
198
200
- let mut proposer = sc_basic_authorship:: ProposerFactory :: new (
199
+ let proposer = sc_basic_authorship:: ProposerFactory :: new (
201
200
task_manager. spawn_handle ( ) ,
202
201
client. clone ( ) ,
203
202
transaction_pool. clone ( ) ,
@@ -207,39 +206,16 @@ pub async fn new_full<Network: sc_network::NetworkBackend<Block, <Block as Block
207
206
208
207
match consensus {
209
208
Consensus :: InstantSeal => {
210
- // Seal a first block to trigger fork-aware txpool `maintain`, and create a first
211
- // view. This is necessary so that sending txs will not keep them in mempool for
212
- // an undeterminated amount of time.
213
- //
214
- // If single state txpool is used there's no issue if we're sealing a first block in
215
- // advance.
216
- let create_inherent_data_providers =
217
- |_, ( ) | async move { Ok ( sp_timestamp:: InherentDataProvider :: from_system_time ( ) ) } ;
218
- let mut client_mut = client. clone ( ) ;
219
- let consensus_data_provider = None ;
220
- let seal_params = SealBlockParams {
221
- sender : None ,
222
- parent_hash : None ,
223
- finalize : true ,
224
- create_empty : true ,
225
- env : & mut proposer,
226
- select_chain : & select_chain,
227
- block_import : & mut client_mut,
228
- consensus_data_provider,
229
- pool : transaction_pool. clone ( ) ,
230
- client : client. clone ( ) ,
231
- create_inherent_data_providers : & create_inherent_data_providers,
232
- } ;
233
- seal_block ( seal_params) . await ;
234
-
235
209
let params = sc_consensus_manual_seal:: InstantSealParams {
236
210
block_import : client. clone ( ) ,
237
211
env : proposer,
238
212
client,
239
213
pool : transaction_pool,
240
214
select_chain,
241
215
consensus_data_provider : None ,
242
- create_inherent_data_providers,
216
+ create_inherent_data_providers : move |_, ( ) | async move {
217
+ Ok ( sp_timestamp:: InherentDataProvider :: from_system_time ( ) )
218
+ } ,
243
219
} ;
244
220
245
221
let authorship_future = sc_consensus_manual_seal:: run_instant_seal ( params) ;
0 commit comments