@@ -19,7 +19,6 @@ use futures::{
1919 prelude:: * ,
2020 task:: { Context , Poll } ,
2121} ;
22- use futures_timer:: Delay ;
2322use log:: { debug, trace} ;
2423use prometheus_endpoint:: Registry ;
2524use sc_utils:: mpsc:: { tracing_unbounded, TracingUnboundedReceiver , TracingUnboundedSender } ;
@@ -28,7 +27,7 @@ use sp_runtime::{
2827 traits:: { Block as BlockT , Header as HeaderT , NumberFor } ,
2928 Justification , Justifications ,
3029} ;
31- use std:: { pin:: Pin , time :: Duration } ;
30+ use std:: pin:: Pin ;
3231
3332use crate :: {
3433 import_queue:: {
@@ -224,7 +223,6 @@ async fn block_import_process<B: BlockT>(
224223 mut result_sender : BufferedLinkSender < B > ,
225224 mut block_import_receiver : TracingUnboundedReceiver < worker_messages:: ImportBlocks < B > > ,
226225 metrics : Option < Metrics > ,
227- delay_between_blocks : Duration ,
228226) {
229227 loop {
230228 let worker_messages:: ImportBlocks ( origin, blocks) = match block_import_receiver. next ( ) . await
@@ -239,15 +237,9 @@ async fn block_import_process<B: BlockT>(
239237 } ,
240238 } ;
241239
242- let res = import_many_blocks (
243- & mut block_import,
244- origin,
245- blocks,
246- & mut verifier,
247- delay_between_blocks,
248- metrics. clone ( ) ,
249- )
250- . await ;
240+ let res =
241+ import_many_blocks ( & mut block_import, origin, blocks, & mut verifier, metrics. clone ( ) )
242+ . await ;
251243
252244 result_sender. blocks_processed ( res. imported , res. block_count , res. results ) ;
253245 }
@@ -276,13 +268,11 @@ impl<B: BlockT> BlockImportWorker<B> {
276268 let ( justification_sender, mut justification_port) =
277269 tracing_unbounded ( "mpsc_import_queue_worker_justification" , 100_000 ) ;
278270
279- let ( block_import_sender, block_import_port ) =
271+ let ( block_import_sender, block_import_receiver ) =
280272 tracing_unbounded ( "mpsc_import_queue_worker_blocks" , 100_000 ) ;
281273
282274 let mut worker = BlockImportWorker { result_sender, justification_import, metrics } ;
283275
284- let delay_between_blocks = Duration :: default ( ) ;
285-
286276 let future = async move {
287277 // Let's initialize `justification_import`
288278 if let Some ( justification_import) = worker. justification_import . as_mut ( ) {
@@ -295,9 +285,8 @@ impl<B: BlockT> BlockImportWorker<B> {
295285 block_import,
296286 verifier,
297287 worker. result_sender . clone ( ) ,
298- block_import_port ,
288+ block_import_receiver ,
299289 worker. metrics . clone ( ) ,
300- delay_between_blocks,
301290 ) ;
302291 futures:: pin_mut!( block_import_process) ;
303292
@@ -394,7 +383,6 @@ async fn import_many_blocks<B: BlockT, V: Verifier<B>>(
394383 blocks_origin : BlockOrigin ,
395384 blocks : Vec < IncomingBlock < B > > ,
396385 verifier : & mut V ,
397- delay_between_blocks : Duration ,
398386 metrics : Option < Metrics > ,
399387) -> ImportManyBlocksResult < B > {
400388 let count = blocks. len ( ) ;
@@ -460,11 +448,7 @@ async fn import_many_blocks<B: BlockT, V: Verifier<B>>(
460448
461449 results. push ( ( import_result, block_hash) ) ;
462450
463- if delay_between_blocks != Duration :: default ( ) && !has_error {
464- Delay :: new ( delay_between_blocks) . await ;
465- } else {
466- Yield :: new ( ) . await
467- }
451+ Yield :: new ( ) . await
468452 }
469453}
470454
0 commit comments